openbsd
3 months agozap a stray Nd line;
jmc [Sun, 14 Jul 2024 18:03:59 +0000 (18:03 +0000)]
zap a stray Nd line;

3 months agoAdd radiusd_file(5) and link it from radiusd.conf(5).
yasuoka [Sun, 14 Jul 2024 16:22:59 +0000 (16:22 +0000)]
Add radiusd_file(5) and link it from radiusd.conf(5).

3 months agoAdd new radiusd_eap2mschap module. It provides conversions from EAP
yasuoka [Sun, 14 Jul 2024 16:09:23 +0000 (16:09 +0000)]
Add new radiusd_eap2mschap module.  It provides conversions from EAP
to MSCHAPv2.

3 months agoShuffle verbiage to make page more general. e.g. by mentioning
krw [Sun, 14 Jul 2024 16:09:06 +0000 (16:09 +0000)]
Shuffle verbiage to make page more general. e.g. by mentioning
nvme(4).

Feedback jmc@ jmatthew@ deraadt@ kn@

ok jmc@ kn@

3 months agoRewrite EVP_PKEY_add1_attr_by_NID()
tb [Sun, 14 Jul 2024 16:06:31 +0000 (16:06 +0000)]
Rewrite EVP_PKEY_add1_attr_by_NID()

Instead of jumping through many layers that cause headache, we can achieve
the same in an entirely straightforward way without losing clarity.

ok jsing

3 months agoDisable most EVP_PKEY_*attr* API
tb [Sun, 14 Jul 2024 16:04:10 +0000 (16:04 +0000)]
Disable most EVP_PKEY_*attr* API

There is a single consumer of this entire family of function, namely
the openssl(1) pkcs12 command uses EVP_PKEY_add1_attr_by_NID, so leave
that one intact for now.

ok jsing

3 months agoForgot to annotate the TMP UGLY CAST[S] as requested by jsing
tb [Sun, 14 Jul 2024 15:56:08 +0000 (15:56 +0000)]
Forgot to annotate the TMP UGLY CAST[S] as requested by jsing

h/t to levitte

3 months agoDocument SSL_CIPHER_get_handshake_digest(3)
tb [Sun, 14 Jul 2024 15:48:24 +0000 (15:48 +0000)]
Document SSL_CIPHER_get_handshake_digest(3)

3 months agoFix source and drain confusion in socket splicing somove().
bluhm [Sun, 14 Jul 2024 15:42:23 +0000 (15:42 +0000)]
Fix source and drain confusion in socket splicing somove().

If a large mbuf in the source socket buffer does not fit into the
drain buffer, split the mbuf.  But if the drain buffer still has
some data in it, stop moving data and try again later.  This skips
a potentially expensive mbuf operation.
When looking which socket buffer has to be locked, I found that the
length of the source send buffer was checked.  Change it to drain.
As this is a performance optimization for a special corner case,
noone noticed the bug.

OK sashan@

3 months agoPrepare to provide SSL_CIPHER_get_handshake_digest()
tb [Sun, 14 Jul 2024 15:39:36 +0000 (15:39 +0000)]
Prepare to provide SSL_CIPHER_get_handshake_digest()

Needed by newer freeradius. This is a straightforward implementation that
essentially duplicates tls13_cipher_hash().

ok jsing

3 months agoMove radius_attr_{,un}hide() to radius_subr.c.
yasuoka [Sun, 14 Jul 2024 15:31:49 +0000 (15:31 +0000)]
Move radius_attr_{,un}hide() to radius_subr.c.

3 months agoAdd "authentication-filter". Add new 2 imsg types so that
yasuoka [Sun, 14 Jul 2024 15:27:57 +0000 (15:27 +0000)]
Add "authentication-filter".  Add new 2 imsg types so that
authentication modules can request the next authentication and the
next authentication can receive the result of the previous and modify
the result.

3 months agoSet length of MPPE send/recv key.
yasuoka [Sun, 14 Jul 2024 15:13:41 +0000 (15:13 +0000)]
Set length of MPPE send/recv key.

3 months agoRemove lhash_local.h.
jsing [Sun, 14 Jul 2024 14:32:45 +0000 (14:32 +0000)]
Remove lhash_local.h.

