1
0
mirror of https://github.com/openbsd/src.git synced 2026-04-16 18:24:23 +00:00
Commit Graph

243673 Commits

Author SHA1 Message Date
deraadt
dc8703adcd Range-check fields inside the file to ensure they don't exceed the size
of the file and cause later crashes.
from renaud allard
2026-04-01 16:58:22 +00:00
deraadt
471a995e78 Do the unveil() after the daemon() call, because otherwise we wouldneed
"/dev/null" "rw" and "/" "r", in particular the second is ugly.
pointed out by bluhm, discussion also with dgl.
2026-04-01 15:39:05 +00:00
jsing
0d123a3a59 Adjust depth check to match change in verifier. 2026-04-01 14:39:11 +00:00
jsing
63d3a7e33d Restore the previous behaviour with maximum verification depth.
The maximum depth is not expected to include the leaf certificate - restore
the decrement prior to checking, which means the previous behaviour is
retained for the callback depth and the maximum depth. Reduce the maximum
depth by one in order to avoid the overwrite that could previously occur.

Thanks to anton@ for flagging the rust-openssl failure in regress.

ok tb@
2026-04-01 14:38:26 +00:00
op
9532dfe990 fix possible out of bound in text_to_netaddr
diff from Renaud Allard (renaud at allard.it), thanks!
ok deraadt
2026-04-01 11:20:58 +00:00
op
76af690f2b fix possible out of bound access in dname_expand()
spotted by Renaud Allard (thanks!), diff tweaked by me.

ok deraadt@
2026-04-01 11:19:01 +00:00
nicm
ffc378411d Fixed missing drag end detection and mouse button detection with
modifiers. From Dane Jensen, reported by Joseph Tyson and Mark Kelly.
2026-04-01 08:10:02 +00:00
jsg
f7a3fa387c mdoc fixes 2026-04-01 02:34:37 +00:00
jsg
215c0970ab add .Nm for __pledge_open, makes 'man __pledge_open' work 2026-04-01 02:32:49 +00:00
kirill
57871d3766 sys/iwx: increase maximal VHT A-MPDU from 64K to 1024K
OK: stsp@
2026-04-01 02:29:37 +00:00
jsg
8716a8b212 remove whitespace at eol 2026-04-01 02:08:38 +00:00
jsg
9efff6d8cc spelling 2026-04-01 02:05:06 +00:00
jsg
c0f9fe8338 make ddb output visible when entering ddb from X on amdgpu
add a call to drm_fb_helper_restore_fbdev_mode_unlocked()
to amdgpu_enter_ddb() otherwise ddb output can't be seen

not required on inteldrm or radeondrm
2026-04-01 01:29:25 +00:00
dv
c9b2dc6761 Clean up vmctl, remove use of vmd's log.c.
This reimplements simpler versions of logging functions needed for
linking the qcow and raw disk image code from vmd.

Also cleans up the Makefile a bit, removing atomicio.c which is
unused.

ok mlarkin@
2026-04-01 00:51:50 +00:00
deraadt
aaea3278ec delete AMD smt related line accidentally deleted 2026-03-31 16:53:02 +00:00
deraadt
1675bd6d03 warn if hw.smt is used, and recommend hw.blockcpu 2026-03-31 16:46:46 +00:00
deraadt
7ce80b6577 Some new intel machines have a new 3rd tier of cpus called LP-E which are
E-core (Atom) without L3 cache.  These cpus are Lethargic, and it sucks
when processes migrate to them.
This introduces sysctl hw.blockcpu= which takes a sequence of 4 letters.
S (for SMT), P (regular performance cpu), E (efficient cpu) generally
80% to 50% as fast), and L (lethargic cpu) which are even slower.
By setting this, you can select cpus to kick out of the scheduler.  The
default is SL.
The hw.smt sysctl remains for now but we will eventually delete it.
hw.smt changes and follows hw.blockcpu=S.
ok kettenis mlarkin
2026-03-31 16:46:21 +00:00
deraadt
9f2496a895 add ci_cputypes field which will be needed by an upcoming MI change
ok kettenis
2026-03-31 16:37:48 +00:00
kettenis
26388c13bd Attempt to power on attached USB hubs. Add support for SpacemiT K1.
ok phessler@, jca@, jsing@
2026-03-31 14:42:54 +00:00
kettenis
b2cd6d50b9 Recognize SpacemiT X60 and X100 cores.
ok jsg@
2026-03-31 14:41:15 +00:00
jsing
e9af5eb5a6 Fix an off-by-one error in the X.509 verifier depth checking.
In x509_verify_build_chains(), ensure that we check the current depth
against max_depth prior to turning it into a legacy-style depth index.
Additionally, add a guard to x509_verify_chain_append() so that we avoid
exceeding the maximum certs per chain, even if we fail to handle this
correctly elsewhere. Also prevent the legacy callback from being able
to override the maximum verification depth.

