job [Tue, 16 Jan 2024 19:52:39 +0000 (19:52 +0000)]
Update standards reference
deraadt [Tue, 16 Jan 2024 19:08:37 +0000 (19:08 +0000)]
print flag 'l' for base program or ld.so being under pinsyscalls enforcement,
and 'L' for libc.so. This flag printing may be deleted once we are entirely
confident this is working correctly.
ok kettenis
deraadt [Tue, 16 Jan 2024 19:07:31 +0000 (19:07 +0000)]
Read PT_OPENBSD_SYSCALLS in libc.so, and convert it to a table for
pinsyscalls(2).
ok kettenis
deraadt [Tue, 16 Jan 2024 19:05:00 +0000 (19:05 +0000)]
The kernel will now read pinsyscall tables out of PT_OPENBSD_SYSCALLS in
the main program or ld.so, and accept a submission of that information
for libc.so from ld.so via pinsyscalls(2). At system call invocation,
the syscall number is matched to the specific address it must come from.
ok kettenis, gnezdo, testing of variations by many people
claudio [Tue, 16 Jan 2024 14:35:56 +0000 (14:35 +0000)]
Handle variable names (things strating with $ or @) in yylex() this way
the error handling of strange variable names can be better controlled.
With and OK dv@
claudio [Tue, 16 Jan 2024 13:33:12 +0000 (13:33 +0000)]
Convert to imsg_get_fd() and remove unused proc_forward_imsg().
OK martijn@
claudio [Tue, 16 Jan 2024 13:15:31 +0000 (13:15 +0000)]
Switch session_notification() over to use a struct ibuf to carry the
extra data. With this IMSG_UPDATE_ERR can use the new imsg API.
Introduce session_notification_data() for the few cases where there
is no ibuf readily available.
OK tb@
claudio [Tue, 16 Jan 2024 13:09:11 +0000 (13:09 +0000)]
Use imsg_get_fd() instead of direct access to imsg.fd
The change in proc.c can be further simplified once imsg_free() takes
care of unclaimed file descriptors.
OK nicm@
claudio [Tue, 16 Jan 2024 13:07:29 +0000 (13:07 +0000)]
Use imsg_get_fd() and adjust cleanup code accordingly.
OK nicm@
kevlo [Tue, 16 Jan 2024 12:21:02 +0000 (12:21 +0000)]
Fix clang warning about possible unaligned access on arm64.
ok stsp@
anton [Tue, 16 Jan 2024 06:40:07 +0000 (06:40 +0000)]
Cope with recent changes to pfctl output.
jan [Mon, 15 Jan 2024 21:37:58 +0000 (21:37 +0000)]
Add debug message for no policy found.
In this case iked would just silently drop incomming connections.
Thus, the user has a chance to figure out whats going on.
ok tobhe@
florian [Mon, 15 Jan 2024 18:03:39 +0000 (18:03 +0000)]
Make sure to return a proper string in ai_canonname.
When we made sure that getaddrinfo(3) always resolves "localhost" to
the loopback address we forgot to set ai_canonname if AI_CANONNAME or
AI_FQDN is set. On a successful call ai_canonname has to be a NUL-terminated
string if either of those flags are set.
Problem observed by a@alexis-fouilhe.fr in smtpd(8) with a hostname of
"localhost".
OK millert
kettenis [Mon, 15 Jan 2024 16:57:31 +0000 (16:57 +0000)]
Add support for bringing up RTKit while !cold.
ok tobhe@
mvs [Mon, 15 Jan 2024 15:47:37 +0000 (15:47 +0000)]
Introduce priterator(), the `ps_list' iterator. Some of `allprocess'
list walkthroughs have context switch within, so make exit1() wait
until the last reference released.
Reported-by: syzbot+0e9dda76c42c82c626d7@syzkaller.appspotmail.com
ok bluhm claudio
claudio [Mon, 15 Jan 2024 15:44:50 +0000 (15:44 +0000)]
Convert the simple bits of imsg handling over to the new imsg API.
OK tb@
tobhe [Mon, 15 Jan 2024 15:29:00 +0000 (15:29 +0000)]
Include cert_partial_chain in iked_static instead of sending a separate
message.
from markus@
tb [Mon, 15 Jan 2024 15:09:57 +0000 (15:09 +0000)]
Run the pkey cleanup test also for {Ed,X}25519
tb [Mon, 15 Jan 2024 15:00:13 +0000 (15:00 +0000)]
Switch to EVP_CIPHER_do_all() now that snaps are available on most arches
kettenis [Mon, 15 Jan 2024 13:27:20 +0000 (13:27 +0000)]
Fetch touchpad dimensions from firmware instead of hardcoding the values
for the original 13" M1 MacBook.
ok mlarkin@
kettenis [Mon, 15 Jan 2024 11:58:45 +0000 (11:58 +0000)]
We can't call kstat_create(9) when bringing up the secondary CPUs as it
uses an rwlock and curproc isn't initialized yet for these CPUs at this
point. As a result we hit a "locking against myself" panic if there is
any lock contention.
Fix this by adding a new ci_midr member to struct cpu_info which gets
initialized when we identify the CPUs and use that to attach the kstat
stuff.
ok tobhe@, dlg@
claudio [Mon, 15 Jan 2024 11:55:26 +0000 (11:55 +0000)]
A cache can send a 'NO_DATA_AVAILABLE' error during version negotiation
so handle this case as well. This error triggers an RTR_EVNT_NO_DATA
event that moves the session to RTR_STATE_ESTABLISHED (and out of negotiation).
When there is no data available the session_id remains unset until data
becomes available. So handle this case not only in rtr_parse_cache_response()
but also in rtr_parse_notify().
RTR_EVNT_NO_DATA arms the RTR_EVNT_TIMER_RETRY timer. On expiry send a
reset or serial query depending on the cache session state.
OK tb@
jmatthew [Mon, 15 Jan 2024 08:56:45 +0000 (08:56 +0000)]
The maximum number of ring slots a tx packet can use is 32, which is
indicated by writing 0 to the 5 bit 'BD count' field in the first slot.
Accordingly, mask the value we're writing there.
Each packet uses one slot for offload information and then one per DMA
segment, which means the maximum number of DMA segments must be 31 rather
than 32. Trying to send a packet using 33 slots makes the nic firmware
very upset.
ok dlg@
sashan [Mon, 15 Jan 2024 07:23:32 +0000 (07:23 +0000)]
Currently 'pfctl -a "*" -sr' recursively walks anchor tree and shows
rules found in every anchor. This commit introduces the same behavior
for tables. Command 'pfctl -a "*" -sT' prints all tables attached to
every anchor loaded to pf(4).
Inconsistency has been noticed by Klemens (kn@).
OK @bluhm, OK @kn
guenther [Mon, 15 Jan 2024 06:57:07 +0000 (06:57 +0000)]
From "Lorenz (xha)" (me(at)xha.li): teach binutils how to assemble
endbr{64,32}
"sure" dv@ deraadt@
anton [Mon, 15 Jan 2024 06:51:54 +0000 (06:51 +0000)]
Increase wait until threshold. Should hopefully make these tests more
stable.
dv [Mon, 15 Jan 2024 02:35:23 +0000 (02:35 +0000)]
vio(4): poll device status after issuing device reset.
The virtio spec says a driver "should" wait for a device to report
a clear device status after performing a reset. In some hypervisors,
this doesn't matter as the vcpu's io instruction emulation and
virtio network device emulation happen serially in the same thread.
In hypervisors like vmd(8), device reset happens asynchronously and
the driver can't assume the device is ready.
This race condition results in mbuf pool corruption, causing panics.
Bug reported and reproduced by bluhm@. Root cause found and diff
from sf@. ok dv@ and committed on sf@'s behalf with his permission.
cheloha [Mon, 15 Jan 2024 01:15:37 +0000 (01:15 +0000)]
clockintr: move CLST_IGNORE_REQUESTS from cl_flags to cq_flags
In the near future, we will add support for destroying clockintr
objects. When this happens, it will no longer be safe to dereference
the pointer to the expired clockintr during the dispatch loop in
clockintr_dispatch() after reentering cq_mtx. This means we will not
be able to safely check for the CLST_IGNORE_REQUESTS flag.
So replace the CLST_IGNORE_REQUESTS flag in cl_flags with the
CQ_IGNORE_REQUESTS flag in cq_flags. The semantics are the same.
Both cl_flags and cq_flags are protected by cq_mtx.
Note that we cannot move the CLST_IGNORE_REQUESTS flag to cr_flags in
struct clockrequest: that member is owned by the dispatching CPU and
is not mutated with atomic operations.
tb [Sun, 14 Jan 2024 18:40:24 +0000 (18:40 +0000)]
Tidy a few more includes in cms/
cheloha [Sun, 14 Jan 2024 17:23:56 +0000 (17:23 +0000)]
sys/sched.h: conceal <sys/queue.h> inclusion from userspace
Nothing outside of the _KERNEL guard in <sys/sched.h> needs
<sys/queue.h>, so move its inclusion under _KERNEL.
Requested by claudio@.
Link: https://marc.info/?l=openbsd-tech&m=169937494818685&w=2
ok claudio@
cheloha [Sun, 14 Jan 2024 17:11:55 +0000 (17:11 +0000)]
sys/sched.h: conceal struct schedstate_percpu definition from userspace
struct schedstate_perpcu contains struct clockintr pointers. struct
clockintr is not defined in userspace, so move schedstate_percpu into
the _KERNEL guard to hide it from userspace. Nothing in base userspace
uses schedstate_percpu.
Thread: https://marc.info/?l=openbsd-tech&m=
169861224916185&w=2
ok claudio@ millert@
kettenis [Sun, 14 Jan 2024 09:39:03 +0000 (09:39 +0000)]
Whenever we have a libc major bump, we run the risk that dependent shared
libraries will request a different (major) libc version from the one
requested by the binary itself. For various reasons loading multiple libc
versions is not a good idea, and since the introduction of msyscall(2)
support, system calls will only work when called from one of the two loaded
libcs. This really means that when we have a libc major bump, users must
update all dynamic executables and shared libraries in the system.
However, to ease this transition, change ld.so to only load the first libc
version that we encounter (in a breadth first sense) and substitute that
libc version for all further loads of libc, even if different versions are
requested. This is done silently since I can't come up with a good warning
message. In practice this means the libc version requested by the
executable itself will be loaded. This means that shared libraries may
fail to load if they use a symbol that has been removed. But given the
constraints, this is the best that we can do. Even when we bump the
libc major, the set of changes is typically small and most binaries and
shared libraries will continue to run and allow the user to run pkg_add -u
without any fallout.
ok deraadt@, gkoehler@
tb [Sat, 13 Jan 2024 19:57:38 +0000 (19:57 +0000)]
Prepare for removing most of the X509_TRUST API
X509_check_trust() is of course used by the verifier. Unfortunately
M2Crypto exposes it. The only other part of the X509_TRUST API that
are still needed are the X509_TRUST_* macros in x509.h, as they are
used via *_set_trust and indirectly via the purpose stuff. The rest
will be removed.
X509_TRUST_add() was defanged recently, in particular it no longer
hangs strdup()'ed strings off the global struct. Nothing ever cleaned
these up. TRUST_cleanup() attempted to do so, but since it checked
the dynamic/dynamic strings flags in the wrong order, that cleanup
call ended up doing nothing, so that code was removed at some point.
As a consequence, the struct can now be made const. Use a CTASSERT()
to ensure size assumptions on X509_TRUST_COUNT, X509_TRUST_MAX, and
X509_TRUST_MIN hold true.
Remove the global variable underlying X509_TRUST_set_default()'s
functionality and move its accessor down to all the other functions
that will be deleted.
Inline a few things in X509_check_trust(), so we can excise the
internals of X509_TRUST_get0(), X509_TRUST_get_by_id(). Since the
default trust function can no longer be changed, call obj_trust()
directly.
ok jsing
tb [Sat, 13 Jan 2024 19:06:20 +0000 (19:06 +0000)]
Remove check{,obj_cleanup}_defer documentation
Both check_defer() and the global variable obj_cleanup_defer were removed
from the public API two years ago. Now they were removed from the internals
as well, simplifying the cleanup process greatly. We no longer need them
to have a chance to understand the cleanup process. Also remove references
to EVP_cleanup() since this has long been deprecated and now it doesn't
clean up things anymore.
tb [Sat, 13 Jan 2024 18:37:51 +0000 (18:37 +0000)]
Remove mention of a refcount bug
Said bug was fixed in OpenSSL 1.0.0, released 14 years ago. It is of course
unsurprising that you may accidentally increment the refcount if your idiom
for decrementing it is CRYPTO_add(&bio-references, -1, CRYPTO_LOCK_BIO)).
tb [Sat, 13 Jan 2024 17:50:01 +0000 (17:50 +0000)]
BIO_f_ssl.3: Remove explicit library initialization
tb [Sat, 13 Jan 2024 17:04:29 +0000 (17:04 +0000)]
Remove calls to OpenSSL_add_all_{ciphers,digests}()
tb [Sat, 13 Jan 2024 16:32:53 +0000 (16:32 +0000)]
Move errno.h inclusion where it belongs
joshua [Sat, 13 Jan 2024 13:59:18 +0000 (13:59 +0000)]
Clean up EVP_MD_CTX_init() usage in ASN1_item_sign()
ok tb@
tb [Sat, 13 Jan 2024 12:46:59 +0000 (12:46 +0000)]
Prepare to remove the EVP_PKEY_meth_* API
After removing the last caller of EVP_PKEY_meth_find() from libssl, none
of these is used. And with EVP_PKEY_meth_new() gone, there will no longer
be a way to get your hands onto an EVP_PKEY_METHOD that is writable, so
none of the silent failures (because they're void functions) should matter
in the few weeks until we bump.
ok jsing
tb [Sat, 13 Jan 2024 12:18:52 +0000 (12:18 +0000)]
The OBJ_NAME API joins the party in evp_names.c
... and another file without license disappears.
tb [Sat, 13 Jan 2024 12:15:27 +0000 (12:15 +0000)]
Move EVP_add_{cipher,digest}() to the trashcan
They will await their removal in the next major bump.
tb [Sat, 13 Jan 2024 12:13:17 +0000 (12:13 +0000)]
Open a garbage bin at the bottom of evp_names.c
First to move is EVP_cleanup(), which should probably be moved to an
evp_lib.c if such a file is reinstated.
tb [Sat, 13 Jan 2024 11:57:51 +0000 (11:57 +0000)]
Remove obj_cleanup_defer
With check_defer() gone, this is never set to anything but 0, so the two
conditional branches it is still involved in are dead code.
tb [Sat, 13 Jan 2024 11:55:31 +0000 (11:55 +0000)]
Garbage collect check_defer()
This was a mechanism to ensure that OBJ_cleanup() doesn't remove the
ASN1_OBJECT associated with a custom cipher or digest (that was added
with EVP_add_{cipher,digest}(), while the latter is still referenced
in the OBJ_NAME table.
It had the effect that OBJ_cleanup() wasn't actually called ever from
OPENSSL_cleanup() (it is only called if you load the OID conf module).
Oh, and of course it was once part of the public API. I fixed that two
years ago, almost exactly to the day. Still mentioned in OBJ_create.3.
tb [Sat, 13 Jan 2024 11:48:16 +0000 (11:48 +0000)]
Neuter EVP_add_{cipher,digest}()
This makes them noops. They are used in the wild for adding ciphers
that are always added by the library init code. This is a historic
leftover.
This removes the last (and only ever) calls to check_defer().
ok jsing
tb [Sat, 13 Jan 2024 11:45:03 +0000 (11:45 +0000)]
Remove most of EVP_add_{cipher,digest}() internals
OBJ_NAME_add() is a noop now, so remove all calls and simplify the
remainder of these two functions a bit.
Intermediate step to a larger diff that was ok jsing
tb [Sat, 13 Jan 2024 11:41:44 +0000 (11:41 +0000)]
Remove OBJ_NAME_cleanup() calls from EVP_cleanup()
This is a noop now, so no need to call it.
tb [Sat, 13 Jan 2024 11:38:45 +0000 (11:38 +0000)]
Remove the guts of the OBJ_NAME API
With one exception, none of this is used anymore. All of it will be removed
in the next major bump.
The exception is OBJ_NAME_add(). scurity/xca ran into issues with their
cert renewal logic because RSA certs had a way of mapping the signature
algorithms to a hash, but a similar mechanism wasn't available for ECDSA
certs. So xca uses EVP_add_digest_alias() to have corresponding aliases
for ECDSA. This is a macro wrapping OBJ_NAME_add().
xca now has better logic using the more appropriate OBJ_find_sigid_algs()
(which wasn't available back then). We will still add the alias entries
that xca still adds ourselves to make sure there are no unexpected side
effects. They make sense anyway.
The diff will hopefully land in a few days. If your life depends on ECDSA
cert renewal in xca please hold off on updating to a new snap.
ok jsing
tb [Sat, 13 Jan 2024 11:18:52 +0000 (11:18 +0000)]
Stub out {OpenSSL,OPENSSL}_add*
These serve no purpose anymore (and really haven't for many years) but
will have to be kept since there's a number of software that still uses
them because many years ago they had to.
Relocate the stubs to crypto_init.c since library initialization's what
they were there for.
ok jsing
tb [Sat, 13 Jan 2024 11:12:32 +0000 (11:12 +0000)]
Reimplement EVP_get_{cipher,digest}byname()
Instead of a hashtable lookup do a bsearch() over the static table.
This needs about the same number of strcmp and is a lot simpler.
ok jsing
tb [Sat, 13 Jan 2024 11:08:39 +0000 (11:08 +0000)]
Reimplement {EVP_CIPHER,EVP_MD,OBJ_NAME}_do_all{,_sorted}(3)
This implements the do_all API by simple loops over the tables of
digests and ciphers. Since some ciphers are only available on some
platforms, we need to skip them if necessary. We use loops in each
of the functions rather the convoluted way of reducing some of the
loops to others.
Since the tables are sorted, as ensured by regress, both do_all() and
do_all_sorted() walk the lists in order. In particular, we no longer
need to allocate to be able to sort hash tables by name on the fly in a
void function that may end up doing nothing because allocation failed.
We still need to do an unchecked OPENSSL_init_crypto() call. But that's
what prayer and clean living are there for (as beck put it).
The OBJ_NAME API is completely misnamed. It has little to do with objects
and a lot to do with EVP. Therefore we implement what will remain from
its saner replacement in the evp directory, i.e., evp_names.c.
ok jsing
tb [Sat, 13 Jan 2024 11:00:09 +0000 (11:00 +0000)]
Add a table of digest names, digests and aliases
This is the corresponding commit for digests and their aliases. It
only adds a table to be used in upcoming commits. What was said
about ciphers applies mutatis mutandis to digests.
ok jsing
tb [Sat, 13 Jan 2024 10:57:08 +0000 (10:57 +0000)]
Add a table of cipher names, ciphers and aliases
This arranges the data provided by dynamic library initialization
in a static table and will help avoid gross code with missing error
checking and other defects on every use of the library. This table
isn't pretty due to various naming inconsistecies accumulated over
the decades. It will significantly simplify the implementation of
API such as EVP_get_cipherbyname() and EVP_CIPHER_do_all().
All the table does is map strings to ciphers, typically used on the
openssl(1) command line or in code it's the mechanism that underlies
the map from NID_chacha20 to the data returned by EVP_chacha20().
It's of course more complicated because it just had to be stupid.
This is one of the places where the use of bsearch() is justified.
The price to pay for the simplification is that adding custom aliases
and custom ciphers to this table will no longer be supported. It is
one significant user of the LHASH madness. That's just another piece
of the awful "toolkit aspect"-guided misdesign that contributes to
making this codebase so terrible.
A corresponding table for the digests will be added in the next
commit.
ok jsing
kettenis [Sat, 13 Jan 2024 10:00:27 +0000 (10:00 +0000)]
Provide a more complete implementation of the "component" APIs. Also tweak
the "platform" interfaces to stash away the bits of fdt_attach_args that
we need later on instead of referencing it directly. This makes those
interfaces usable after attach time.
ok jsg@
mlarkin [Fri, 12 Jan 2024 23:50:11 +0000 (23:50 +0000)]
Clarify some behaviour for 'vmctl start' and 'vmctl reload'
Clarify that vmctl start max memory is governed by the vmd(8) user's
max datasize in /etc/login.conf and that vmctl reload only reloads
state for non-running VMs.
ok dv
jsg [Fri, 12 Jan 2024 22:29:04 +0000 (22:29 +0000)]
add license; ok kettenis@
tb [Fri, 12 Jan 2024 19:28:02 +0000 (19:28 +0000)]
Remove X509_STORE_CTX_purpose_inherit(3) documentation
This abomination of an API will be removed. Remove the hairy details of
its internals and make the documentation of X509_STORE_CTX_set_trust(3)
and X509_STORE_CTX_set_purpose(3) independent of it.
Neither of these two remaining APIs can be recommended. Once set, trust
and purpose are sticky. Setting the trust to a different (valid) value
will indicate success but leave the value unchanged. I suppose it means
the new trust value was successfully ignored. Also, setting the trust to
X509_TRUST_DEFAULT can succeed or fail depending on which OpenSSL
derivative you use. Setting the purpose will also set the trust (unless
it is already set). Setting some purposes may or may not fail depending
on the OpenSSL lib.
The only way you have a chance of knowing what will be set is by calling
only one of these functions directly after X509_STORE_CTX_init(). This
isn't really safe either because in some versions the user can override
the values stored in a global table by writing directly to it.
The actual contributions here are rather minimal. State more explicitly
that 0 is invalid (but results in success being returned), document the
error values to be accurate across implementations and call out some of
the nonsense in a CAVEATS section.
Many thanks to schwarze for the very helpful review with lots of input.
ok schwarze
tb [Fri, 12 Jan 2024 13:16:48 +0000 (13:16 +0000)]
appstest: Zap a trailing tab added in previous
job [Fri, 12 Jan 2024 11:24:02 +0000 (11:24 +0000)]
Add -force_pubkey -multivalue-rdn -set_issuer -set_subject -utf8 to x509 app
The -set_issuer, -set_subject, and -force_pubkey features can be used to
'rechain' PKIs, for more information see https://labs.apnic.net/nro-ta/
and https://blog.apnic.net/2023/12/14/models-of-trust-for-the-rpki/
OK tb@
claudio [Fri, 12 Jan 2024 11:19:51 +0000 (11:19 +0000)]
Convert the simple IMSG calls in session.c to the new imsg API.
OK tb@
bluhm [Fri, 12 Jan 2024 10:48:03 +0000 (10:48 +0000)]
Send UDP packets in parallel.
Sending UDP packets via datagram socket is MP safe now. Same applies
to raw IPv4 and IPv6, and divert sockets. Switch sosend() from
exclusive net lock to shared net lock in combination with per socket
lock. TCP and GRE still use exclusive net lock.
tested by otto@ and florian@
OK mvs@
ratchov [Fri, 12 Jan 2024 08:47:46 +0000 (08:47 +0000)]
nfssvc: When the client disconnects, close the socket before sleeping.
If the server doesn't close the socket immediately and starts waiting
for the client to reconnect, then the TCP connection will remain open.
The client will have to wait for the connection to be closed in order
to reconnect with the same source port; this never happens, resulting
in a freeze until the file system is umounted.
This change fixes Linux NFS clients freezing after 5 min of inactivity.
ok miod, help from claudio
miod [Thu, 11 Jan 2024 19:16:26 +0000 (19:16 +0000)]
Since no system call takes more than 6 arguments, and no more than one
off_t argument, there is no need to process more than 6 arguments on
64-bit platforms and 8 on 32-bit platforms.
Make the syscall argument gathering code simpler by removing never-used code
to fetch more arguments from the stack, and local argument arrays when pointing
to the trap frame does the job.
ok guenther@ jsing@
jan [Thu, 11 Jan 2024 17:22:04 +0000 (17:22 +0000)]
ifconfig.8: reorder hwfeature list
ok jmc@
jan [Thu, 11 Jan 2024 17:13:48 +0000 (17:13 +0000)]
fix build with VMM_DEBUG option
ok dv@
tb [Thu, 11 Jan 2024 16:45:26 +0000 (16:45 +0000)]
Remove the evp_pkey_method() test
This is a minimal test for an API that will be removed in a subsequent
commit.
claudio [Thu, 11 Jan 2024 15:46:25 +0000 (15:46 +0000)]
rename field ibuf to imsgbuf in struct ctl_conn
OK tb@
claudio [Thu, 11 Jan 2024 15:38:05 +0000 (15:38 +0000)]
Clear the last errors after receiving a RTR_EVNT_END_OF_DATA event.
Once the cache is synced we can assume that the errors are no longer
relevant.
OK tb@
claudio [Thu, 11 Jan 2024 14:34:49 +0000 (14:34 +0000)]
Move the 'Last received shutdown reason:' output a bit down where it makes
more sense.
bluhm [Thu, 11 Jan 2024 14:15:11 +0000 (14:15 +0000)]
Use domain name for socket lock.
Syzkaller with witness complains about lock ordering of pf lock
with socket lock. Socket lock for inet is taken before pf lock.
Pf lock is taken before socket lock for route. This is a false
positive as route and inet socket locks are distinct. Witness does
not know this. Name the socket lock like the domain of the socket,
then rwlock name is used in witness lo_name subtype. Make domain
names more consistent for locking, they were not used anyway.
Regardless of witness problem, unique lock name for each socket
type make sense.
Reported-by: syzbot+34d22dcbf20d76629c5a@syzkaller.appspotmail.com
Reported-by: syzbot+fde8d07ba74b69d0adfe@syzkaller.appspotmail.com
OK mvs@
claudio [Thu, 11 Jan 2024 14:11:03 +0000 (14:11 +0000)]
Clear the last_sent_errcode, last_rcvd_errcode and last_reason when
the session comes up instead of at the start of a connect.
With this the last errors reported should stick around longer.
Reported by linx.net, OK job@
bluhm [Thu, 11 Jan 2024 13:49:49 +0000 (13:49 +0000)]
Fix white spaces in TCP.
claudio [Thu, 11 Jan 2024 13:09:41 +0000 (13:09 +0000)]
Display the exported rtr session state and fix a missing indent.
OK tb@
claudio [Thu, 11 Jan 2024 13:08:39 +0000 (13:08 +0000)]
Export the rtr session state as string.
OK tb@
jca [Thu, 11 Jan 2024 12:31:37 +0000 (12:31 +0000)]
Add basic support for R_386_GOT32X
Repairs ld.bfd operations on i386: since the switch to llvm-16 clang
emits such relocations (eg one is present in /usr/lib/crtbegin.o).
This unbreaks the build of ports/lang/fpc.
Help and tests from tb@, ok tb@ kettenis@
job [Thu, 11 Jan 2024 11:55:14 +0000 (11:55 +0000)]
Make the -P option work for Trust Anchor certificates as well
OK tb@
claudio [Thu, 11 Jan 2024 11:43:07 +0000 (11:43 +0000)]
Try to improve RTR version negotiation.
RFC8210 and especially draft-ietf-sidrops-8210bis are underspecified when
it comes to inital version negotiation. The authors seem to have a very
different view on how this works compared to the various RTR cache
implementations.
Reducing the version on any session close is a problem since it often leads
to downgraded sessions where not needed. Instead require the server to send
PDUs with their correct version (either a code 4 error, a cache response
or cache reset pdu).
Extensively tested against various modes of StayRTR.
Also tested against routinator which is currently not following the spec
(https://github.com/NLnetLabs/routinator/issues/919) and breaks on unknown
versions.
This is probably not the last change to make RTR version negotiation work
but it is a step in the right direction.
OK tb@
stsp [Thu, 11 Jan 2024 09:52:19 +0000 (09:52 +0000)]
handle MHI M1->M2 state transitions in qwx(4)
When the device signals transition to state M1, the MHI driver may
set the device into M2 state to save power. The MHI device will be
woken up again by the driver ringing the wake doorbell register
before doing PCI reads/writes, which qwx(4) already implements.
deraadt [Thu, 11 Jan 2024 07:59:43 +0000 (07:59 +0000)]
add XKH
djm [Thu, 11 Jan 2024 04:50:28 +0000 (04:50 +0000)]
don't disable RSA test when DSA is disabled; bug introduced in last commit
djm [Thu, 11 Jan 2024 01:51:16 +0000 (01:51 +0000)]
ensure key_fd is filled when DSA is disabled; spotted by tb@
djm [Thu, 11 Jan 2024 01:45:58 +0000 (01:45 +0000)]
make DSA testing optional, defaulting to on
ok markus
djm [Thu, 11 Jan 2024 01:45:36 +0000 (01:45 +0000)]
make DSA key support compile-time optional, defaulting to on
ok markus@
tb [Wed, 10 Jan 2024 21:34:53 +0000 (21:34 +0000)]
X509_TRUST: tidy up includes
tb [Wed, 10 Jan 2024 21:19:56 +0000 (21:19 +0000)]
X509_TRUST: group together all trust_*() functions
Now they are next to the trstandard[] table and listed in the order they
appear in the table.
tb [Wed, 10 Jan 2024 21:14:14 +0000 (21:14 +0000)]
X509_TRUST: hoist trust_compat() to the other end of the file
tb [Wed, 10 Jan 2024 21:11:37 +0000 (21:11 +0000)]
X509_TRUST: start shuffling some code around
Hoist obj_trust() to the top and move the static default_trust() next
to its setter.
tb [Wed, 10 Jan 2024 17:31:28 +0000 (17:31 +0000)]
Rework X509_STORE_CTX_set_{purpose,trust}()
Split the two codepaths in x509_vfy_purpose_inherit() into its two callers.
What remains is gross, but at least a reader has a chance of following all
this nonsense without leaving a significant amount of hair behind.
In short, purpose and trust are only overridden if they're not already
set. Otherwise silently ignore valid purpose and trust identifiers that
were passed in and succeed. Error on almost all invalid trust or purpose
ids, except 0, because... well... who knows, really?
ok jsing
bluhm [Wed, 10 Jan 2024 16:44:30 +0000 (16:44 +0000)]
Split UDP PCB table into IPv4 and IPv6.
Having two hash tables instead of a common one, reduces table size
and contention on the per table lock. The address family is always
known in advance. The lookups and loops are more specific.
OK sashan@
claudio [Wed, 10 Jan 2024 16:08:36 +0000 (16:08 +0000)]
Improve rtr_send_error() so that there is no need to log_warnx() before.
Now rtr_send_error() supports a format string for the error message so
use this fact to make the error report better.
OK tb@
claudio [Wed, 10 Jan 2024 14:59:41 +0000 (14:59 +0000)]
Add missing newlines in printf.
tb [Wed, 10 Jan 2024 14:59:19 +0000 (14:59 +0000)]
Inline rsa_is_pss() and rsa_pkey_is_pss()
It's more explicit and not that much longer.
ok jsing
tb [Wed, 10 Jan 2024 14:23:37 +0000 (14:23 +0000)]
Drop an unnecessary cast
from jsing
tb [Wed, 10 Jan 2024 14:22:53 +0000 (14:22 +0000)]
Fix print_fp()
The callback-based printing needs to die. But first BIO_set() will die.
We have a FILE *. We have fprintf(). No need to use a static BIO to dump
error codes to said stream.
This basically undoes an unrelated change of "Move crpytlib.h prior bio.h"
from 19 years ago (OpenSSL
25a66ee3). Except we don't cast and check len.
ok jsing (who had a nearly identical diff)
claudio [Wed, 10 Jan 2024 13:31:09 +0000 (13:31 +0000)]
Implement log_roa() and log_aspa() and use these functions in printconf.c
OK tb@
claudio [Wed, 10 Jan 2024 11:08:04 +0000 (11:08 +0000)]
Update the control.c code to use the new imsg API.
OK tb@
jmc [Wed, 10 Jan 2024 06:33:13 +0000 (06:33 +0000)]
fix incorrect capitalisation;
jmatthew [Wed, 10 Jan 2024 05:06:00 +0000 (05:06 +0000)]
If bringing up a queue fails, only tear down the ones that we set up
successfully, rather than trying to tear them all down and crashing.
tested by hrvoje, who can make queue setup fail sometimes
ok bluhm@
cheloha [Wed, 10 Jan 2024 04:28:43 +0000 (04:28 +0000)]
pthread_cond_timedwait(3): accept negative absolute timeouts
Negative absolute timeouts are valid inputs.
With input from kettenis@.
Thread: https://marc.info/?l=openbsd-tech&m=
170467558006767&w=2
ok guenther@