lhash_local.h was previously needed since conf/conf_api.c and
objects/obj_dat.c were fiddling with lhash internals when deleting via a
callback. Since we no longer need to do that, inline the structs in
lhash.c and remove the header.

ok tb@

3 months agoZap trailing whitespace
jca [Sun, 14 Jul 2024 14:32:02 +0000 (14:32 +0000)]
Zap trailing whitespace

Dummy commit to trigger the git exporter.

3 months agoOnly match if we can find a corresponding cpu device. This means the
jmatthew [Sun, 14 Jul 2024 14:04:16 +0000 (14:04 +0000)]
Only match if we can find a corresponding cpu device.  This means the
many extra ACPI0007 instances found in current generation servers no
longer fill up dmesg with noise.

ok kettenis@

3 months agoFor specific hids (currently only ACPI0007, acpicpu(4)), use a print
jmatthew [Sun, 14 Jul 2024 13:58:57 +0000 (13:58 +0000)]
For specific hids (currently only ACPI0007, acpicpu(4)), use a print
function that always returns QUIET so instances that don't get matched
are not reported.

ok kettenis@

3 months agoAdd radiusd_file(8) module. It provides authencation by a local file.
yasuoka [Sun, 14 Jul 2024 13:44:30 +0000 (13:44 +0000)]
Add radiusd_file(8) module.  It provides authencation by a local file.

3 months agoAdd "radiusd" field to struct radius_query.
yasuoka [Sun, 14 Jul 2024 13:36:44 +0000 (13:36 +0000)]
Add "radiusd" field to struct radius_query.

3 months agoFix printf(3) signal safety for wide character strings.
millert [Sun, 14 Jul 2024 13:31:50 +0000 (13:31 +0000)]
Fix printf(3) signal safety for wide character strings.

The %ls (wide char string) support in printf(3) currently uses
malloc(3), which violates the promise in in sigaction(2).  This
makes it use mmap(2) instead.  OK deraadt@

3 months agoFail explicitly on unexptected imsg->hdr_type. Otherwise the following
tobhe [Sun, 14 Jul 2024 13:13:33 +0000 (13:13 +0000)]
Fail explicitly on unexptected imsg->hdr_type. Otherwise the following
comparison is undefined.

3 months agoActually provide *definitions* for hwcap & hwcap2
jca [Sun, 14 Jul 2024 11:36:54 +0000 (11:36 +0000)]
Actually provide *definitions* for hwcap & hwcap2

Double checked by kettenis@

Sorry for the time window with breakage visible on arm64 and riscv64. :-/

3 months agoActually set up hwcap AUX_* entries when available
jca [Sun, 14 Jul 2024 11:14:29 +0000 (11:14 +0000)]
Actually set up hwcap AUX_* entries when available

Erroneously dropped from the last elf_aux_info(3) diff I sent on tech@.
Lack of this chunk would affect arm64 and riscv64 as they're the two
architectures providing hwcap*.

Should have been ok kettenis@

3 months agoMistakenly the same challenge is used for testing CHAP.
yasuoka [Sun, 14 Jul 2024 11:12:32 +0000 (11:12 +0000)]
Mistakenly the same challenge is used for testing CHAP.

3 months agoMake the lines of md5chap understandable.
yasuoka [Sun, 14 Jul 2024 10:52:50 +0000 (10:52 +0000)]
Make the lines of md5chap understandable.

3 months agoIn addition to setting the PCI power state, also run the appropriate _PSx
kettenis [Sun, 14 Jul 2024 10:50:39 +0000 (10:50 +0000)]
In addition to setting the PCI power state, also run the appropriate _PSx
method that matches the target state.

ok deraadt@

3 months agoUpon first suspend, turn off all power resources that haven't been
kettenis [Sun, 14 Jul 2024 10:48:55 +0000 (10:48 +0000)]
Upon first suspend, turn off all power resources that haven't been
referenced.

ok deraadt@

3 months agofix double word; ok dtucker@
jsg [Sun, 14 Jul 2024 10:19:23 +0000 (10:19 +0000)]
fix double word; ok dtucker@