The current off-by-one allows for a 4 byte overwrite to occur on heap
allocated memory - this will likely trigger a crash on OpenBSD (but may
go unnoticed elsewhere). This is only reachable if a TLS client is talking
to a malicious server or if a TLS server has client certificate
verification enabled - in both cases the verification depth also needs to
be set to the maximum allowed value of 32.

It is worth noting that many TLS clients/servers set the maximum
verification depth to a value that is much less than the default. A libtls
client or server uses a default depth of 6 and is not impacted in this
configuration.

Thanks to Calif.io in collaboration with Claude and Anthropic Research,
for reporting the issue.

ok tb@
2026-03-31 13:58:05 +00:00
jsing
e22d54a186 Add additional X.509 verifier test cases.
The second case (14b) currently triggers a bug in the new verifier.
2026-03-31 13:39:48 +00:00
jsing
7d5b0b9756 Run new test certificate bundles through Go's verifier. 2026-03-31 13:37:45 +00:00
jsing
2af75b58ad Add additional certificate test bundles. 2026-03-31 13:37:11 +00:00
jsing
38b2e9b49e Generate two additional certificate test scenarios which have deep chains. 2026-03-31 13:34:25 +00:00
nicm
8852b28943 Reorganize structure of key_code so that it can be built directly by
bitshifts rather than a load of huge switches, from Dane Jensen in
GitHub issue 4953.
2026-03-31 11:46:43 +00:00
claudio
702ae470df Correctly align and space queue info in 'show neighbor' command.
OK tb@
2026-03-31 09:32:12 +00:00
jsg
077f28b4c6 access ida under spltty()
ida is accessed from both process and interrupt contexts.

The interrupt context use occurs when a fence is hardware signaled:
dma_fence_signal -> amdgpu_pasid_free_cb -> ida_free -> idr_remove

linux currently uses an xarray with XA_FLAGS_LOCK_IRQ for ida, which
blocks interrupts when locked

This change was prompted by protection faults such as:
idr_tree_SPLAY+0x58
idr_alloc+0xb1
amdgpu_pasid_alloc+0x5d
amdgpu_driver_open_kms+0xac
drm_file_alloc+0x245
drmopen+0x12c

seen with 6.12 and 6.18 drm

volker@ could more consistently reproduce this on a system with a
Navi 31 (7900 XTX).

Lots of testing from volker@ and feedback from kettenis@
2026-03-31 08:54:14 +00:00
tb
9f74635ce2 rpki-client regress: align guard with portable 2026-03-31 06:25:39 +00:00
kirill
07249334be sys/net80211: announce 160MHz channels only when driver supports it
Support of 160Mhz window brings a regression for drivers which do not
supprot 160MHz window which leads to the wrong channel center.

It was tested on iwx with and without 160Mhz window support in the code
agaisnt 2.4Ghz network with 20Mhz and 40Mhz, and 5Ghz with 40Mhz, 60Mhz,
80Mhz and 160Mhz window.

Reported as iwm issue by martijn@

OK: stsp@
2026-03-30 13:59:19 +00:00
nicm
0a71aa187b When in copy mode with a large scroll offset and the window is resized
so that history shrinks, data->oy can exceed screen_hsize causing an
unsigned integer underflow in the py computation. Clamp data->oy in
window_copy_resize and window_copy_cmd_refresh_from_pane before the
subtraction. From futpib at gmail dot com in GitHub issue 4958.
2026-03-30 09:23:40 +00:00
djm
9b8c7086ba add a regression test for ProxyJump/-J; ok dtucker 2026-03-30 07:19:02 +00:00
djm
5700c4436f apply the same validity rules to usernames and hostnames set for
ProxyJump/-J on the commandline as we do for destination user/host
names.

Specifically, they are no longer allowed to contain most characters
that have special meaning for common shells. Special characters are
still allowed in ProxyJump commands that are specified in the config
files.

This _reduces_ the chance that shell characters from a hostile -J
option from ending up in a shell execution context.

Don't pass untrusted stuff to the ssh commandline, it's not intended
to be a security boundary. We try to make it safe where we can, but
we can't make guarantees, because we can't know the parsing rules
and special characters for all the shells in the world, nor can we
know what the user does with this data in their ssh_config wrt
percent expansion, LocalCommand, match exec, etc.

While I'm in there, make ProxyJump and ProxyCommand first-match-wins
between each other.

