Commit Graph

305572 Commits

Author SHA1 Message Date
riastradh d302773e0e apei(4): Pacify -Wsign-compare.
Assert that the parsing made forward progress too while here.

PR kern/58046
2024-03-20 18:47:59 +00:00
riastradh 4b159fe528 apei(4): New driver for ACPI Platform Error Interfaces.
For now it is wired up only in x86 ALL kernels, and built as a module
for x86 and Arm.  Once it gets a little more testing on machines with
APEI, I would like to flip it on by default.

PR kern/58046
2024-03-20 17:11:42 +00:00
riastradh 9a55048f5c x86: Release the ramdisks too.
This way we will get cgdroot.fs (and zfsroot.fs too) in the release.

PR misc/57534
2024-03-20 13:51:35 +00:00
riastradh 3cdf638023 libcrypto: Add expected symbol list to check at build-time. 2024-03-20 13:50:51 +00:00
riastradh 837a54d9ce bsd.lib.mk: Check expected vs actual symbols at build-time.
If, for LIB=foo, you create a file foo.expsym, bsd.lib.mk will list
the dynamic symbols and their versions with

nm --dynamic --extern-only --defined-only --with-symbol-versions

and compare the names (not addresses or types) to foo.expsym.  If
there are any differences, they will be printed and the build will
fail.

foo.expsym should be sorted with `LANG=C sort -u'.

This way, you can verify changes don't inadvertently add or remove
symbols.  If you do want to add (or, if you're bumping the major,
remove) symbols, you can verify the changes and edit the foo.expsym
file accordingly.  This will also help to enforce rules about symbol
changes on pullups in release branches.

Note that using a version map (-Wl,--version-script=...) doesn't
catch symbol removal -- ld quietly ignores symbols in the version map
that aren't actually defined by any object in the library.  So this
supplements the version map.

Proposed on tech-userlevel:
https://mail-index.NetBSD.org/tech-userlevel/2024/03/16/msg014264.html
2024-03-20 13:50:37 +00:00
riastradh 864e67f08d acpi(4): Make apeibus actually work as an iattr.
PR kern/58046
2024-03-20 12:43:13 +00:00
rillig aabd8f68ba sparc64/fpsetround: avoid shifting into the sign bit
Lint had warned about the constant expression '0x03 << 30' but not about
the structurally equal nonconstant expression '(rnd_dir & 0x03) << 30'.

No binary change.
2024-03-20 06:15:39 +00:00
riastradh 062c0d7e32 acpi(4): New iattr `apeibus' for attaching an APEI driver.
APEI is the ACPI Platform Error Interface, a standard (if very
complicated) interface for reporting hardware errors to the OS.

Firmware support for APEI is presented through the ACPI tables BERT
(Boot Error Record Table), ERST (Error Record Serialization Table),
EINJ (Error Injection Table), and HEST (Hardware Error Source Table),
rather than through nodes in the ACPI device tree, so it can't just
attach through the existing acpinodebus iattr and instead requires a
special pseudo-bus like acpiwdrt(4).

No driver yet -- this is just the hook to attach one in a module.

The new member sc_apei of struct acpi_softc is placed at the end of
the structure so that this change can be safely pulled up to release
branches without risk to ABI compatibility in existing modules such
as acpiverbose.kmod which may rely on the layout (but not size) of
struct acpi_softc.

PR kern/58046
2024-03-20 03:14:45 +00:00
christos b81d0cd3ca Fix reproducible builds (Jan-Benedict Glaw) 2024-03-20 00:35:21 +00:00
christos 0cec432304 remove extra stat (Jan-Benedict Glaw) 2024-03-20 00:34:32 +00:00
christos a47d0a4f5e Fix reproducible builds (Jan-Benedict Glaw) 2024-03-20 00:31:54 +00:00
rillig d7b3b04319 lint: keep invalid arguments in function calls
Previously, arguments of incomplete type or 'void' cleared all arguments
of the function call expression, requiring extra checks in later checks.

