1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-21 23:18:00 -08:00
Commit Graph

237195 Commits

Author SHA1 Message Date
jca
7dd88e41b8 ld.lld now needs 9GB of ram to link firefox/libxul.so on riscv64 2024-12-21 14:12:45 +00:00
jsg
76b1f2ebe5 change '386BSD 0.1.2.4/FreeBSD' to .Fx
the 0.2.4 patchkit for 386BSD 0.1 did not have this command
2024-12-21 13:15:36 +00:00
ratchov
0cdbd9642b sndiod: Pad the last play block using the right encoding
Fixes the short noise when playback of unsigned samples stops. We've
to call enc_sil_do() instead of padding with 0 (0 doesn't represent
silence for unsigned encodings).

Mostly from gkoehler@
2024-12-21 08:57:18 +00:00
anton
d6933ec7e0 Replace poor man's synchronization primitive (i.e. sleep) with a wait
until construct in the hopes of making these tests less flaky.
2024-12-21 07:49:03 +00:00
jsg
7ed182d8b9 correct history; a reboot command did not appear until 4BSD 2024-12-21 05:01:25 +00:00
jsg
a80738d887 correct history; ascii(7) is the first edition manual 2024-12-21 03:34:31 +00:00
jsg
f1f9609d3e ddb was not part of Mach until 3.0
"The Mach kernel has a builtin kernel debugger (kdb) based on adb"
Mach: A New Kernel Foundation For UNIX Development, USENIX Summer 1986

"The new kernel debugger has most of the features of the old kdb, but
with a more rational (gdb-like) syntax."
Mach 3.0 (mk83), ddb.man

Mark W. Eichin explains how ddb came to be in 386BSD 0.1 in
a June 1992 post to comp.unix.bsd
https://groups.google.com/g/comp.unix.bsd/c/LY3hbHwjdG0/m/ca1hS0Hp5HcJ
2024-12-21 03:10:46 +00:00
jsg
ce1c3cff25 Julian Elischer's scsi code was not part of 386BSD 0.1. It was posted to
comp.unix.bsd and was part of the 0.2.2 patchkit.  The first two commits
to NetBSD were 386BSD 0.1 and the 0.2.2 patches.

uk.c did not appear till NetBSD 1.0.

ok miod@
2024-12-21 01:00:31 +00:00
schwarze
a63b39658a Add an EXAMPLES section.
I admit this is unusually long for a manual page.  But that's not my fault
as a documentation author.  An example in a manual page ought to be minimal
to show what needs to be demonstrated, and this example is minimal in that
sense.  Making it shorter without loosing important aspects does not seem
possible.

When an API is poorly designed, one of the consequences is that that
documentation becomes harder to understand and often longer - in this
case to the point of becoming outright intimidating.  If people dislike
that, they should design better APIs in the first place rather than
blasting the poor manual page for being too long or too complicated.

OK tb@
2024-12-21 00:27:47 +00:00
mvs
8ee0399bd2 Kill `inp_notify' list remains.
This was the list where PCBs were temporary linked to avoid sleep with
`inpt_mtx' mutex(9) held. in_pcbnotifyall() and in6_pcbnotify are the
last list users, so switch them to in_pcb_iterator() too, moreover they
already do in_pcb_is_iterator() check.

