Commit Graph

295288 Commits

Author SHA1 Message Date
reinoud f41dcb03b1 Initial commit of the fsck_udf(8) utility that checks and repairs UDF
filesystems on optical media as well as on disc images, harddisc partitions
and wedges.
2022-04-06 13:35:50 +00:00
reinoud 8f4e1cd991 Refactor and rewrite of newfs_udf(8) and makefs(8) (-t udf) with a shared
section for fsck_udf(8).

Newfs_udf and makefs support predefined disc image profiles, harddisc
partitions (disklabel and wedges on all generic block devices) and all optical
media types on CD/DVD/BD writers.

Newfs_udf and makefs now also support formatting of UDF 2.50 with a metadata
partition.
2022-04-06 13:29:15 +00:00
gson 49a41610de Add a regression test for PR kern/52239, "Changing protections of
already mmap'ed region can fail", based on the test program in the PR.
2022-04-06 10:02:55 +00:00
gutteridge f2240c734a makemandb.c: fail sooner if man page dirs can't be found
There's no point initializing database state if we're then going to
fail to locate any man page sources. Make all the initial state checks
contiguous for simplicity and readability. Also, free the variable
"command" on the error path, and correct the error message.
2022-04-06 03:23:38 +00:00
rillig 9b807e707f lint: remove unused message 40
I had not been used since 1995, when lint was imported to NetBSD.
2022-04-05 23:13:56 +00:00
rillig e6d4541762 tests/lint: add tests for a few early messages 2022-04-05 23:09:19 +00:00
gson 7109944a00 In the mmap_err test case, mmap the address, not the address of the address.
Should fix PR kern/56780.
2022-04-05 15:59:22 +00:00
gson fdc1a24341 When the t_mmap:mmap_err test fails due to errno not having the expected
value of EINVAL, print the actual value.
2022-04-05 13:09:54 +00:00
andvar 599da1204d s/confortable/comfortable/ 2022-04-05 06:43:54 +00:00
skrll 8aa5950677 Sync with new DTS 2022-04-05 05:04:04 +00:00
skrll 0d30607918 KNF 2022-04-05 04:33:36 +00:00
andvar e82c4d9bb4 fix various typos, mainly in comments. 2022-04-04 19:33:44 +00:00
martin 6c25ecc76a Avoid signed/unsigned comparision by casting the sizeof expression. 2022-04-04 09:59:41 +00:00
blymn 4e52579178 Use the original right boundary when calculating the vertical scroll
region so the boundary does not creep left on each subsequent setting.
Thanks to Martin@ for the report.
2022-04-04 07:04:20 +00:00
yamaguchi 9256f0717e Fix missing m_reset_rcvif for allocated mbuf 2022-04-04 06:12:27 +00:00
yamaguchi d1fb119648 Move input processing of lagg(4) before ether_input
to get rid of dependence.

This implementation is similar with that of bridge(4).
2022-04-04 06:10:00 +00:00
christos 4776dc4064 Improve wording to avoid confusion about the return value of {v,}asprintf(3) 2022-04-03 14:17:53 +00:00
rillig d0d6249954 lint: fix crash after syntax error in array declaration 2022-04-03 10:05:22 +00:00
martin abe9a4b554 efi_rtcopy is only used on little endian kernels. 2022-04-03 09:49:36 +00:00
rillig dc0c5ce6ac tests/lint: make a few tests self-contained, add some others 2022-04-03 09:34:45 +00:00
christos de7269d56c new ISC dhcp 2022-04-03 01:12:47 +00:00
christos f407d9293b Merge conflicts between dhcp-4.4.2P1 and dhcp-4.4.3 2022-04-03 01:10:57 +00:00
christos 41e8421f37 Import dhcp-4.4.3
Changes since 4.4.2-P1 (New Features)