Invalid function calls are now exported to the .ln files, but that's
irrelevant in practice as these invalid function calls make lint1 fail,
after which xlint removes the .ln file.
2024-03-19 23:19:03 +00:00
gutteridge eac9df6f33 cpuctl.8: fix grammar in a sentence 2024-03-19 01:19:11 +00:00
gutteridge 9e0c61f79f ipsec.4: minor grammatical improvements 2024-03-18 22:47:19 +00:00
martin 56e0726f28 The fetestexcept_trap test case only makes sense on FPUs that implement
exceptions.
2024-03-18 16:33:54 +00:00
riastradh eea7d4e0e0 strptime(3): Declare digit d as time_t.
This doesn't make a semantic difference -- d can only take on the ten
values {0,1,2,3,4,5,6,7,8,9}, and the arithmetic with it later all
comes out the same whether the type is unsigned or time_t, even if
time_t were int32_t instead of int64_t.

But it pacifies overzealous compilers used by downstream users of
this code.  And while it's silly to use a much wider type (64-bit
signed) than is needed here to store a single digit, it doesn't
really hurt either (32-bit unsigned is much larger than needed too).

PR lib/58041
2024-03-18 16:15:24 +00:00
jakllsch 010a79541e Use HUD_PEN instead of 0x0002 as appropriate 2024-03-18 15:15:27 +00:00
wiz 03dff19df5 hier(7): remove reference to /var/db/pkg
The pkg database lives in ${PREFIX}/pkgdb instead now.

Bump date.
2024-03-17 22:05:23 +00:00
andvar a5c0af2445 Add missing "e" in few words, in comments and one log message. 2024-03-17 21:48:01 +00:00
andvar bb2336b065 s/argumment/argument/ in documentation. 2024-03-17 21:37:53 +00:00
jakllsch 0cb28d4d87 Prevent errant ucycom-presenting device from causing up to 225
bytes of kernel memory following input buffer to leak to tty
application.

Probably not practically expolitable, but you never know.
2024-03-17 20:10:52 +00:00
ryoon 5970d5082c Remove debug print 2024-03-16 23:40:25 +00:00
christos c75928623b make all QUAD constants look the same. 2024-03-16 21:50:47 +00:00
andvar ea87150b65 s/Broardcast/Broadcast/ in comment. 2024-03-16 18:17:39 +00:00
riastradh 7b531fef3d strptime(3): Reduce unnecessary indentation.
Post-fix tidying.

No functional change intended.

PR lib/58041
2024-03-16 00:16:21 +00:00
riastradh 5f253fa591 strptime(3): Avoid arithmetic overflow.
PR lib/58041
2024-03-16 00:06:45 +00:00
riastradh 086a7f840a strptime(3): Exercise some edge cases in the automatic tests.
Unfortunately, we can't quite use strptime as a black box to detect
the cases that triggered undefined behaviour, because strptime just
fails in that case anyway since the number that would go in .tm_year
is far out of the representable range.

PR lib/58041
2024-03-16 00:06:37 +00:00
andvar 78ec8e42b9 "retval = 0" should be "*retval = 0", should fix the broken build. 2024-03-15 22:15:21 +00:00
andvar 86c524b4ca Rewrite !VMSWAP uvm_swap_stats() macro as a static function. NFCI.
From riastradh
2024-03-15 20:09:31 +00:00
riastradh f1f68b211d libcrypto: Fix buffer overrun in truncated SHA-512 functions.
Further fallout from the libc/openssl sha2 symbol collision.

PR lib/58039
2024-03-15 18:10:37 +00:00
nia c58d8f331b doc: changes from the last 2 weeks 2024-03-15 17:47:02 +00:00
riastradh 4cf835aac8 doc/3RDPARTY: Note OpenSSL vendor/release tags. 2024-03-15 15:49:01 +00:00
riastradh 1e152b590b libcrypto: Add some trivial tests for truncated SHA-512 variants.
These should use more of the test vectors from