3 months agoAdd wcsnlen(3) declaration, missed in previous.
jca [Sun, 14 Jul 2024 10:04:17 +0000 (10:04 +0000)]
Add wcsnlen(3) declaration, missed in previous.

3 months agoSync sets after elf_aux_info(3) and wcsnlen(3) additions + libc bump
jca [Sun, 14 Jul 2024 09:57:11 +0000 (09:57 +0000)]
Sync sets after elf_aux_info(3) and wcsnlen(3) additions + libc bump

3 months agoBump minor after elf_aux_info(3) and wcsnlen(3) additions
jca [Sun, 14 Jul 2024 09:54:56 +0000 (09:54 +0000)]
Bump minor after elf_aux_info(3) and wcsnlen(3) additions

3 months agoAdd wcsnlen(3), wcslen(3) with a max len argument
jca [Sun, 14 Jul 2024 09:51:18 +0000 (09:51 +0000)]
Add wcsnlen(3), wcslen(3) with a max len argument

Missing function hit by fcambus@ some time ago.  ok millert@

3 months agoAdd elf_aux_info(3)
jca [Sun, 14 Jul 2024 09:48:48 +0000 (09:48 +0000)]
Add elf_aux_info(3)

Designed to let userland peek at AT_HWCAP and AT_HWCAP2 using an already
existing interface coming from FreeBSD. Headers bits were snatched from
there.  Input & ok kettenis@

libc bump and sets sync will follow soon

3 months agosync
deraadt [Sun, 14 Jul 2024 09:41:43 +0000 (09:41 +0000)]
sync

3 months agoAdd /usr/X11R6/include/va. ok tb@
matthieu [Sun, 14 Jul 2024 09:39:15 +0000 (09:39 +0000)]
Add /usr/X11R6/include/va. ok tb@

3 months agosync slaacd(8) log.c to dhcpleased(8)'s version.
florian [Sun, 14 Jul 2024 08:57:32 +0000 (08:57 +0000)]
sync slaacd(8) log.c to dhcpleased(8)'s version.

We don't built log.c on the ramdisk so no need for ifndef small.

3 months agolog_getverbose() is a void function
florian [Sun, 14 Jul 2024 08:45:05 +0000 (08:45 +0000)]
log_getverbose() is a void function

pointed out by tb

3 months agosync slaacd(8) log.h to dhcpleased(8) log.h
florian [Sun, 14 Jul 2024 08:41:54 +0000 (08:41 +0000)]
sync slaacd(8) log.h to dhcpleased(8) log.h

- include stdlib.h for exit(3)
- knf fixes
- define log_getverbose as (0) instead of 0

input & OK tb

3 months agovmm(4)/vmx: update host cr3, invept on cpu migration.
dv [Sun, 14 Jul 2024 07:57:42 +0000 (07:57 +0000)]
vmm(4)/vmx: update host cr3, invept on cpu migration.

Since vmm handles nested page faults in the vcpu run loop, trying
to avoid trips back to userland, it's possible for the thread to
move host cpus. vmm(4) already updates some local cpu state when
this happens, but also needs to update the host cr3 in the vmcs to
allow vmx to restore the proper cr3 value on the next vm exit.

Additionally, we should be flushing the ept cache on the new cpu.
If the single context flush is available, use that instead of the
global flush.

ok mlarkin@

3 months agoUnbreak tree by defining log_getverbose() for SMALL builds
tb [Sun, 14 Jul 2024 06:34:04 +0000 (06:34 +0000)]
Unbreak tree by defining log_getverbose() for SMALL builds

ok anton florian

3 months ago"please refer" -> "refer"
jsg [Sun, 14 Jul 2024 05:53:09 +0000 (05:53 +0000)]
"please refer" -> "refer"

missed in 2022 "remove please from manual pages" commit
ok tb@

3 months agonew sentence, new line
jsg [Sun, 14 Jul 2024 03:58:49 +0000 (03:58 +0000)]
new sentence, new line

3 months agospelling
jsg [Sun, 14 Jul 2024 03:53:18 +0000 (03:53 +0000)]
spelling

3 months agospelling
jsg [Sun, 14 Jul 2024 03:47:44 +0000 (03:47 +0000)]
spelling

