replace login_fbtab with the wscons group if the users is on the glass console
Historically login_fbtab(3) was called on user login to change permission
of devices for the user logging in on the console or xdm and this mechanism
had its quirks.
In in effort to make this better, introduce the LOGIN_SETWSCONSGROUP flag for
setusercontext(3), which will append the special wscons group to a user context
if the user is logging in on the "glass" console.
Callers of setusercontex(3) can also use the new login_wscons(const char *tty)
libutil function to determine if the tty is appropriate for setting the group.
The last part of this commit also changes the device node entries so that the
wscons group has write access to a specific list of devices that were previously
handled by fbtab, e.g. for amd64 (for other arches it might differ):
/dev/console
/dev/wskbd
[14 lines not shown]
Reject certificates that are not v3
X509 v1 is bloody ancient. we continue to have nasty things lurking
as corner cases to support it when there is really no need to.
Sadly, it has been kept around for ages for "roots" because of people
with old tests and nonsense that were generated for v1. v3 is required
by any modern certs.
Rather than supporting "tests" that aren't really testing what the real
world uses, stop the madness.
x509v3_cache_extensions marks any certificate whose version is not v3
invalid, so v1 and v2 certificates fail verification and purpose checks.
This may break tests suites generated with old junk. (we had one in
tree that I fixed before this).
We will see if this change is too painful to support in ports right now.
[4 lines not shown]
Ignore the Netscape certificate type extension
The 90's were amazing, but this is well past time to let it go.
x509v3_cache_extensions no longer reads nsCertType, so it no longer
makes a certificate a CA or restricts its purposes. A critical
nsCertType is now an unhandled critical extension.
This is only an initial defang, code removal for this will follow
ok tb@
Make openssl(1) always issue v3 certificates
change req -x509, x509 -req and ca to make every certificate they issue v3,
instead of issuing v1 when no extensions are configured.
openssl changed this visit from the bad idea bears back in 3.0 and we
never picked it up.
ok tb@
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@