https://csrc.nist.gov/Projects/Cryptographic-Algorithm-Validation-Program/Secure-Hashing#Testing

but this will do for now to detect the buffer overrun rake we left
lying around for ourselves.

PR lib/58039
2024-03-15 15:32:07 +00:00
andvar 6b7b0b2ad4 Fix !VMSWAP build:
Added __unused for few local variables, which are used in VMSWAP block only.
Adjust !VMSWAP uvm_swap_stats() definition to make it build with compat code.
Copied "int (*uvm_swap_stats50)(...)" definition from uvm_swap to uvm_swapstub
to avoid missing uvm_swap_stats50 reference on linking.

Fixes INSTALL_CPMBR1400, INSTALL_ZYXELKX evbmips kernel configs as a result.

Reviewed by simon and phone in IRC (thanks).
2024-03-15 07:09:37 +00:00
riastradh 9c98722158 evbarm/instkernel/sshramdisk: Put firmware in the right paths.
Maybe this should also be wired up to `release' to put the ramdisk in
the releasedir so we detect destdir path leakage like this had.

PR port-evbarm/58035
2024-03-15 02:20:58 +00:00
rillig 083828859c stat: don't allow numeric formatting flags on strings
Calling snprintf with "%+s" invokes undefined behavior.
2024-03-14 21:17:54 +00:00
rillig 897cdf26ba tests/stat: test the left-aligned and right-aligned 'S' format 2024-03-14 21:00:32 +00:00
kre cdaa157c5b While the change in 1.51 certainly retained binary compat with
what was in 1.50 (while silencing LINT) - it was clearly not the
correct change to make.   The code used !FLAG_POUND where it
clearly meant ~FLAG_POUND ... the former is 0, so &= 0 could
be replaced by =0 changing nothing.   But that's not what it
should have been doing, other flags should not have been
removed here, just FLAG_POUND.

This problem seems to have existed since support for %#s
was first added in 2011, which kind of suggests how rarely
that format, particularly with other flags (like %#-s)
has ever been used (with no other flags, the bug would not
be noticed).
2024-03-14 19:38:56 +00:00
jakllsch fb93b87aa0 Use ether_crc32_be() instead of having a local bitrev32() function to
munge ether_crc32_le() output when programming multicast filter.
2024-03-14 16:43:00 +00:00
christos 107bc7662e Sync with x86_64 the quad constants. No reason to be different 2024-03-14 15:51:10 +00:00
christos b250f22a56 Fix reproducible build (Jan-Benedict Glaw) 2024-03-14 15:41:54 +00:00
jakllsch be561d813d Sync with OpenBSD 2024-03-14 15:39:23 +00:00
jakllsch 8f746c3921 Remove Reserved usages and ranges thereof
Helps align with future merge
2024-03-14 15:27:22 +00:00
jakllsch 8fc95d6b5f fix typos 2024-03-14 15:23:52 +00:00
pgoyette db83e1151a Be a bit more clear about which devices are being handled. 2024-03-14 15:19:03 +00:00
macallan 30f3457fd0 add gftfb 2024-03-14 13:18:35 +00:00
wiz d161b2e55e expat-2.6.2 is out 2024-03-14 09:13:57 +00:00
rillig 45a5eb6da3 stat: fix lint warning about constant argument to '!'
No binary change.
2024-03-14 00:07:20 +00:00
mrg 21fadbc4fc fix some sizeof() confusion.
using "const char search[4]" as a function parameter means that
"search" is actually a pointer type so "sizeof search" returns
8 on 64-bit platforms.  i mis-read this and used "sizeof *search"
which is always 1, noted by rillig.

instead of trying to avoid writing "4" twice, put it in a define
and use that in various places instead.  annoying.
2024-03-14 00:00:31 +00:00
christos 63ede46893 centrally control if we are building kerberos 2024-03-13 12:56:31 +00:00