3 months agommio.c is now empty and can be removed
mlarkin [Sat, 13 Jul 2024 22:12:41 +0000 (22:12 +0000)]
mmio.c is now empty and can be removed

mmio.c was moved to x86_mmio.c with dv@'s recent refactoring. The resulting
empty file can be removed now.

3 months agossl2.h and ssl23.h join the party in the attic
tb [Sat, 13 Jul 2024 18:33:18 +0000 (18:33 +0000)]
ssl2.h and ssl23.h join the party in the attic

Now that the SSL2 client hello support is gone, nothing uses this anymore,
except that a few ports still need SSL2_VERSION.

ok beck

3 months agoMake error constants const in libssl
tb [Sat, 13 Jul 2024 17:42:13 +0000 (17:42 +0000)]
Make error constants const in libssl

This could be made cleaner if we expose ERR_load_const_strings(), but for
now this hackier version with casts achieves the same and removes the last
unprotected modifiable globals in this library.

ok jsing

3 months agoMove the sigaction next to multi
tb [Sat, 13 Jul 2024 16:43:56 +0000 (16:43 +0000)]
Move the sigaction next to multi

Reduces diff in -portable

3 months agoAdd missing RCS header to vmd(8)'s vmm.h.
dv [Sat, 13 Jul 2024 16:13:45 +0000 (16:13 +0000)]
Add missing RCS header to vmd(8)'s vmm.h.

Apparently it never had one. It's rarely touched, so went unnoticed.

3 months agoReduce if_indextoname(3) usage.
florian [Sat, 13 Jul 2024 16:06:34 +0000 (16:06 +0000)]
Reduce if_indextoname(3) usage.

Don't ask the kernel to translate an if_index to a name if we are not
running with verbose logging, it's not free.

3 months agoImplement some more suspend/resume Linux compat such that inteldrm(4) can
kettenis [Sat, 13 Jul 2024 15:38:21 +0000 (15:38 +0000)]
Implement some more suspend/resume Linux compat such that inteldrm(4) can
achieve RC6 and save a significant amount of power for S0i.

ok jsg@

3 months agoMention nvme(4) and gdt(4) as devices that register with bio(4).
krw [Sat, 13 Jul 2024 15:28:42 +0000 (15:28 +0000)]
Mention nvme(4) and gdt(4) as devices that register with bio(4).

ok deraadt@

3 months agoUnify X.509v3 extension methods
tb [Sat, 13 Jul 2024 15:08:58 +0000 (15:08 +0000)]
Unify X.509v3 extension methods

Use C99 initializers for all structs (some were forgotten).
Make all the structs static, call them x509v3_ext_* matching NID_*.
Add accessors called x509v3_ext_method_* and use these to implement
X509V3_EXT_get_nid().

This adds consistency and avoids a few contortions like grouping
a few extensions in arrays to save a couple externs.

ok beck jsing

3 months agoRevert the vdoom change, while it prevents the crashes on joel's go
beck [Sat, 13 Jul 2024 14:37:55 +0000 (14:37 +0000)]
Revert the vdoom change, while it prevents the crashes on joel's go
builder and avoids the ufs_inactive problems, bluhm hits panics on
shutdown and filesystem unmount on the regress testers.

We'll have to try the other approach of detecting the corrupted
vnode perhaps.

3 months agoNULL check must be inside the loop. found tobhe
yasuoka [Sat, 13 Jul 2024 14:28:27 +0000 (14:28 +0000)]
NULL check must be inside the loop.  found tobhe

ok tobhe

3 months agoFix radius.c again^2. Cancel previous and revert the latest one
yasuoka [Sat, 13 Jul 2024 14:19:09 +0000 (14:19 +0000)]
Fix radius.c again^2.  Cancel previous and revert the latest one
(sent to tech@).

3 months agoFix radius.c again. Previous was old one.
yasuoka [Sat, 13 Jul 2024 14:08:53 +0000 (14:08 +0000)]
Fix radius.c again.  Previous was old one.

3 months agoAdd condition to ip_gre.c in files.
bluhm [Sat, 13 Jul 2024 13:20:44 +0000 (13:20 +0000)]
Add condition to ip_gre.c in files.