Note, in_pcb_iterator() does necessary reference couter handling,
unlocked `inp' dereference is safe.

ok bluhm
2024-12-21 00:10:04 +00:00
sf
77d0f8231d virtio: Refactor attach logic
virtio 1.x requires that all queue setup, including the queue interrupt
vector, is done before setting the queue_enable register to 1. This
conflicts with how we do things right now:

* We implicitly make queue setup in virtio_alloc_vq(), which is called
  from the child driver attach functions. This also sets queue_enable=1.

* Later, we allocate the interrupts and set the queue interrupt vectors
  in the second half of the virtio transport attach functions.

This is a violation of a MUST from the standard and causes problems with
some hypervisors, in particular those that have no virtio 0.9 support,
which has no such ordering requirements.

To fix this:

* Move the interrupt allocation to a new virtio_attach_finish() function.
  This does all queue setup, including the interrupt vectors.

* Don't call virtio_setup_queue() in virtio_alloc_vq() anymore.

* We can also move the setting of the DRIVER_OK flag into this function.
  virtio_attach_finish() must be called before using any virtqueue or
  writing any virtio config register.

While there,

* also streamline the attach error handling in all drivers.

* skip initially setting sc_config_change to NULL, the softc is
  initialized to 0.

ok jan@
tested by bluhm@
2024-12-20 22:18:27 +00:00
bluhm
7aa20da420 Declare some global TCP variables constant.
OK mvs@
2024-12-20 21:30:17 +00:00
schwarze
4ac9059474 If EVP_CIPHER_CTX_ctrl(3) is called on EVP_chacha20_poly1305(3)
with an unsupported control command, return -1 rather than 0
to the caller to indicate the error because in general, these
control hooks ought to return -1 for unsupported control commands
and 0 for other errors, for example other invalid arguments.

Not a big deal because this change does not change when operations
succeed or fail, and because callers are unlikely to pass unsupported
control commands in the first place.  The only functional change is that
if a calling program inspects the ERR(3) stack after this failure,
it will now find the correct error code rather than nothing.
Even that wasn't a huge problem because for most EVP_CIPHER control
failures, getting no reason for the error is the usual situation.
Then again, giving the reason when easily possible may occasionally
be useful.  OpenSSL also returns -1 in this case, so it also helps
compatibility a tiny bit.

Found while auditing the return values of all the EVP_CIPHER
control hooks in our tree.  This was the only fishy one i found.

OK tb@
2024-12-20 20:05:29 +00:00
bluhm
3458005deb Fix signed integer comparison in tcp mss.
In tcp_mss_adv() max(9) was used to guarantee that mss it not too
small.  Unfortunately max() uses u_int and mss could get negative
in some error conditions.
Rearrange the code to directly return in case of errors.  Also read
tcp_mssdflt only once to head towards atomic integer sysctl.

OK mvs@
2024-12-20 19:20:34 +00:00
mpi
ae80fb09d1 Relax some uvm_page_owner_locked() assertions.
. uvm_pagewait(): do not require an exclusive lock to release it & sleep
. uvm_page{de,}activate(): lists updates are serialized by the `pageqlock' mutex

More assertions could be relaxed but only those 3 are necessary for running
the lower fault handler in parrallel.

ok miod@
2024-12-20 18:54:12 +00:00
mpi
f3e62b5987 A shared lock is now enough to call pgo_get() functions iff PGO_LOCKED is given.
Update assertions to reflect that.

ok tb@, miod@
2024-12-20 18:49:37 +00:00
mpi
dceff77413 Merge identical code paths to promote data to a new anon into a new function.
ok tb@, miod@
2024-12-20 18:46:51 +00:00
tb
c7c5643a71 mlkem regress: garbage collect two global variables 2024-12-20 15:47:26 +00:00
tb
b229b719d0 hidden mlkem.h: add comment to #endif 2024-12-20 15:10:31 +00:00
tb
abab89db3f Annotate yet another greasy stinky tentacle of xca
I'm so tired of this.
2024-12-20 09:40:29 +00:00
ratchov
7b6392009e sndiod: Switch to printf(3)-style logging
With this change, any line is logged using a single function call
(instead of one function call per logged token). This makes the
sources easier to read and reduces the binary size. Debug strings that
would be too difficult to produce with snprintf(3) are simplified.

ok tb, dlg
2024-12-20 07:35:56 +00:00
nicm
9e4e626151 Only map S-Tag in mode 2, not mode 1. GitHub issue 4304. 2024-12-20 07:10:51 +00:00
jmatthew
dd0896fb3b Pass BUS_DMA_64BIT to bus_dmamem_alloc(). On amd64, this allows use of
memory past 4GB, potentially freeing up some low memory for more important
uses.

ok dlg@
2024-12-20 03:31:09 +00:00
schwarze
ff6a185afe Move the horrific EVP_aes_128_ccm(3) API out of the important,
algorithm-independent EVP_EncryptInit(3) manual as another step
in making the latter leaner and more palatable.

As a side benefit, the new EVP_aes_128_ccm(3) manual page may provide
a better fighting chance to programmers who see themselves forced to
support CCM for whatever reason.  It documents the mandatory, but so
far undocumented EVP_CTRL_CCM_GET_TAG control command and makes the
description of the three EVP_CTRL_CCM_SET_* control commands and the
numerous related quirks more precise.
2024-12-20 01:54:03 +00:00
tb
6f65ec34f2 Fix whitespace in Makefile 2024-12-20 01:53:46 +00:00
tb
f3c21583ac That works better with a G 2024-12-20 01:51:27 +00:00
tb
e9751d5483 cant't -> can't
(the mystery of spotting typos right after commit strikes again)
2024-12-20 00:32:15 +00:00
tb
8889493e35 Rework and fix the mlkem tests
Make proper use of CBB and CBS. If a CBS ever owns data, you're holding
it wrong. Ditch gross macros, sscanf, and globals. The use of fgets is
annoying here, so replace it with getline, which be provided by portable
if needed.