reported by rabbit; ok dtucker@
2026-03-30 07:18:24 +00:00
tb
d3e6ebe0e9 libssl regress: adjust golden numbers for RSASSA-PSS
Add the three RSASSA-PSS SignatureScheme 0x080b, 0x080a, 0x0809 in the
appropriate spots in (components of) the ClientHello and adjust various
length octets by adding 6.
2026-03-30 06:23:33 +00:00
tb
337a5c045a libssl: announce support for RSASSA-PSS signature schemes
Announce the signature schemes for RSASSA-PSS with pubkey OID RSASSA-PSS
between RSASSA-PSS with pubkey OID rsaEncryption and RSASSA-PKCS1-v1_5.

This is the last step in the everlasting saga for making these signature
schemes and certificates with RSASSA-PSS OID work. Fortunately, these are
rarely used since they are extremely complex and inefficient also due to
the large size of the parameters. This addresses bug reports by Steffen
Ullrich and Tom Lane.

Tested by bluhm.

ok djm jsing kenjiro
2026-03-30 06:20:08 +00:00
tb
97142c6557 ssl_sigalg_pkey_ok: allow RSASSA-PSS with pubkey OID RSASSA-PSS
This fixes a long-standing logic error that hasn't been noticed because
we never announced the rsa_pss_pss_sha{256,384,512} SignatureScheme. The
EVP_PKEY_id() of a RSA-PSS pubkey is EVP_PKEY_RSA_PSS, not EVP_PKEY_RSA.

Thanks to beck for helping me figure out how to fix this correctly. It
drove me nuts for a very long time. Problem also noticed by Tom Lane
due to some PostgreSQL regress failures.

ok djm jsing kenjiro
2026-03-30 06:02:21 +00:00
tb
a8b0d4d0a7 ssl_sigalgs: whitespace tweak 2026-03-30 05:49:31 +00:00
afresh1
03db75a2bd Improve OpenBSD::Unveil POD
The choice of variable names made it somewhat unclear what arguments
to pass and made it seem the interface might differ from unveil(2).

ok dgl@
2026-03-30 00:00:04 +00:00
kirill
b6590ac202 sys/iwx: enable 160Mhz window at 5Ghz
OK: kn@, phessler@, stsp@
2026-03-29 21:17:50 +00:00
kirill
a17ca92d14 sys/net80211: support of 160Mhz window at 5Ghz
OK: kn@, phessler@, stsp@
2026-03-29 21:16:21 +00:00
bluhm
751ff169a1 Remove useless memory barriers in igmp and mld6 timer.
Multicast timers are protected by poper locks.  The shortcut that
avoids locking when no timers are scheduled, does not need an
additional membar.

OK mvs@
2026-03-29 18:08:07 +00:00
daniel
7ab78e8bd0 FNM_CASEFOLD (and its synonym FNM_IGNORECASE) are now part of POSIX.1-2024
Flagged by Sortix os-test.

ok millert@, guenther@
2026-03-29 14:08:46 +00:00
kirill
2bea9c5040 sys/tmpfs: use getnanotime() like FFS and MFS
Editing files on tmpfs uses nanotime() to update mtime, and touch uses
utimensat(UTIME_NOW) which uses getnanotime() which is cached and which
can be smaller.

So, sed ... A && touch B leads to mtime(A) > mtime(B) which isn't excted.

"Yep" deraadt@
2026-03-29 09:37:33 +00:00
tb
6b1826a526 ML-KEM: ensure that key_768 is only dereferenced with 768-bit keys
This looks like a NULL dereference that should crash, but for some reason
it doesn't, even with -O0 with all compilers i tried.  At the very least it
may result in compilers deducing that key_768 != NULL and lead to incorrect
optimizations.

ok claudio jsing kenjiro miod
2026-03-29 06:31:07 +00:00
anton
98d16a20cf Add missing include path required to reach newly added crypto_assembly.h
include.
2026-03-29 06:19:12 +00:00
mglocker
e0872ad225 Fix typo. 2026-03-29 05:29:02 +00:00
djm
8c0bc7d7b0 switch from int to long long for bandwidth calculations; fixes
rate display when rate > 2GB/s; based on patch from Cyril Servant
feedback/ok deraadt@
2026-03-29 01:08:13 +00:00
deraadt
69012ea1b2 After the kernel-writes-the-buffer changes to profil(2) a year ago, the
profil(2) call only works for stop/restart of profiling.  So pledge no
longer interferes and it is available in "stdio".
2026-03-28 17:12:01 +00:00
dv
2ec97aa487 Remove pthread rwlocks from vmd(8)'s qcow code.
The users of this code are single threaded today. The locks also
don't look to fully protect key state in qcow images. If/when virtio
block emulation ends up with multiple virtqueues, this will need
to be revisited.

ok mlarkin@, hshoexer@
2026-03-28 16:22:04 +00:00
jsing
b39c1312a5 Include crypto_assembly.h instead of manually ensuring _CET_ENDBR exists.
ok kenjiro@ tb@
2026-03-28 13:11:28 +00:00