- Two new OMAPI function calls were added, `dhcpctl_timed_connect()`
  and `dhcpctl_timed_wait_for_completion()`. These provide timed
  versions of creating a connection and waiting for an operation
  to complete.
  [GitLab #76]

- The BIND libraries have been updated to the latest version, 9.11.36.
  This fixes a number of compilation issues on various systems, including
  OpenWRT. Thanks to Philip Prindeville for testing on OpenWRT.
  [GitLab #218, #171, #180, #192]

- Support was added for the new DHCPv4 option v6-only-preferred, specified
  in RFC 8925. A new reason code, V6ONLY, was added to the client script
  and the client Linux script sample was updated.
  [GitLab #132]

		Changes since 4.4.2-P1 (Bug Fixes)

- Minor corrections were made to allow compilation under gcc 10.
  [GitLab #117]

- The logic in dhclient that causes it to decline DHCPv4 leases if the
  client script exits abnormally (i.e. crashes) has been corrected.
  [GitLab #123]

- The limit on the size of a lease file that can be loaded at startup
  is now only enforced on 32-bit systems.
  [GitLab #92]

- The PRNG initialization has been improved. It now uses the configure flag
  `--with-randomdev=PATH`, which specifies the device from which to read the
  initial seed. That is typically `/dev/random` (the default value) or
  `/dev/urandom`, but may be specified otherwise on the local system. The old
  behavior can be forced by disabling this feature (`--with-randomdev=no`).
  If the initialization is disabled or reading from the random device fails,
  the previous algorithm (retrieve the last four bytes of hardware addresses
  from all network interfaces that have them, and use the current time and
  process ID) is used.
  [GitLab #197]

- A minor dhclient code fix was made to remove compilation warnings.
  [GitLab #190]

- The hard-coded MD5 algorithm name was removed in OMAPI connection logic.
  Previously, using any other algorithm via a key-algorithm statement would
  allow OMAPI connections to be made, but subsequent actions such as updating
  an object would fail.
  [GitLab #148]

- The parallel build has been improved. Thanks to Sergei Trofimovich for
  the patch. The parallel build is still experimental, as officially the
  BIND 9 code does not support the parallel build for libraries.
  [GitLab #91]

- Handling of LDAP options (`ldap-gssapi-principal` and `ldap-gssapi-keytab`)
  has been improved. This is contributed code that has not been tested by ISC.
  Thank you to Petr Mensik and Pavel Zhukov for the patches!
  [GitLab !56,!75]

- It is now possible to use `option -g ipaddr` in the dhcrelay to replace the
  giaddr sent to clients with the given ipaddr, to work around bogus clients
  like Solaris 11 grub which use giaddr instead of the announced router (3)
  to set up their default route. Thanks to Jens Elkner for the patch!
  [GitLab #223, !86, !92]
2022-04-03 01:08:35 +00:00
rillig bbec5f69b6 lint: fix crash after syntax error in GCC statement expression
Since cgram.y 1.226 from 2021-05-03.
2022-04-03 00:39:32 +00:00
rillig 0edc266bb4 lint: clean up style
Remove outdated ARGSUSED (the one in tree.c had been wrong since 1995),
remove unused argument.

No functional change.
2022-04-02 22:38:45 +00:00
rillig a0fae887e7 lint: use appropriate alignment on both the host and target platform 2022-04-02 22:15:57 +00:00
rillig 4d0a0200e3 lint: remove unreachable message 'compiler takes alignment of function' 2022-04-02 21:47:04 +00:00
rillig 953cc1178c lint: try harder to recover after syntax errors
lint: assertion "false" failed in declarator_name at decl.c:1596
    near msg_022.c:22
2022-04-02 20:12:45 +00:00
mlelstv ce965a625d Don't attach Yubikeys as console keyboard. 2022-04-02 19:19:12 +00:00
mlelstv 2c701485e4 Avoid integer overflow on systems with 32bit disk addresses. 2022-04-02 19:16:49 +00:00
mlelstv d6a8de1acc Avoid crashes with invalid or tiny sector sizes. 2022-04-02 19:15:09 +00:00
rillig 7b8d15aa4a lint: extract type creation into separate functions
No functional change.
2022-04-02 18:15:43 +00:00
rillig af37d7dff6 lint: inline setcomplete
No functional change.
2022-04-02 17:28:06 +00:00
rillig 3834b80cbd lint: untangle nested variable assignments
The code is buggy (see decl_direct_abstract.c), so at least make it
readable, making it hopefully easier to fix the bugs.

Before decl.c 1.18 from 2000-07-05, lint crashed when it parsed
'sizeof(int(double))', since that commit it has been hiding the bugs,
working with wrong type information instead.

Fix the logged type in add_function (had been wrong since today).
2022-04-02 16:27:03 +00:00
rillig 23a7bada3e lint: do not log dinfo_t pointers in debug mode
Before the addition of debug_dinfo from today, this had been the only
way to notice changes to the global 'dcs' variable.  Since the content
of that variable is now logged, the pointer is not needed anymore.
2022-04-02 14:35:47 +00:00
rillig 6e57e5d2c2 lint: rename dinfo_t.d_next to d_enclosing
The name d_next gave the wrong impression that the declaration infos
would be independent of each other, but they are nested.

No functional change.
2022-04-02 14:28:30 +00:00
rillig b839cf9837 lint: add debug logging for the declaration stack
To track down the wrong edge cases in decl_direct_abstract.c.
2022-04-02 12:24:54 +00:00
skrll e65a0eaa66 Update to support EFI runtime outside the kernel virtual address space
by creating an EFI RT pmap that can be activated / deactivated when
required.

Adds support for EFI RT to ARM_MMU_EXTENDED (ASID) 32-bit Arm machines.

On Arm64 the usage of pmapboot_enter is reduced and the mappings are
created much later in the boot process -- now in cpu_startup_hook.
Backward compatiblity for KVA mapped RT from old bootaa64.efi is
maintained.

Adding support to other platforms should be easier as a result.
2022-04-02 11:16:06 +00:00
riastradh 7c69fd1390 cgd(4): Omit technically-correct-but-broken adiantum dependency again.
It is true that cgd_crypto.c depends on sys/crypto/adiantum now, and
transitively on sys/crypto/aes.

However, there's a problem with the cgd module having a formal
(transitive) module dependency on the aes module.

Yesterday I thought the problem with this was that fpu_kern_enter was
artificially restricted while cold -- to detect, and noisily crash
on, reentrance, it raises the IPL to IPL_VM, asserts that the IPL is
not _higher_ (so it can't be re-entered by an IPL_SCHED or IPL_HIGH
interrupt), and asserts that it's not currently in use on the current
CPU.

Early at boot, the IPL is at IPL_HIGH, and no interrupts are possible
anyway, so the assertions tripped for artificial reasons, which I
fixed in:

https://mail-index.netbsd.org/source-changes/2022/04/01/msg137840.html

However, I had forgotten that there's a deeper problem for the cgd
module dependency on aes.  The ordering of events is:

1. Initialize builtin MODULE_CLASS_DRIVER modules -- including cgd.

2. Run configure -- including detecting CPUs, which on aarch64 is
   where the decision of which AES (and ChaCha) implementation to use
   based on supported CPU features.

3. Initialize builtin MODULE_CLASS_MISC modules -- including aes,
   _if_ there are no driver-class modules that depend on it.

There's a tangle of ordering dependencies here:

- MODULE_CLASS_DRIVER modules providing _autoconf_ drivers generally
  have to be initialized _before_ configure, because you need the
  driver to be initialized before configure can attach its devices.

- configure must run _before_ aes is initialized because the decision
  of which AES implementation to choose depends on CPU features
  detected in configure, and the prospect of dynamically changing the
  AES implementation is too painful to contemplate (it may change the
  key schedule, so it would invalidate any existing key schedules
  precomputed by callers like uvm_swap or configured cgd devices,
  which raises a host of painful concurrency issues to invalidate
  these cached key schedules on all CPUs in all subsystems using
  them).

- cgd doesn't figure into the configure stage of autoconf, but it
  nevertheless has to be MODULE_CLASS_DRIVER because specfs autoloads
  MODULE_CLASS_DRIVER modules in case they provide _devsw_ drivers
  (i.e., /dev nodes), as cgd does.  And we don't have a mechanism for
  identifying `autoconf driver modules' separately from `devsw driver
  modules' because some modules provide both and each module can have
  only one class.

For now, this is breaking boot on several tier I architectures so
let's nix the cgd->adiantum->aes module dependency as a stop-gap
measure.
2022-04-02 09:53:20 +00:00
rillig 7c13327109 lint: add type details to message about 'sizeof(function)'
The code in add_function is severely broken, it mixes up the return type
of the function with the argument types.  For now, at least show the
guessed type in the diagnostic, to allow human readers quickly spot the
bug.

Extend the test cases in decl_direct_abstract.c to show that the
behavior differs unreasonably if the first parameter of the function is
equal to its return type.
2022-04-01 23:16:31 +00:00
rillig c902579041 lint: improve determination of abstract typename
Still not perfect, but at least a step in the right direction.  See
decl_direct_abstract.c for the missing edge cases.

See PR#22119.
2022-04-01 22:28:21 +00:00
rillig e5495b7249 lint: add details to message about illegal return type 2022-04-01 22:07:23 +00:00
andvar 9991cde4dd Remove floppy installation instructions from sparc documentation.
Floppy generation was disabled before NetBSD 6.0 release due to size
constraints and unlikely to be restored soon or at all. PR port-sparc/56776.
ok martin.
2022-04-01 21:53:35 +00:00
rillig 96d2220fa5 tests/lint: fix comment about backslash-newline 2022-04-01 21:12:42 +00:00
pgoyette bb82a354ac Create a loaable adiantum module, and make cgd require it.
This enablees use of a loadable cgd module, rather thtan requiring
it to be built-in.

Partially resolves kern/56772
2022-04-01 21:09:24 +00:00
rillig f6ecb24f1b lint: add debug logging for type declarators
This will help in fixing the wrong type in msg_347.c, as well as the
assertion failure for 'sizeof(int())'.
2022-04-01 20:38:37 +00:00
rillig 291b04874e lint: fix indentation and spacing, add a missing 'else' to 'else if'
No functional change.
2022-04-01 20:29:37 +00:00
riastradh b451bcfc45 x86, arm: Allow fpu_kern_enter/leave while cold.
Normally these are forbidden above IPL_VM, so that FPU usage doesn't
block IPL_SCHED or IPL_HIGH interrupts.  But while cold, e.g. during
builtin module initialization at boot, all interrupts are blocked
anyway so it's a moot point.

Also initialize x86 cpu_info_primary.ci_kfpu_spl to -1 so we don't
trip over an assertion about it while cold -- the assertion is meant
to detect reentrance into fpu_kern_enter/leave, which is prohibited.

Also initialize cpu0's ci_kfpu_spl.
2022-04-01 19:57:22 +00:00
andvar 12ad5afd80 s/potected/protected and s/investication/investigation/ in comments. 2022-04-01 19:02:12 +00:00
pgoyette 7694d68911 Split i2c_subr.c into a separate module rather than including it in
the iic module.  There are valid configurations where i2c_subr code
can be both built-in and part of a loaded module (eg, piixpm is in
the kernel, but the iic module is loaded later).  This causes the
in-kernel linker to detect a duplicate symbol.
2022-04-01 15:49:11 +00:00