Most importantly, make the tests actually signal failure rather than
only printing an error. Fix the state machines in a few of them. Some
tests didn't parse the .txt file at all. Others mostly did but didn't
actually test what they were supposed to be testing. Such failures
were hidden by the way the tests were written.

This basically needed a complete revamp. It still isn't pretty and much
of it could be deduplicated, but I only have so much time alotted on this
blue planet.
2024-12-20 00:07:12 +00:00
tb
58f37af48f sync 2024-12-19 23:57:27 +00:00
tb
822ced31eb Do not install mlkem.h and bytestring.h into /usr/include/openssl for now
More work in mlkem is needed and this was premature.

discussed with beck and jsing
2024-12-19 23:56:32 +00:00
tb
9c470d64a6 #ifdef out the inclusion of openssl/mlkem.h for now
discussed with beck and jsing
2024-12-19 23:53:38 +00:00
tb
ef1019e622 Do not assume mlkem.h and bytestring.h are public in libcrypto
As long as is not quite clear what we want to do about the public API
aspect of MLKEM, keep things internal for now.

discussed with beck and jsing
2024-12-19 23:52:26 +00:00
tb
d65e817093 mlkem regress: reach around into bytestring again 2024-12-19 23:45:09 +00:00
mvs
f1bf6f4e82 Use per-sockbuf mutex(9) to protect `so_rcv' buffer of tcp(4) sockets.
Only unlock soreceive() path, somove() path still locked exclusively. Also
exclusive  socket lock will be taken in the soreceive() path each time
before pru_rcvd() call.

Note, both socket and `sb_mtx' locks are held while SS_CANTRCVMORE
modified, so socket lock is enough to check it in the protocol input
path.

