Keep the descriptor rings allocated in DVACT_SUSPEND, so that they are
still available in DVACT_RESUME. This is neccessary because DVACT_RESUME
cannot sleep during this new allocation.
ok jan
Retire mrt_count which is only used to prevent MRT_API_CONFIG once
multicast is already going.
MRT_API_CONFIG must be called right after MRT_INIT and it should only work
then. The moment a VIF or MFC is added MRT_API_CONFIG needs to fail.
Implement this with a mrt_api_locked variable that is toggled in the
setsockopt calls. This way MRT_API_CONFIG can be simplified and the
somewhat problematic mrt_count can be removed.
It seems nothing really uses MRT_API_CONFIG so we can be super strict
here and only allow it on the first call after MRT_INIT and so
mrt_api_locked is toggled even if the setsockopt command failed.
OK bluhm@
Backport security fixes from zlib 1.4
From the 9 security fixes listed in
https://github.com/madler/zlib/releases/tag/v1.4
we already have the fix for CVE-2026-85091 in 8.0.
The remaining 8 of these are cherry-picked here for userland, 6 of which
also affect the kernel. That required a bit of fiddling due to our patches
(#ifdef SMALL, size for ZFREE in the kernel).
There is an oob write of 32k and various other oob accesses, some info
leaks and a cloexec carelessness.
looks good to deraadt
In detail this is:
deflate.c, hunks 1 and 2:
[109 lines not shown]
Remove the byte copies of the built-in curve parameters
The built-in curve parameters are now in two places, in ec_curve.c
as byte strings and in ec_curve_tables.h as the static groups.
ec_curve_list now holds only each curve's comment, NID and static
group. ec_group_is_builtin_curve() compares a group with the static
groups using EC_GROUP_cmp() and the seed, instead of comparing byte
encodings.
ok tb@
Make the built-in EC groups copies of static templates
So while beating on the cost of decoding X509 certificates and
attempting to find out where things were expensive. P256 lept out
and bit me. It was appallingly slower to deal with a P256 public
key than other things. and it was dominating the cost of an X509
parse, due to it rolling the group from scratch, every time.
Building a built-in group at runtime was most of the cost of decoding
an EC key, which hits every EC key in libcrypto and libssl, including
certificate keys and ECDHE.
So of course I looked at Boring, which made everything static.
EC_GROUP_new_by_curve_name() now copies a static EC_GROUP whose curve
parameters, Montgomery context and generator are precomputed constants
shared by every copy. The constants have 64-bit and 32-bit word
versions. EC_GROUP_free() leaves the shared data alone, EC_GROUP_dup()
of a built-in group copies only the group itself, and
[28 lines not shown]
Return a real X25519 key from SSL_get_peer_tmp_key()
The X25519 peer temporary key was a dummy EC_KEY. It was made by taking
a P-256 group from EC_GROUP_new_by_curve_name(), overwriting its
generator and order, and renaming it NID_X25519. It held no public key,
so callers could get only a name from it. It also modified a built-in
group, which gets in the way of making built-in groups immutable.
Return an EVP_PKEY_X25519 holding the peer's public key instead, now
that X25519 has an EVP_PKEY type. The internal tls_key_share_peer_pkey()
now allocates the EVP_PKEY it returns
ok tb@
when getnetby*(3) family were refactored by schwarze in 2018 as a
wrapper on gethostby*(3), the ip address in the structure was
mistakenly considered a pointer to an ip address, and a dereference
was attempted. The long survival of this bug tells us that
getnetby*(3) is used extremely rarely. In fact it was noticed by
afresh1@ on a strict-alignment architecture which inspected a HOST
with an odd ip address (byte order can also matter)
ok millert
u_obj.uo_refs must be managed using atomic_inc_int_nv() and friends
or the reference counting and inspection can evaluate incorrect.
This affecs kbind.
ok claudio, krw
diff from openai
stop trying to refuse a whole bunch of ioctls when securelevel > 1, which
was advertised as "pf filter and NAT rules may not be altered" - however,
there are numerous other ways, like turning pf of per-interface using set
skip, removing/adding interfaces from/to groups etc etc etc
root is root, period. pf doesn't have anything securelevel-dependent now.
"set skip" reported by acts1631kjv at proton
support deraadt, ok sashan claudio sthen
Remove sm_transactionid. This was originally intended to hook messages to
when sending requests to AgentX backends, but this functionality ended up
fully in application.c.
OK op@
Remove mrt6_mrouter_ver since it is unused and will never be used.
Our MRT6 code has no compat fallback for the old (> 25year) mrt6msg
format. We only use the fixed version with the alignment fix.
So there is no need to track mrt6_mrouter_ver since it is always MRT6_INIT
and that will never change. So burn this bridge for good.
OK bluhm@
fallback to PCI reset on x86
Attempt system reset with writes to a memory region used for PCI.
Both Intel and AMD document reset at the 0xcf9 address.
Adapted from FreeBSD by Gert-Jan Vons to fix reset on a
Fujitsu Futro S940.
ok deraadt@
Don't free the io queue memory when suspending, so it doesn't have to be
reallocated on resume. This removes a potential sleep point in the resume
path. The queue is still recreated on the controller, so its software state
has to be reset instead.
ok dlg@ deraadt@