Use gre condition in conf/files for compiling netinet/ip_gre.c only
if needed.  Remove #if NGRE > 0 from ip_gre.c that caused ramdisk
build to compile an empty C file.

OK kn@ deraadt@; input jsg@

3 months agoUse calloc(3) instead of malloc(3). "accounting" is used without
yasuoka [Sat, 13 Jul 2024 13:06:47 +0000 (13:06 +0000)]
Use calloc(3) instead of malloc(3).  "accounting" is used without
initialization. Also don't check request authenticator for other than
Accounting-Request.

3 months agogrammar/macro fixes for the radius text;
jmc [Sat, 13 Jul 2024 12:58:51 +0000 (12:58 +0000)]
grammar/macro fixes for the radius text;

3 months agoFix radius.c. Previous it was broken.
yasuoka [Sat, 13 Jul 2024 12:25:07 +0000 (12:25 +0000)]
Fix radius.c.  Previous it was broken.

3 months agoAdd RADIUS support. Authentication, accounting, and "Dynamic
yasuoka [Sat, 13 Jul 2024 12:22:46 +0000 (12:22 +0000)]
Add RADIUS support.  Authentication, accounting, and "Dynamic
Authorization Extensions"(DAE) are supported.
feedback markus stu

ok tobhe

3 months agoMark IP protocol GRE as MP safe from socket layer.
bluhm [Sat, 13 Jul 2024 12:00:11 +0000 (12:00 +0000)]
Mark IP protocol GRE as MP safe from socket layer.

The pipex code in gre_send() matches more or less what udp_send()
does.  This has been MP safe for a long time.  rip_send() is already
called with PR_MPSOCKET.

OK mvs@

3 months agoPrevious commit broke RAMDISK_CD kernel build. Always include udp.h
bluhm [Sat, 13 Jul 2024 10:09:40 +0000 (10:09 +0000)]
Previous commit broke RAMDISK_CD kernel build.  Always include udp.h
in ip6_forward.c.

3 months agoDo not store full IPv6 packet in common forwarding case.
bluhm [Sat, 13 Jul 2024 09:34:26 +0000 (09:34 +0000)]
Do not store full IPv6 packet in common forwarding case.

Forwarding IPv6 packets is slower than IPv4.  Reason is that m_copym()
is done for every packet.  Just in case we may have to send an ICMP6
packet, ip6_forward() creates a mbuf copy.  After that mbuf cluster
is read only, so for the ethernet header another mbuf is allocated.
pf NAT and RDR ignores readonly clusters, so it also modifies the
potential ICMP6 packet.
IPv4 ip_forward() avoids all these problems by copying the leading
68 bytes of the original packets onto the stack.  More is not need
for ICMP.  IPv6 RFC 4443 2.4. (c) requires up to 1232 bytes in the
ICMP6 packet.  This cannot be copied to the stack.
The reason for the difference in the standard seems to be that the
ICMP6 packet has to contain the full header chain.  If we have a
simple TCP, UDP or ESP packet without chain, do a shortcut and just
preserve the header for the ICMP6 packet.
Small packets already use stack memory, large packets need extra
mbuf allocation.  Now truncate ICMP6 packet to a reasonable length
if the original packets has a final protocol header directly after
the IPv6 header.  List of suitable protocols contains TCP, UDP, ESP
as they cover the common cases and anything behind the header should
not be needed for path MTU discovery.

OK deraadt@ florian@ mvs@

3 months agoBackout previous change related to not freeing memory on suspend.
dv [Sat, 13 Jul 2024 08:59:41 +0000 (08:59 +0000)]
Backout previous change related to not freeing memory on suspend.

