claudio [Tue, 30 Aug 2022 16:00:21 +0000 (16:00 +0000)]
Add missing #include <sys/queue.h>
yasuoka [Tue, 30 Aug 2022 15:57:19 +0000 (15:57 +0000)]
Give a string which length is multiple of 4 to b64_pton() since the
function assumes that the input ends at end of 24-bit group.
ok tb claudio
martijn [Tue, 30 Aug 2022 14:54:18 +0000 (14:54 +0000)]
copy over av_oid_end.bo_n instead of av_oid.bo_n bytes when copying over
the searchrange end oid.
OK tb@
tb [Tue, 30 Aug 2022 14:33:26 +0000 (14:33 +0000)]
Avoid leak in proxy_parse_uri()
with/ok claudio
claudio [Tue, 30 Aug 2022 12:49:13 +0000 (12:49 +0000)]
Reshuffle and cleanup the includes a little bit.
claudio [Tue, 30 Aug 2022 12:45:13 +0000 (12:45 +0000)]
In RRDP mode it is possible that a file in the validated cache dir is
no longer valid while the newer file in the .rrdp directory is not (yet)
valid. In this case do not copy the old file over the newer file.
RRDP has no method to identiy inconsistent repos (unlike rsync) so if
the wrong file is put in .rrdp it is not noticed appart from the
verification process failing for that file.
OK tb@ job@
bluhm [Tue, 30 Aug 2022 11:53:03 +0000 (11:53 +0000)]
Refactor internet PCB lookup function. Rename in_pcbhashlookup()
so the public API is in_pcblookup() and in_pcblookup_listen(). For
internal use introduce in_pcbhash_insert() and in_pcbhash_lookup()
to avoid code duplication. Routing domain is unsigned, change the
type to u_int.
OK mvs@
bluhm [Tue, 30 Aug 2022 09:35:24 +0000 (09:35 +0000)]
Protect the receive socket buffer in UDP input with per PCB mutex.
OK claudio@ mvs@
tb [Tue, 30 Aug 2022 08:45:06 +0000 (08:45 +0000)]
Plug memory leak in X509_REQ_print_ex()
CID 356353
ok jsing
mpi [Tue, 30 Aug 2022 08:30:58 +0000 (08:30 +0000)]
Move duplicated code to free swap resources into its own function.
ok mlarkin@
florian [Tue, 30 Aug 2022 05:46:50 +0000 (05:46 +0000)]
sync to libunbound 1.16.2; heavy lifting by sthen
jmc [Tue, 30 Aug 2022 05:40:28 +0000 (05:40 +0000)]
overriden -> overridden;
tb [Mon, 29 Aug 2022 19:42:01 +0000 (19:42 +0000)]
Fix growth check in compress(1)/gzip(1)
If a compressed file is larger than its expanded version, compress(1) and
gzip(1) don't compress unless -f is given. As found by gkoehler, the check
is not quite correct for very small files or files with sufficiently random
data. Fix the check so that slight growth still triggers the check.
ok millert
krw [Mon, 29 Aug 2022 19:39:10 +0000 (19:39 +0000)]
Print warning when a GPT partition start or end is outside the
usable LBA area of the device the GPT is currently inhabiting.
Makes GPT display as informative as MBR display.
In passing, eliminate possible underflow in partition size
calculation.
ok deraadt@
ajacoutot [Mon, 29 Aug 2022 19:37:32 +0000 (19:37 +0000)]
When using logger(1), also log the message to standard error so we don't
have to check syslog when running in debug mode (`-d').
ajacoutot [Mon, 29 Aug 2022 19:14:25 +0000 (19:14 +0000)]
Use rc_configtest.
ajacoutot [Mon, 29 Aug 2022 19:14:02 +0000 (19:14 +0000)]
Introduce the rc_configtest() function.
By default it just returns "0" but can be overriden by rc.d scripts to check
that the daemon configuration is valid when running "start", "reload" and
"restart".
stsp [Mon, 29 Aug 2022 19:01:52 +0000 (19:01 +0000)]
Examine RAID-1C-specific softraid(4) meta-data when checking for
a key disk which is associated with a RAID-1C volume.
ok jsing@, style tweak + ok kn@
kn [Mon, 29 Aug 2022 18:54:43 +0000 (18:54 +0000)]
softraid: make verbose messages -n/nowrite aware
Using installboot(8) in dry-run mode aka. -vn (verbose + nowrite) and first
reading "would install" followed by an "installing" made me uneasy.
Luckily, nothing was written in dry-run mode, it's just that the
softraid specific code fails to honour -n/nowrite.
So make sure it does and pull the printf out of `if (!nowrite)' so we
see the "would install" messages in dry-run mode in the first place.
Output diff for root on CRYPTO softraid on biosboot(8/amd64) to illustrate:
-# installboot -nv sd1
+# ./obj/installboot -nv sd1
would install bootstrap on /dev/rsd1c
using first-stage /usr/mdec/biosboot, second-stage /usr/mdec/boot
sd1: softraid volume with 1 disk(s)
+sd1: would install boot loader on softraid volume
/usr/mdec/boot is 6 blocks x 16384 bytes
-sd0a: installing boot blocks on /dev/rsd0c, part offset 144
+sd0a: would install boot blocks on /dev/rsd0c, part offset 144
master boot record (MBR) at sector 0
partition 3: type 0xA6 offset 64 size
488392001
/usr/mdec/biosboot will be written at sector 64
OK jsing
tb [Mon, 29 Aug 2022 18:54:06 +0000 (18:54 +0000)]
missing period
kn [Mon, 29 Aug 2022 18:42:28 +0000 (18:42 +0000)]
Hook up installboot(8) tests on i386
Passes like amd64 as both use MBR/biosboot(8) at the moment.
tb [Mon, 29 Aug 2022 18:28:35 +0000 (18:28 +0000)]
Simplify load_skiplist()
Instead of copy-pasting valid_uri(), we can call the real thing. That's
also not ideal since we actually check for an FQDN, but it's a bit
simpler.
ok claudio
claudio [Mon, 29 Aug 2022 18:20:32 +0000 (18:20 +0000)]
Adjust rde_decide_test.c since struct aspath changed.
claudio [Mon, 29 Aug 2022 18:19:21 +0000 (18:19 +0000)]
aspath_refs is gone, adjust code
claudio [Mon, 29 Aug 2022 18:18:55 +0000 (18:18 +0000)]
Instead of a global aspath cache copy the aspath attribute per rde_aspath
struct. It uses a bit more memory but improves performance a lot on really
big systems because aspath_get() becomes a very hot function.
OK tb@
martijn [Mon, 29 Aug 2022 18:10:48 +0000 (18:10 +0000)]
Clean up a couple of log lines.
OK tb@
martijn [Mon, 29 Aug 2022 18:05:08 +0000 (18:05 +0000)]
Allow overlapping regions (if subtree claim flag is set) when the backends
are identical.
OK tb@
claudio [Mon, 29 Aug 2022 18:04:51 +0000 (18:04 +0000)]
Use fatal("%s", __func__); instead of fatal("function_name");
OK tb@
martijn [Mon, 29 Aug 2022 18:02:37 +0000 (18:02 +0000)]
Make sure oidbuf is initialized when we hit the overlap case.
OK tb@
stsp [Mon, 29 Aug 2022 17:59:12 +0000 (17:59 +0000)]
Fix integer overflows in iwm(4) and iwx(4) firmware file parsers.
Found by hshoexer and gerhard@, and reported to me by Christian Ehrhardt.
ok gerhard@
deraadt [Mon, 29 Aug 2022 17:24:56 +0000 (17:24 +0000)]
Not all binaries in /sbin are static...
kettenis [Mon, 29 Aug 2022 17:13:57 +0000 (17:13 +0000)]
Put printing the EFI memory map behind and #ifdef.
ok deraadt@
fcambus [Mon, 29 Aug 2022 17:05:38 +0000 (17:05 +0000)]
Mention installation using the framebuffer console on armv7.
It is possible to install OpenBSD/armv7 using the framebuffer console on
systems supporting the simplefb(4) driver, such as the Cubieboard2.
OK miod@
deraadt [Mon, 29 Aug 2022 17:00:29 +0000 (17:00 +0000)]
Dynamically link these /sbin daemons: dhcpleased, mountd, nfsd, pflogd,
resolvd, slaacd, unwind.
The mitigation story is way better: syscalls are in a randomly located
libc, and every syscall stub is randomly located inside that due to
random relinking. As opposed to fixed offset inside a release binary.
There is one known consequence: /usr nfs mounting must use statically
configured IP addresses.
ok kettenis florian, others
deraadt [Mon, 29 Aug 2022 16:53:46 +0000 (16:53 +0000)]
If ld.so loading fails inside execve, uprintf a message to report this
before the SIGABRT kills the process. This clarifies the failure mode
(and resolution to take) when a dynamic executable is run while /usr
isn't mounted. ok miod kettenis
claudio [Mon, 29 Aug 2022 16:44:47 +0000 (16:44 +0000)]
Switch the DB of communities collections to a RB tree instead of an
undersized hash table.
OK tb@
claudio [Mon, 29 Aug 2022 16:43:07 +0000 (16:43 +0000)]
Switch rde_aspath to a RB tree instead of a hash table.
OK tb@
sthen [Mon, 29 Aug 2022 16:04:59 +0000 (16:04 +0000)]
merge updates
sthen [Mon, 29 Aug 2022 16:03:46 +0000 (16:03 +0000)]
import unbound 1.16.2, ok florian@ tb@ also tested by Alex Holst
kettenis [Mon, 29 Aug 2022 15:42:25 +0000 (15:42 +0000)]
Work around MSI and INTx issues on Qualcomm SC8280XP. This makes the NVMe
work on the Lenovo x13s.
ok dv@
kettenis [Mon, 29 Aug 2022 15:40:26 +0000 (15:40 +0000)]
regen
kettenis [Mon, 29 Aug 2022 15:39:55 +0000 (15:39 +0000)]
Add Qualcomm SC8280XP PCIe.
ok dv@
claudio [Mon, 29 Aug 2022 14:58:15 +0000 (14:58 +0000)]
report pending update and withdraw routes in the show neighbor output.
OK tb@
claudio [Mon, 29 Aug 2022 14:57:27 +0000 (14:57 +0000)]
Export pending update and withdraw as part of struct peer_stats.
OK tb@
bluhm [Mon, 29 Aug 2022 14:43:56 +0000 (14:43 +0000)]
Do not calculate the output protocol checksum in the IP input path.
This logic was introduced in 2013 when pf checksum fixup was
temporarily removed. After restoring the pf bahavior in 2016, it
should not be necessary anymore.
OK claudio@
martijn [Mon, 29 Aug 2022 13:25:18 +0000 (13:25 +0000)]
When there are two overlapping regions handled by the same backend we might
traverse back in the tree; Make sure this doesn't happen.
OK tb@
martijn [Mon, 29 Aug 2022 13:23:32 +0000 (13:23 +0000)]
When a backend disappears while handling a request, make sure that the
outstanding requests are handled by the next backend, instead of leaking
memory.
OK tb@
martijn [Mon, 29 Aug 2022 13:19:05 +0000 (13:19 +0000)]
Let snmpd check a response package against the requested searchrange end.
If the returned OID is beyond the searchrange end we have two cases:
- If the backend supports searchranges (agentx) we generate a GENERR and
close the connection.
- If the backend doesn't support searchranges (legacy and maybe a future
snmp proxy) we simply fix-up the result.
OK tb@
martijn [Mon, 29 Aug 2022 12:17:24 +0000 (12:17 +0000)]
Fix a case where EndOfMibView wasn't honoured.
OK tb@
deraadt [Mon, 29 Aug 2022 11:51:05 +0000 (11:51 +0000)]
mount /usr earlier, to satisfy dynamically-linked daemons in /sbin better
(there will be more soon)
mpi [Mon, 29 Aug 2022 11:09:31 +0000 (11:09 +0000)]
Use a rwlock and a mutex to serialize access to global swap variables.
Adapted from NetBSD by tb@.
ok tb@, kn@
mbuhl [Mon, 29 Aug 2022 09:50:38 +0000 (09:50 +0000)]
Sendmsg could crash in tcp_output due to a missing check after the
introduction of tcp_send.
OK mvs@, bluhm@, gnezdo@
Reported-by: syzbot+e859fd353c90eeac26f8@syzkaller.appspotmail.com
mvs [Mon, 29 Aug 2022 08:08:17 +0000 (08:08 +0000)]
Move PRU_RCVOOB request to (*pru_rcvoob)().
ok bluhm@
bluhm [Mon, 29 Aug 2022 07:51:45 +0000 (07:51 +0000)]
Use struct refcnt for interface address reference counting.
There was a crash due to use after free of the ifa although it is
ref counted. As ifa_refcnt was a simple integer increment, there
may be a path where multiple CPUs access it concurrently. So change
to struct refcnt which is MP safe and provides dt(4) leak debugging.
Link level address for IPsec enc(4) and various MPLS interfaces is
special. There ifa is part of struct sc. Use refcount anyway and
add a panic to detect use after free.
bug report stsp@; OK mvs@
jsg [Mon, 29 Aug 2022 07:35:40 +0000 (07:35 +0000)]
remove unused macppc headers
ok miod@ mpi@ gnezdo@
krw [Mon, 29 Aug 2022 07:19:14 +0000 (07:19 +0000)]
Print warning when an MBR partition starts or extends past the
end of the device the MBR is currently inhabiting.
Prompted by some interesting MBR's from France, verbiage
suggestion from deraadt@, ok miod@
jsing [Mon, 29 Aug 2022 06:49:24 +0000 (06:49 +0000)]
Provide ERR_R_INIT_FAIL.
Needed for an upcoming change.
ok tb@
jsing [Mon, 29 Aug 2022 06:48:58 +0000 (06:48 +0000)]
Provide ASN1_R_TYPE_NOT_PRIMITIVE.
Needed for an upcoming change.
ok tb@
jsg [Mon, 29 Aug 2022 06:08:03 +0000 (06:08 +0000)]
static const, not const static
c99 6.11.5:
"The placement of a storage-class specifier other than at the beginning
of the declaration specifiers in a declaration is an obsolescent
feature."
ok miod@ tb@
jsg [Mon, 29 Aug 2022 05:31:16 +0000 (05:31 +0000)]
sync
djm [Mon, 29 Aug 2022 03:04:29 +0000 (03:04 +0000)]
update libfido2 to 1.11.0, taking in just over a year of upstream
development. "looks ok" miod@ ok sthen@
NB. libfido2 major bump
jsg [Mon, 29 Aug 2022 02:58:13 +0000 (02:58 +0000)]
static inline, not inline static
c99 6.11.5:
"The placement of a storage-class specifier other than at the beginning
of the declaration specifiers in a declaration is an obsolescent
feature."
ok guenther@
jsg [Mon, 29 Aug 2022 02:08:13 +0000 (02:08 +0000)]
use ansi volatile keyword, not __volatile__
ok miod@ guenther@
jsg [Mon, 29 Aug 2022 02:01:18 +0000 (02:01 +0000)]
use ansi volatile keyword, not __volatile
ok miod@ guenther@
drahn [Mon, 29 Aug 2022 01:34:18 +0000 (01:34 +0000)]
Support full GICD SPI interrupt count for REG32/REG16.
This enables SPI support for interrupts on X13s.
ok jsg@
mvs [Sun, 28 Aug 2022 21:35:11 +0000 (21:35 +0000)]
Move PRU_SENSE request to (*pru_sense)().
ok bluhm@
bluhm [Sun, 28 Aug 2022 20:32:01 +0000 (20:32 +0000)]
Since we have no raw_usrreq anymore, remove pr_output indirection.
pfkeyv2 and route can call their output functions directly.
OK mvs@
mvs [Sun, 28 Aug 2022 18:44:16 +0000 (18:44 +0000)]
Move PRU_ABORT request to (*pru_abort)().
We abort only the sockets which are linked to `so_q' or `so_q0' queues of
listening socket. Such sockets have no corresponding file descriptor and
are not accessed from userland, so PRU_ABORT used to destroy them on
listening socket destruction.
Currently all our sockets support PRU_ABORT request, but actually it
required only for tcp(4) and unix(4) sockets, so i should be optional.
However, they will be removed with separate diff, and this time PRU_ABORT
requests were converted as is.
Also, the socket should be destroyed on PRU_ABORT request, but route and
key management sockets leave it alive. This was also converted as is,
because this wrong code never called.
ok bluhm@
mvs [Sun, 28 Aug 2022 18:43:12 +0000 (18:43 +0000)]
Don't check `so_pcb' with PR_WANTRCVD flag. tcp(4) sockets are the only
sockets which could have NULL `so_pcb' and we handle this case within
tcp_rcvd() handler.
ok bluhm@
tb [Sun, 28 Aug 2022 18:30:29 +0000 (18:30 +0000)]
Make a few error messages match the actually failing function.
tb [Sun, 28 Aug 2022 18:27:47 +0000 (18:27 +0000)]
Plug memory leak in CMS_add_simple_smimecap() in the unlikely event that
ASN1_INTEGER_set() fails.
ok jsing
jsing [Sun, 28 Aug 2022 17:59:57 +0000 (17:59 +0000)]
Add regress test for the encoding of an ASN1_INTEGER with NULL data.
jsing [Sun, 28 Aug 2022 17:51:46 +0000 (17:51 +0000)]
Set the X.509 request version number.
Rather than assuming the default value from X509_REQ_new(), explicitly set
the X.509 request version number to zero.
ok tb@
jsing [Sun, 28 Aug 2022 17:49:25 +0000 (17:49 +0000)]
Encode an ASN.1 INTEGER with NULL data to value of zero.
When an ASN1_INTEGER is created it has NULL data until a value is set -
previously, an ASN1_INTEGER in this state encoded to an ASN.1 INTEGER with
a value of 0, rather than being treated as an error. While code should
really set values, the historical behaviour has not required this.
Found the hard way by sthen@ with acme-client.
ok tb@
schwarze [Sun, 28 Aug 2022 13:51:58 +0000 (13:51 +0000)]
Replace ugly .sp requests with normal .Pp macros.
After tbl_term.c 1.66, such contortions are no longer needed.
schwarze [Sun, 28 Aug 2022 12:14:48 +0000 (12:14 +0000)]
Adjust desired output after tbl_term.c rev. 1.66 (stop skipping
vertical space after boxed tables).
I'm committing this separately because trying to regenerate the
desired output with groff-current reveals an unrelated, recent
regression in groff. So i fixed the groff output by hand before
committing it, to get rid of the effect of the roff regression.
schwarze [Sun, 28 Aug 2022 11:45:27 +0000 (11:45 +0000)]
Vertical spacing changes around tables in man_term.c rev. 1.194
and tbl_term.c rev. 1.66 cause quite a bit of churn, unfortunately.
This commit cleans up most of it.
jsg [Sun, 28 Aug 2022 11:11:25 +0000 (11:11 +0000)]
remove unused blowfish inline defines
inline use was removed in 1998
schwarze [Sun, 28 Aug 2022 10:57:52 +0000 (10:57 +0000)]
Stop skipping vertical space after boxed tables.
Skipping such space used to be a bug in GNU tbl(1), and a kludge
was added to mandoc to produce identical output.
The bug was fixed in groff commit
8818c07c Jul 30 2022 gbranden@
https://savannah.gnu.org/bugs/index.php?49390
Consequently, now is the time to get rid of the kludge.
schwarze [Sun, 28 Aug 2022 09:55:58 +0000 (09:55 +0000)]
Stop unconditionally emitting vertical space before .TS (table start).
Same change as in groff commit
7ec36dc9 Jul 30 2022 gbranden@
For more details, see https://savannah.gnu.org/bugs/index.php?62841
This change makes sense because:
* It improves the formatting of more pages than it degrades.
* Existing manual pages are wildly inconsistent in which behaviour they
expect: apparently few manual page authors understood the old rules.
* It simplifies the rules of how .TS behaves in man(7)
and makes them more similar to how it behaves in mdoc(7).
* It improves flexibility, making it possible for a table to immediately
follow preceding text without a blank line, which some existing pages
want to use, for example XCreateWindow(3).
jsg [Sun, 28 Aug 2022 02:54:43 +0000 (02:54 +0000)]
directly use ansi volatile keyword in local drm files
mglocker [Sat, 27 Aug 2022 20:31:45 +0000 (20:31 +0000)]
Remove unused mutex.
ok kettenis@
mvs [Sat, 27 Aug 2022 20:28:01 +0000 (20:28 +0000)]
Move PRU_SEND request to (*pru_send)().
The former PRU_SEND error path of gre_usrreq() had `control' mbuf(9)
leak. It was fixed in new gre_send().
The former pfkeyv2_send() was renamed to pfkeyv2_dosend().
ok bluhm@
kettenis [Sat, 27 Aug 2022 16:56:25 +0000 (16:56 +0000)]
Add power button support.
ok tobhe@
jsing [Sat, 27 Aug 2022 09:23:17 +0000 (09:23 +0000)]
Wire up QUIC regress.
jsing [Sat, 27 Aug 2022 09:16:29 +0000 (09:16 +0000)]
Add regress for QUIC.
This exercises the libssl QUIC implementation and completes a TLS handshake
using the SSL_QUIC_METHOD interface.
jsing [Sat, 27 Aug 2022 09:12:55 +0000 (09:12 +0000)]
Handle SSL_do_handshake() being called before SSL_provide_quic_data().
If SSL_do_handshake() is called before SSL_provide_quic_data() has been
called, the QUIC read buffer will not have been initialised. In this case
we want to return TLS13_IO_WANT_POLLIN so that the QUIC stack will provide
handshake data.
jsing [Sat, 27 Aug 2022 09:10:10 +0000 (09:10 +0000)]
Provide additional defines for EVP AEAD.
While these will not be used by LibreSSL, they are used by some QUIC
implementations (such as ngtcp2).
ok tb@
tb [Sat, 27 Aug 2022 08:30:18 +0000 (08:30 +0000)]
Use ENTRY_NB() instead of ENTRY()
Since llvm 13, there are compiler warnings in libm on amd64 and i386 due
to .weak overriding an earlier .globl. Use ENTRY_NB() instead of ENTRY()
to avoid emitting the .globl.
ok deraadt jca (for amd64)
ok guenther
tb [Sat, 27 Aug 2022 08:26:15 +0000 (08:26 +0000)]
Provide ENTRY_NB() for i386
ok guenther
kn [Fri, 26 Aug 2022 21:47:16 +0000 (21:47 +0000)]
Backout "Only return file descriptors to block or character devices"
mount_mfs(8) no monger mounts "/build" with the following fstab(5) entry:
/dev/sd0b /build mfs rw,noperm,nodev,nosuid,-s=
2064348,noauto
as found out by bluhm the hard way.
kn [Fri, 26 Aug 2022 18:37:44 +0000 (18:37 +0000)]
Remove stale comment about nonexistent ifnetaddr
Obsolete since if.c r1.56 (2008)
"Make if.c kvm free by fetching the interface stats via sysctl [...]".
mvs [Fri, 26 Aug 2022 16:17:38 +0000 (16:17 +0000)]
Move PRU_RCVD request to (*pru_rcvd)().
ok bluhm@
claudio [Fri, 26 Aug 2022 14:10:52 +0000 (14:10 +0000)]
Handle IMSG_SESSION_* messages immediatly when received and do not put
them on the per peer imsg queue. This is mainly for IMSG_SESSION_DOWN.
Delaying the session down can race against IMSG_SESSION_ADD which is
handled immediatly and as a result an establised connection may be
removed in the RDE because of it.
The various graceful restart imsgs need similar treatment for similar
reasons. In the end when a session is reset/closed the RDE needs to
stop all work and flush the per peer imsg queue.
With this only update and route refresh messages are handled via the
imsg queue.
OK tb@
kn [Fri, 26 Aug 2022 11:06:47 +0000 (11:06 +0000)]
Do not rm a directory
tb [Fri, 26 Aug 2022 11:04:13 +0000 (11:04 +0000)]
Tweaks in load_skiplist()
If there's an issue opening the default skip list file other than its
absence (most likely bad permissions), we should not silently ignore
that. Also, use err() instead of errx() to display the error.
Second, linelen, the return value of getline(), is not currently used.
Repurpose it to save the result of strcspn() which calculates the length
of the string we're interested in and use that instead of strlen().
ok claudio
kn [Fri, 26 Aug 2022 09:14:00 +0000 (09:14 +0000)]
Sync usage with manual
-l takes chunks not specials; while here, simplify markup for optional parts.
Feedback OK jmc
djm [Fri, 26 Aug 2022 08:16:27 +0000 (08:16 +0000)]
whitespace
djm [Fri, 26 Aug 2022 08:12:56 +0000 (08:12 +0000)]
whitespace
tb [Fri, 26 Aug 2022 06:32:03 +0000 (06:32 +0000)]
Adjust PEM_write_X509() error message and unwrap line.