ok bluhm
2024-12-19 22:11:35 +00:00
mvs
10d5b13ebf Unlock carp_sysctl().
This is the statistics implemented with per-CPU counters and the
`carp_opts' array of atomically accessed integers.

Replace the `carp_opts' array with individual `carpctl_*' variables
and use sysctl_bounded_arr() instead of sysctl_int(). Keep current
`carpctl_*' variables bounds as is, they would be adjusted with
separate diff.

ok bluhm
2024-12-19 22:10:35 +00:00
tb
3d8e7e8c72 ec_mult: use 1ULL to avoid C4334 warning on Visual Studio
The shift is between 0 and 5 bits, so it doesn't matter, but VS is short
for very st...ubborn as are its users when it comes to reporting non-issues
2024-12-19 21:05:46 +00:00
patrick
98e9fa9caf Implement regulator-based signal voltage switch support in dwmmc(4).
This should not have any functional difference on existing setups, as
so far any time this function would have been used, it would have led
to a kernel panic as it's been a NULL pointer.

This fixes bootup on the MNT Reform2 with the RK3588 module.

ok kettenis@
2024-12-19 18:02:47 +00:00
job
05a19cc6f2 Improve cleanup process
In some cases, following a fallback from RRDP to RSYNC, files are
moved to the wrong place. With this change, only rsync repositories
are considered when looking up where to move DIR_TEMP files.

repo.c requires more study, this fix might be a bandaid for a problem
not fully understood.

"put it in" claudio@ OK tb@
2024-12-19 13:23:38 +00:00
jmc
72dde9b872 received form the peer -> received from the peer 2024-12-19 06:45:21 +00:00
tb
a56972eb38 tweak previous: typo in comment and some cosmetics 2024-12-18 21:12:26 +00:00
mpi
0528dcd014 Do not busy pages that are resident & fetched with PGO_LOCKED.
This is safe because the rwlock of the related object is never released until
the handler is done with the pages.

ok kettenis@, tb@
2024-12-18 16:41:27 +00:00
job
e489b84834 Schedule future rejection of ultra long-lived TA certificates
The RPKI ecosystem suffers from a partially unmitigated risk related to
long-lived Trust Anchor certificate issuances.

Issues could arise when a on-path attackers (or, operational errors such
as restoring a super old backup of a webserver) bring back into
circulation old (but still valid) TA certificate. Older certificates
remain valid for the duration of their validity period, because TA
certificates - being top of the chain - cannot be revoked.

Real world examples of old potential replayable certificates that today
still would pass validation are here:
https://mailarchive.ietf.org/arch/msg/sidrops/NxzvSFH0sPXEmyfOS99cLApFKqM/

The trouble with these replayable TA certificates is that when an
on-path entity ends up presenting such an outdated-but-still-valid
certificate to the RP, accepting such a cert will damage the RP's local
validated cache. Parts of the validated output will disappear, in an
unpredictably manner.

Periodic reissuance of TA certs is important because TA certificates are
not entirely static, which of course is why replay might even be an issue
in the first place!. There are 3 'dynamic' fields in TA certificates:

  - the validity period (notBefore, notAfter)
  - the SubjectInfoAccess (where can the RP find the first repository?)
  - the extensions for IP addresses & AS identifiers (RFC 3779 INRs)
    (the RFC 3779 extensions are of critical importance to the
    RPKI's chain validation algorithm)

RIRs will want RPs to validate using the 'latest' issuance of the TA
certificate, because a TA cert from 10 years ago obviously will be 10
years behind on operational decisions, potential SIA migrations,
resource transfers, new IANA assignments, or any other updates to the
RIR's current holdings.

How to repair this situation?

The plan to overcome this risk has three steps:

step 1) RPs to prefer shorter-lived Trust Anchor certificates over
        longer-lived ones. (rpki-client already implemented this)
        https://datatracker.ietf.org/doc/html/draft-ietf-sidrops-rpki-ta-tiebreaker

step 2) RPs ship with scheduled future refusal of ultra long-lived Trust
        Anchor certificates (that's the below diff).

step 3) Consequently, RIRs have to reissue shorter-lived TA certificates
        to avoid being rejected by RPs.

The end result is that after anno 2026 / 2027, if 100 year or 10 year
certs somehow be brought back into circulation, RPs will simply refuse
such long-lived certs, despite them technically being 'valid'.

Why this works:

The ta-tiebreaker mechanism provides an incentive for TA operators to
reissue with reasonable (1 or 2 year) validity periods, as those certs
will be preferred. In turn, RPs scheduling refusal of long-lived certs
at a predetermined future point in time, relieves TA operators from
worrying about previously issued certs with ultra long lifetimes. It is
a win win for everyone in the ecosystem.

Scheduling details:

- February 2nd 2026 for phase 1, because 02-02-2026 is an unambiguous
  date both in the US and elsewhere.
- March 3rd 2027 for phase 2, because 03-03-2027 also is unambiguous and
  visually is very distinct from the phase 1 date.

The hope is that with this schedule global coordination less will be less
error-prone, and everyone should get adequate preparation time.

Discussed with various RIRs

with & OK tb@
2024-12-18 16:38:40 +00:00
claudio
4cf1cdd067 Make the example bgpd.conf work with 4byte ASN out of the box.
Use local-as in community and large-community stanzas since that will
be expanded at runtime. For communities that only work with 2byte ASN
the filter will never match (or nothing will be set / deleted) since
a 4byte ASN can never match.

We want an bgpd.conf example ruleset that is sensible, works and is a
good starting point for beginners. In other words we should not add
traps to the config.

OK deraadt@ job@
2024-12-18 16:00:26 +00:00
sthen
7502f20057 add libutil, missed with fsck_ext2fs commit (oops, I didn't realise it was
used in ramdisks).  reported/ok tb@
2024-12-18 14:09:18 +00:00
sobrado
8f80aa97a4 add missing option "-d" to flex(1)'s usage.
ok jmc@, a few weeks ago.
2024-12-18 12:33:57 +00:00
tb
67abc7a12c mlkem: fix whitespace 2024-12-18 10:55:21 +00:00
sthen
dfd6150703 use opendev() for fsck_ext2fs, based on code adding this to fsck_ffs
tweak (add strncmp()...blockcheck section) from martijn@
ok martijn@
2024-12-18 10:36:05 +00:00
tb
76232002e5 tcpdump: switch this gross macro to using c99 initializers
This should really be a function with a switch, but I have enough
dumpster fires to deal with, so I'm not going to add tcpdump.

ok denis
2024-12-18 06:36:48 +00:00
tb
7598353d73 tcpdump: fix an off-by-one so that this can also print gwid
ok denis
2024-12-18 06:33:25 +00:00
jsg
633da3e108 kength -> length 2024-12-18 04:15:48 +00:00