It broke resume from hibernate. :(

3 months agoImplement investigate kernel corefile to lldb.
asou [Sat, 13 Jul 2024 07:25:38 +0000 (07:25 +0000)]
Implement investigate kernel corefile to lldb.

3 months agoRemove internet PCB mutex.
bluhm [Fri, 12 Jul 2024 19:50:35 +0000 (19:50 +0000)]
Remove internet PCB mutex.

All incpb locking has been converted to socket receive buffer mutex.
Per PCB mutex inp_mtx is not needed anymore.  Also delete PRU related
locking functions.  A flag PR_MPSOCKET indicates whether protocol
functions support parallel access with per socket rw-lock.
TCP is the only protocol that is not MP capable from the socket
layer and needs exclusive netlock.

OK mvs@

3 months agoRewrite bytes/sec calculation using fixed point math.
florian [Fri, 12 Jul 2024 19:11:25 +0000 (19:11 +0000)]
Rewrite bytes/sec calculation using fixed point math.

This makes signal handler safe on OpenBSD.

To avoid overflows the accuracy is scaled. Above 10 minutes run time
we only care about second accuracy. Between 1 seconds and 10 minutes
we use millisecond accuracy.

Below one second we use nanoseconds, but those numbers are probably
meaningless.

Signal handler problem pointed out by deraadt

OK deraadt, millert, tb

3 months agoFix the horrible and undocumented behaviour of X509_check_trust
beck [Fri, 12 Jul 2024 18:15:10 +0000 (18:15 +0000)]
Fix the horrible and undocumented behaviour of X509_check_trust

Of allowing you to pass in a NID directly, instead of a trust_id,
and have it work, as long as the trust_id's and the NID's did not
overlap.

This screwball behaviour was depended upon by the OCSP code that
called X509_check_trust with the NID, instead of the trust id, so
let's fix that.

We also rename the confusingly named X509_TRUST_DEFAULT to
X509_TRUST_ACCEPT_ALL which makes a lot more sense, and rototill
this to remove the confusingly named static functions.

This will shortly be follwed up by making this function private,
so we have not bothered to fix the amazingly obtuse man page
as it will be taken behind the barn at that time.

ok tb@

3 months agoSwitch `so_snd' of udp(4) sockets to the new locking scheme.
mvs [Fri, 12 Jul 2024 17:20:18 +0000 (17:20 +0000)]
Switch `so_snd' of udp(4) sockets to the new locking scheme.

udp_send() and following udp{,6}_output() do not append packets to
`so_snd' socket buffer. This mean the sosend() and sosplice() sending
paths are dummy pru_send() and there is no problems to simultaneously
run them on the same socket.

Push shared solock() deep down to sesend() and take it only around
pru_send(), but keep somove() running unedr exclusive solock(). Since
sosend() doesn't modify `so_snd' the unlocked `so_snd' space checks
within somove() are safe. Corresponding `sb_state' and `sb_flags'
modifications are protected by `sb_mtx' mutex(9).

Tested and OK bluhm.

3 months agoFix a typo in log
yasuoka [Fri, 12 Jul 2024 15:54:52 +0000 (15:54 +0000)]
Fix a typo in log

3 months agoFix Disconnect-Ack not to have an Error-Cause attribute. Tweak
yasuoka [Fri, 12 Jul 2024 15:54:11 +0000 (15:54 +0000)]
Fix Disconnect-Ack not to have an Error-Cause attribute.  Tweak
some log messages.

3 months agoClean up in X509_check_trust.
beck [Fri, 12 Jul 2024 15:53:51 +0000 (15:53 +0000)]
Clean up in X509_check_trust.

The XXX comment in here is now outdated. Our behaviour matches boringssl
in that passing in a 0 trust gets the default behavior, which is to
trust the certificate only if it has EKU any, or is self signed.

Remove the goofy unused nid argument to "trust_compat" and rename it to
what it really does, instead of some bizzare abstraction to something
simple so the code need not change if we ever change our mind on what
"compat" is for X.509, which will probably only happen when we are back
to identifying things by something more sensible like recognizable grunts
and smells.

ok jsing@

3 months agoSimplify nvme suspend/resume by resetting queues and not deallocating
dv [Fri, 12 Jul 2024 14:53:09 +0000 (14:53 +0000)]
Simplify nvme suspend/resume by resetting queues and not deallocating
memory. This removes memory allocation from the resume-side of
device activation.

ok deraadt@

3 months agovmd(8): Fix error handling in tx path.
jan [Fri, 12 Jul 2024 14:34:08 +0000 (14:34 +0000)]
vmd(8): Fix error handling in tx path.

ok dv@

3 months agorefactor the signal handlers for clarity, inverting the situation:
deraadt [Fri, 12 Jul 2024 14:30:27 +0000 (14:30 +0000)]
refactor the signal handlers for clarity, inverting the situation:
the signal handler was calling a big function which is shared between
multiple contexts -- that hides the rule that this big function has
signal safe requirements (which it fails).  now, the signal handler
contains all the code, and everyone else calls the signal handler function
as a regular function, from their (normal) contexts.
the signal handler context is the most strict, so this pattern is better.
ok florian

3 months agoQuiet vmd debug logging about page faults.
dv [Fri, 12 Jul 2024 13:51:12 +0000 (13:51 +0000)]
Quiet vmd debug logging about page faults.

When we get bumped to userland and the fault is already handled,
don't log anything. It's way too chatty and helps nobody trying to
debug things.

3 months agomanual ret-clean; ok mlarkin
deraadt [Fri, 12 Jul 2024 13:10:58 +0000 (13:10 +0000)]
manual ret-clean; ok mlarkin

3 months agoRecommend veb(4) instead of bridge(4).
florian [Fri, 12 Jul 2024 12:35:32 +0000 (12:35 +0000)]
Recommend veb(4) instead of bridge(4).

bridge(4) has weird interactions with traffic crossing the bridge.

Missing change after updating the faq pointed out by ajacoutot
OK dv

3 months agoUTF-8 keys now contain the internal representation and not the Unicode
nicm [Fri, 12 Jul 2024 11:21:18 +0000 (11:21 +0000)]
UTF-8 keys now contain the internal representation and not the Unicode
codepoint, so convert extended keys properly. From Stanislav Kljuhhin.

3 months agoImprove signal handlers guidance.
deraadt [Fri, 12 Jul 2024 11:01:40 +0000 (11:01 +0000)]
Improve signal handlers guidance.
ok beck kettenis, earlier versions jmc

3 months agoAdd pool to allocate individual rtkit task arguments instead of passing a
tobhe [Fri, 12 Jul 2024 10:01:28 +0000 (10:01 +0000)]
Add pool to allocate individual rtkit task arguments instead of passing a
shared argument.  This fixes a race condition where a message could overwrite
rtkep->msg of a previously scheduled task resulting in a refcounting error later
on causing the screen to stay dark after waking up from suspend.

ok kettenis@

3 months agoDrop the unused evp include
tb [Fri, 12 Jul 2024 09:57:04 +0000 (09:57 +0000)]
Drop the unused evp include

3 months agoRename the sk in this file to exts
tb [Fri, 12 Jul 2024 09:55:38 +0000 (09:55 +0000)]
Rename the sk in this file to exts

3 months agoAvoid using ret for an X509_EXTENSION
tb [Fri, 12 Jul 2024 09:53:30 +0000 (09:53 +0000)]
Avoid using ret for an X509_EXTENSION

Instead rename the **ext in this file to **out_ext, freeing up ext in
X509_EXTENSION_create_by_OBJ()

Appeases some jsing grumbling on review

3 months agoTweak variable names in X509v3_add_ext()
tb [Fri, 12 Jul 2024 09:47:49 +0000 (09:47 +0000)]
Tweak variable names in X509v3_add_ext()

x -> out_ext, sk -> exts

requested by jsing on review

3 months agoRename crit to critical in this file
tb [Fri, 12 Jul 2024 09:42:24 +0000 (09:42 +0000)]
Rename crit to critical in this file

requested by jsing on review

3 months agoSimplify X509_EXTENSION_get_critical()
tb [Fri, 12 Jul 2024 09:35:54 +0000 (09:35 +0000)]
Simplify X509_EXTENSION_get_critical()

This is a silly API, but there are worse.

ok jsing

3 months agoLose a few extra lines in X509_EXTENSION_set_object()
tb [Fri, 12 Jul 2024 09:33:05 +0000 (09:33 +0000)]
Lose a few extra lines in X509_EXTENSION_set_object()

ok jsing

3 months agoStreamline X509_EXTENSION_create_by_OBJ()
tb [Fri, 12 Jul 2024 09:31:28 +0000 (09:31 +0000)]
Streamline X509_EXTENSION_create_by_OBJ()

ok jsing

3 months agoImprove duplicate detection and repo_move_valid
claudio [Fri, 12 Jul 2024 09:27:32 +0000 (09:27 +0000)]
Improve duplicate detection and repo_move_valid

Only trigger a duplicate error if a valid filepath is revisted. It is
possible that a bad CA references somebody else's files and if that
happens first it would block the valid access.

To make this work, pass the ok flag to filepath_add() and only set the
talmask bit if the file was ok. Since we need to do the duplicate check
before processing the entity introduce filepath_valid() which checks
if the path is in the tree and has its talmask bit set.

In repo_move_valid() handle conflicts more gracefully. When both a valid
and temporary file are present assume that one of the files was never ok
(talmask == 0) and silently remove that file from the filepath tree.

OK tb@

3 months agoClean up X509_EXTENSION_create_by_NID()
tb [Fri, 12 Jul 2024 09:25:43 +0000 (09:25 +0000)]
Clean up X509_EXTENSION_create_by_NID()

Remove unnecessary ret parameter and freeing of obj (which looks like
a double free or freeing of unallocated memory but actually isn't due
to various magic flags). Also make this const correct.

ok jsing

3 months agoRun sysctl net.inet.ip.forwarding without net lock.
bluhm [Fri, 12 Jul 2024 09:25:27 +0000 (09:25 +0000)]
Run sysctl net.inet.ip.forwarding without net lock.

The places in packet processing where ip_forwarding is evaluated
have been consolidated.  The remaining pieces in pf test, ip input,
and icmp input do not need consistent information.  If the integer
value is changed by another CPU, it is harmless.
The sysctl syscall sets the value atomically, so add atomic read
in network processing and remove the net lock in sysctl IPCTL_FORWARDING.

OK claudio@ mvs@

3 months agoRewrite X509v3_add_ext()
tb [Fri, 12 Jul 2024 08:58:59 +0000 (08:58 +0000)]
Rewrite X509v3_add_ext()

This is another brilliancy straight out of muppet labs. Overeager and
misguided sprinkling of NULL checks, going through the trademark poor
code review, made this have semantics not matching what almost every
other function with this signature would be doing in OpenSSL land.

This is a long standing mistake we can't fix without introducing
portability traps, but at least annotate it. Simplify the elaborate
dance steps and make this resemble actual code.

ok jsing

3 months agoRename the variable c to ok. It returns if the file failed to parse or not.
claudio [Fri, 12 Jul 2024 08:54:48 +0000 (08:54 +0000)]
Rename the variable c to ok. It returns if the file failed to parse or not.
We need to pass this to filepath_add so lets use a better name.
OK tb@

3 months agoSimplify X509v3_get_ext() and X509v3_delete_ext()
tb [Fri, 12 Jul 2024 08:46:45 +0000 (08:46 +0000)]
Simplify X509v3_get_ext() and X509v3_delete_ext()

Drop unnecessary checks that are part of the stack API.

ok jsing

3 months agoAlign X509v3_get_ext_by_critical() with X509v3_get_ext_by_OBJ()
tb [Fri, 12 Jul 2024 08:44:16 +0000 (08:44 +0000)]
Align X509v3_get_ext_by_critical() with X509v3_get_ext_by_OBJ()

Plus, replace a manual check with a call to X509_EXTENSION_get_critical().

ok jsing

3 months agoClean up X509v3_get_ext_by_OBJ()
tb [Fri, 12 Jul 2024 08:39:54 +0000 (08:39 +0000)]
Clean up X509v3_get_ext_by_OBJ()

Like most of its siblings, this function can be simplified significantly
by making proper use of the API that is being built. Drop unnecessary NULL
checks and other weirdness and add some const correctness.

ok jsing

3 months agoUse dedicated window for access to the PCIe core registers.
kettenis [Fri, 12 Jul 2024 08:33:25 +0000 (08:33 +0000)]
Use dedicated window for access to the PCIe core registers.
Based on a diff from Hector Martin for Asahi Linux.

ok patrick@, tobhe@