tb [Tue, 26 Jul 2022 19:50:06 +0000 (19:50 +0000)]
Do not pass input length <= 0 to the cipher handlers
Input length < 0 is an error and input length == 0 can result in
strange effects in some ciphers, except in CCM mode, which is extra
special.
Based on OpenSSL
420cb707 by Matt Caswell and Richard Levitte
found by & ok jsing
claudio [Tue, 26 Jul 2022 17:12:40 +0000 (17:12 +0000)]
No need to check RB_REMOVE() return value if kif is not NULL.
Therefor check that in the IFAN_DEPARTURE case the interface was found
before calling kif_remove.
Idea and OK tb@
claudio [Tue, 26 Jul 2022 16:36:33 +0000 (16:36 +0000)]
Missing indirection. This version compiles.
claudio [Tue, 26 Jul 2022 16:32:29 +0000 (16:32 +0000)]
Refactor nexthop tracking and remove all the kif_kr code. There is no
need to track directly connected routes per kif. The only use case was
for nexthop validation but that can be done by storing the ifindex in
struct knexthop.
OK tb@
jca [Tue, 26 Jul 2022 15:37:34 +0000 (15:37 +0000)]
For make obj, always the lldb* and llvm-ar directories
Apparently favored by deraadt@, pointed out by patrick@, ok patrick@
jca [Tue, 26 Jul 2022 15:34:33 +0000 (15:34 +0000)]
Only build lldb support libraries on archs where lldb is installed
Shaves off a significant amount of time (eg on riscv64) in base builds.
If you want to build gnu/usr.bin/clang from source you'll need
bsd.own.mk rev 1.213 installed.
ok miod@ patrick@
deraadt [Tue, 26 Jul 2022 14:53:45 +0000 (14:53 +0000)]
Only allow changing the domainname (from empty) before securelevel increase.
libc YP support has a couple of places where the domainname is cached, and
this results in wildly incoherent behaviour which could even be risky.
If you want to change the domainname, you will have to reboot.
ok beck miod
deraadt [Tue, 26 Jul 2022 14:53:29 +0000 (14:53 +0000)]
Only allow changing the domainname (from empty) before securelevel increase.
libc YP support has a couple of places where the domainname is cached, and
this results in wildly incoherent behaviour which could even be risky.
If you want to change the domainname, you will have to reboot.
ok beck miod
visa [Tue, 26 Jul 2022 14:49:13 +0000 (14:49 +0000)]
Remove "select collisions" output from vmstat(8).
While here, use NULL instead of "" as name list terminator.
OK mpi@ cheloha@
krw [Tue, 26 Jul 2022 14:30:37 +0000 (14:30 +0000)]
Allow editing of an MBR of all zeros.
Fallout from regress failure spotted by anton@.
krw [Tue, 26 Jul 2022 13:20:16 +0000 (13:20 +0000)]
Don't use echo "<blah>" | fdisk -e to create boot partition.
Use -b like the install scripts do.
Spotted by anton@.
tb [Tue, 26 Jul 2022 07:09:24 +0000 (07:09 +0000)]
minor tweaks: unwrap a line, tweak a comment and zap an empty line
claudio [Tue, 26 Jul 2022 06:48:18 +0000 (06:48 +0000)]
No need to provide a dummy nexthop anymore, instead set the nhflags to
NEXTHOP_VALID or 0 depending on the nexthop state for the testvector.
cheloha [Tue, 26 Jul 2022 04:07:13 +0000 (04:07 +0000)]
moncontrol(3): remove hertz() fallback function
In the moncontrol(3) code in libc there is a fallback function,
hertz(). The idea is, if getting kern.clockrate from sysctl(2) fails,
we fall back to deriving the value of hz(9) using setitimer(2)'s
rounding behavior.
This is extremely clever, but it actually sucks. Calling setitimer(2)
quietly cancels any extant ITIMER_REAL timer, so moncontrol(3) cannot
be safely used alongside setitimer(2). This fact is not documented.
kern.clockrate is not blocked by pledge(2), so outside of stack
corruption (which we can't do anything about anyway) I don't see a way
for the sysctl(2) call to ever fail on OpenBSD. So hertz() is also
pointless.
Hence this patch: get rid of hertz().
Thread: https://marc.info/?l=openbsd-tech&m=
163881542813633&w=2
ok guenther@
kn [Tue, 26 Jul 2022 00:38:42 +0000 (00:38 +0000)]
Zap unused bridge command skipping
netstart(8) lost bridge specific functionality in 2009.
$ grep bridge /etc/netstart
# interfaces (or bridges), add default routes and return.
This is dead unreached code.
OK deraadt
CVt: ----------------------------------------------------------------------
kn [Tue, 26 Jul 2022 00:36:54 +0000 (00:36 +0000)]
Zap obsolete bridge section
netstart(8) lost bridge specific functionality in 2009.
Replace "bridge" with "X" in the existent sentence and you'll get an
obvious unhelpful statement:
If the network interface is a bridge, the options described in
the bridge section of the ifconfig(8) manual page apply.
Since the following example is no longer special in any way, remove it.
OK deraadt
bluhm [Mon, 25 Jul 2022 23:19:34 +0000 (23:19 +0000)]
The IPv4 reassembly code is MP safe, so we can run it in parallel.
Note that ip_ours() runs with shared netlock, while ip_local() has
exclusive netlock after queuing. Move existing the code into
function ip_fragcheck() and call it from ip_ours().
OK mvs@
millert [Mon, 25 Jul 2022 21:43:58 +0000 (21:43 +0000)]
Rebase to 2022agtz from https://github.com/JodaOrg/global-tz
This version is derived from the IANA 2022a tzdata but with some
pre-1970 data restored that had been moved to the backzone file
(which we do not currently ship).
From this point on, we will follow the global-tz fork.
guenther [Mon, 25 Jul 2022 21:38:24 +0000 (21:38 +0000)]
Simplify wctype() and wctype_l(): we have one set of classification
types used by all (== both) locales; put their implementation in one
file and make the mapping static there. The rl_wctype member of
_RuneLocale and its initialization go away at the same time.
ok schwarze@
guenther [Mon, 25 Jul 2022 21:29:16 +0000 (21:29 +0000)]
Remove test of non-portable implementation details (whether wctype_t
and wctrans_t values are locale-specific) so we can simplify our
implementation in libc
ok schwarze@
tb [Mon, 25 Jul 2022 20:48:57 +0000 (20:48 +0000)]
Add a regression test for bn_isqrt.c
This validates the tables used in bn_is_perfect_square() and checks that
for randomly generated numbers the isqrt() is what it is expected to be.
krw [Mon, 25 Jul 2022 17:45:16 +0000 (17:45 +0000)]
Only MBR and GPT structures can be edited by fdisk.
If neither are found, restrict user actions to printing basic
information on the disk, reading the man page, initializing an
MBR or GPT, or terminating fdisk without changing anything.
Feedback on earlier attempt by miod@ and brynet@.
claudio [Mon, 25 Jul 2022 16:37:55 +0000 (16:37 +0000)]
Properly handle nexthop state changes in the decision process
In rev 1.90 of rde_decide.c the re->active cache of the best prefix was
replaced with a call to prefix_best(). This introduced a bug because the
nexthop state at that time may have changed already. As a result when
a nexthop became unreachable prefix_evaluate() had oldbest = NULL and
newbest = NULL and did not withdraw the prefix from FIB and Adj-RIB-Out.
To fix this store the nexthop state per prefix and introduce
prefix_evaluate_nexthop() which removes the prefix from the decision list,
updates the nexthop state of the prefix and reinserts the prefix. Doing
this ensures that prefix_best() always reports the same result once the
decison process is done. prefix_best() and prefix_eligible() only depend
on data stored on the prefix itself.
OK tb@
kettenis [Mon, 25 Jul 2022 16:35:41 +0000 (16:35 +0000)]
The GPIO pin on Apple M1 systems is actually connected to the SDZ pin, which
is reflected in more recent device trees. Adjust the driver accordingly.
ok patrick@
schwarze [Mon, 25 Jul 2022 15:29:21 +0000 (15:29 +0000)]
Separate the macro for generating string test functions
for the macro generating test functions for other data types.
This makes sense because both are sufficiently different.
It also avoids a large number of false positive compiler warnings
that guenther@ reported.
OK guenther@
kn [Mon, 25 Jul 2022 14:48:24 +0000 (14:48 +0000)]
Print function name for context
A single "out of order" line is too generic.
OK kettenis
mvs [Mon, 25 Jul 2022 08:29:26 +0000 (08:29 +0000)]
Don't grab netlock within pppacioctl(). pipex(4) doesn't rely on
netlock anymore.
ok bluhm@ yasuoka@
mvs [Mon, 25 Jul 2022 08:28:42 +0000 (08:28 +0000)]
Remove "Static" keyword from pipex(4) layer.
We don't use "static" keyword for functions declaration to allow ddb(4)
debug. Also, many "Static" functions are called by pppx(4) layer outside
pipex(4) layer.
This is the mostly mechanic diff, except the `pipex_pppoe_padding' which
should be "static const".
ok bluhm@ yasuoka@
visa [Mon, 25 Jul 2022 08:06:44 +0000 (08:06 +0000)]
Fix annotation of smr_tqh_last
smr_tqh_last is not intended for lockless use with SMR_PTR_GET().
visa [Mon, 25 Jul 2022 07:28:22 +0000 (07:28 +0000)]
Replace selwakeup() with KNOTE() in socket event activation
Let's try this again now that the kernel locking issue in nfsrv_rcv()
has been fixed.
The previous attempt of the conversion triggered hangs on NFS servers.
This was probably caused by the removal of the kernel-locked section
just prior to the socket upcall. The section had masked a locking error
in NFS code.
dtucker [Mon, 25 Jul 2022 07:12:45 +0000 (07:12 +0000)]
Restore missing "!" in TEST_SSH_ELAPSED_TIMES test.
tb [Mon, 25 Jul 2022 05:06:06 +0000 (05:06 +0000)]
fix indent
jsg [Mon, 25 Jul 2022 02:25:55 +0000 (02:25 +0000)]
If a command or interface first appeared in PWB/UNIX, UNIX System III or
UNIX System V mention it. Only do so in manual pages with a
pre-existing HISTORY section.
Prompted by the comparison of System V and BSD commands and interfaces
in Sun's "System V Enhancements Overview" document.
checked against manuals on bitsavers, TUHS archive and CSRG archive CDs
ok jmc@ schwarze@
jsg [Mon, 25 Jul 2022 01:57:48 +0000 (01:57 +0000)]
nl(1) was first in System III not SVR2
problem with FreeBSD manual page reported by segaloco on TUHS list
dtucker [Sun, 24 Jul 2022 23:29:10 +0000 (23:29 +0000)]
Test TEST_SSH_ELAPSED_TIMES for empty string not executable. No-op
on most platforms but should prevent warnings in -portable on systems
that don't have 'date %s'.
bluhm [Sun, 24 Jul 2022 22:38:25 +0000 (22:38 +0000)]
Fix assertion for write netlock in rip6_input(). ip6_input() has
shared net lock. ip_deliver() needs exclusive net lock. Instead
of calling ip_deliver() directly, use ip6_ours() to queue the packet.
Move the write lock assertion into ip_deliver() to catch such bugs
earlier.
The assertion was only triggered with IPv6 multicast forwarding or
router alert hop by hop option. Found by regress test.
OK kn@ mvs@
tb [Sun, 24 Jul 2022 21:41:29 +0000 (21:41 +0000)]
Plug leak in X509V3_add1_i2d()
Do not leak the extension that was deleted from the stack.
via OpenSSL
c3efe5c9.
ok jsing
tb [Sun, 24 Jul 2022 20:02:04 +0000 (20:02 +0000)]
Prepare to resurrect TS_RESP_CTX_set_time_cb()
This was removed shortly after the fork since TS is not 2038-ready
and since there were no consumers of this API. Now there are consumers
and they add it themselves if it's missing from libcrypto. This will no
longer be possible with opaque TS structs, so begrudgingly add it back.
ok jsing kn
tb [Sun, 24 Jul 2022 19:54:46 +0000 (19:54 +0000)]
Prepare to provide TS_VERIFY_CTX accessors
The setters make no sense since they do not free the old members and
return what was passed in instead of returning the old struct member
so that the caller has a chance of freeing them. This has the side
effect that calling a setter a second time will likely result in a leak.
TS_VERIFY_CTX_set_imprint() was "fixed" upstream by adding a free() but
the other three setters were missed since discussing the contributor's
CLA was more important. Also missed was that adding frees will result in
double frees: careful consumers like openssl/ruby have workarounds for
the strange existing semantics.
Add a compat #define for TS_VERIF_CTS_set_certs() that made it into the
public API with a typo.
A good illustration of the amount of thought and care that went into
the OpenSSL 1.1 API by both the implementers and the reviewers.
Amazing job overall.
We will be stuck with this nonsense for a long time.
ok jsing kn
tb [Sun, 24 Jul 2022 19:25:36 +0000 (19:25 +0000)]
Prepare to provide various TS_STATUS_INFO accessors
This adds TS_STATUS_get0_{failure_info,text,status}() as well as
TS_STATUS_INFO_set_status(). These will be needed by Ruby and openssl(1)
when we make the structs in ts.h opaque.
ok kn jsing
tb [Sun, 24 Jul 2022 18:55:22 +0000 (18:55 +0000)]
Align PKCS12_key_gen_uni() with OpenSSL
This is Dr Stephen Henson's rewrite avoiding BIGNUM (OpenSSL
54c68d35).
Additionally this pulls in a < vs <= fix by Pauli Dale (OpenSSL
9d868840).
There is also some minor cleanup by myself.
ok jsing
tb [Sun, 24 Jul 2022 18:51:16 +0000 (18:51 +0000)]
Minor fixes in PKCS12_parse()
Pull up clearing of output parameters before first return
(OpenSSL
524fdd51 by Bernd Edlinger), explicit comparisons
against NULL, '\0', etc.
ok jsing
tb [Sun, 24 Jul 2022 18:48:04 +0000 (18:48 +0000)]
Per RFC 7292, safeContentsBag is a SEQUENCE OF, not a SET OF
OpenSSL
b709babb by Richard Levitte
ok jsing
tb [Sun, 24 Jul 2022 18:45:21 +0000 (18:45 +0000)]
Clear key on exit in PKCS12_gen_mac()
Also switch to heap-allocated HMAC_CTX and clean a few things up
stylistically.
loosely based on OpenSSL
f5cee414 by Shane Lontis
ok jsing
tb [Sun, 24 Jul 2022 18:41:08 +0000 (18:41 +0000)]
Plug a leak in PKCS12_setup_mac()
based on OpenSSL
1b8f1937 by Dmitry Belyavskiy
ok jsing
kn [Sun, 24 Jul 2022 17:23:23 +0000 (17:23 +0000)]
regen
kn [Sun, 24 Jul 2022 17:22:12 +0000 (17:22 +0000)]
Update Atheros AR928X pcidev string
The AR9280 half Mini Card (HB92) supports 5GHz as confirmed by athn(4)'s
"The AR9220, AR9223 and AR9280 (codenamed Merlin) ..." paragraph.
pcidevs however wrongly identifies this device as
athn0 at pci2 dev 0 function 0 "Atheros AR9281" rev 0x01: apic 2 int 17
athn0: AR9280 rev 2 (2T2R), ROM rev 22, address 04:f0:21:30:37:de
athn(4) says AR9281 is 2GHz only, so the first line (pcidevs string) does
not match the real information on the second line (from real hardware).
Looking around, the PCI Vendor ID: 168c, Product ID: 002a are described as
* https://pcilookup.com/?ven=168c&dev=002a&action=submit
"AR928X Wireless Network Adapter (PCI-Express)"
* https://pci-ids.ucw.cz/read/PC/168c/002a calls this
"AR928X Wireless Network Adapter (PCI-Express)"
* https://github.com/torvalds/linux/blob/
fc02cb2b37fe2cbf1d3334b9f0f0eab9431766c4/Documentation/devicetree/bindings/net/wireless/qca%2Cath9k.yaml#L27
says
- pci168c,002a # AR9280 and AR9283
* https://pcisig.com/membership/member-companies?combine=168c
(empty, no result)
* NetBSD pcidevs is like ours
product ATHEROS AR9281 0x002a AR9281
Im summary, "AR928X" seems more appropiate and matches both AR9280 and
AR9281 chipsets, so use that to avoid contradicting dmesg lines:
athn0 at pci2 dev 0 function 0 "Atheros AR928X" rev 0x01: apic 2 int 17
athn0: AR9280 rev 2 (2T2R), ROM rev 22, address 04:f0:21:30:37:de
stsp confirms how "Atheros naming is very convoluted."
Feedback sthen
OK stsp
jsing [Sun, 24 Jul 2022 15:05:16 +0000 (15:05 +0000)]
Move cipher_id bsearch functions back to the bottom of the file.
jsing [Sun, 24 Jul 2022 14:31:37 +0000 (14:31 +0000)]
Set NULL BIOs for QUIC.
When used with QUIC, the SSL BIOs are effectively unused, however we still
currently expect them to exist for status (such as SSL_ERROR_WANT_READ and
SSL_ERROR_WANT_WRITE). Set up NULL BIOs if QUIC is in use.
ok tb@
jsing [Sun, 24 Jul 2022 14:28:16 +0000 (14:28 +0000)]
Provide record layer callbacks for QUIC.
QUIC uses TLS to complete the handshake, however unlike normal TLS it does
not use the TLS record layer, rather it provides its own transport. This
means that we need to intercept all communication between the TLS handshake
and the record layer. This allows TLS handshake message writes to be
directed to QUIC, likewise for TLS handshake message reads. Alerts also
need to be sent via QUIC, plus it needs to be provided with the traffic
keys that are derived by TLS.
ok tb@
jsing [Sun, 24 Jul 2022 14:19:45 +0000 (14:19 +0000)]
Move tls13_phh_done_cb() after tl13_phh_received_cb().
This is the order that they're called/run in.
jsing [Sun, 24 Jul 2022 14:16:29 +0000 (14:16 +0000)]
Provide QUIC encryption levels.
QUIC wants to know what "encryption level" handshake messages should be
sent at. Provide an ssl_encryption_level_t enum (via BoringSSL) that
defines these (of course quictls decided to make this an
OSSL_ENCRYPTION_LEVEL typedef, so provide that as well).
Wire these through to tls13_record_layer_set_{read,write}_traffic_key() so
that they can be used in upcoming commits.
ok tb@
jmc [Sun, 24 Jul 2022 12:22:12 +0000 (12:22 +0000)]
document limit-item "anchors"; from martin vahlensieck
while here, rework the "set limit" section:
- use a simple list
- add some missing defaults and limit-item
mbuhl helped fill in some of the blanks
ok kn
mpi [Sun, 24 Jul 2022 11:00:22 +0000 (11:00 +0000)]
Revert simplification of the aiodone daemon it breaks swap on arm64.
Found the hard way by mlarkin@ and deraadt@.
tb [Sun, 24 Jul 2022 10:52:51 +0000 (10:52 +0000)]
Rely on tlsext_parse() to set a decode_error alert
Instead of setting the alert manually in various parse handlers, we can
make use of the fact that tlsext_parse() sets the alert to decode_error
by default. This simplifies the code quite a bit.
ok jsing
tb [Sun, 24 Jul 2022 08:16:47 +0000 (08:16 +0000)]
Start making ts opaque
Move the not yet exposed EssCertIDv2 struct internals to ts_local.h and move
the ASN.1 function prototypes that we don't want to expose with them.
Include ts_local.h where necessary or where it will be needed soon.
ok jsing
cheloha [Sun, 24 Jul 2022 00:28:09 +0000 (00:28 +0000)]
macppc, powerpc: retrigger deferred DEC interrupts from splx(9)
On PowerPC, by design, you cannot mask decrementer (DEC) interrupts
without also masking other interrupts that we want to leave unmasked
at or above IPL_CLOCK. So, currently, the DEC is left unmasked, even
when we're working at IPL_CLOCK or IPL_HIGH. If a DEC interrupt
arrives while we're at those priority levels, the current solution is
to postpone any clock interrupt work until the next hardclock(9) or
statclock tick.
This is a problem for a machine-independent clock interrupt subsystem
because the MD code, e.g. decr_intr(), ideally shouldn't need to know
anything about when the next event is scheduled to occur.
The most obvious solution to this problem that I can think of is to
instead postpone clock interrupt work until the next time our priority
level drops below IPL_CLOCK. This is something we can do from the MD
code without any knowledge of when the next clock interrupt event is
scheduled to occur.
So:
- Add a new boolean, ci_dec_deferred, to the PowerPC cpu_info struct.
- If we reach decr_intr() when the CPU's priority level is too high,
set ci_dec_deferred, clear the DEC exception, and return.
- If we reach decr_intr() and the CPU's priority level is low enough,
clear ci_dec_deferred and do any needed clock interrupt work.
- In splx(9) (there are three different versions we need to update),
check ci_dec_deferred. If it's set and our priority level is
dropping below IPL_CLOCK, raise a DEC exception.
Tested by me on PowerMac7,3 (openpic). Tested by miod@ on PowerMac1,1
(macintr) (`make build` completes). Tested by gkoehler@ on an unknown
PowerMac (probably openpic).
With lots of help from kettenis@.
ok gkoehler@ miod@
cheloha [Sat, 23 Jul 2022 22:58:51 +0000 (22:58 +0000)]
timecounting: use full 96-bit product when computing elapsed time
The timecounting subsystem computes elapsed time by scaling (64 bits)
the difference between two counter values (32 bits at most) up into a
struct bintime (128 bits).
Under normal circumstances it is sufficient to do this with 64-bit
multiplication, like this:
struct bintime bt;
bt.sec = 0;
bt.frac = th->tc_scale * tc_delta(th);
However, if tc_delta() exceeds 1 second's worth of counter ticks, that
multiplication overflows. The result is that the monotonic clock appears
to jump backwards.
When can this happen? In practice, I have seen it when trying to
compile LLVM on an EdgeRouter Lite when using an SD card as the
backing disk. The box gets stuck in swap, the hardclock(9) is
delayed, and we appear to "lose time".
To avoid this overflow we need to compute the full 96-bit product of
the delta and the scale.
This commit adds TIMECOUNT_TO_BINTIME(), a function for computing that
full product, to sys/time.h. The patch puts the new function to use
in lib/libc/sys/microtime.c and sys/kern/kern_tc.c.
(The commit also reorganizes some of our high resolution bintime code
so that we always read the timecounter first.)
Doing the full 96-bit multiplication is between 0% and 15% slower than
doing the cheaper 64-bit multiplication on amd64. Measuring a precise
difference is extremely difficult because the computation is already
quite fast.
I would guess that the cost is slightly higher than that on 32-bit
platforms. Nobody ever volunteered to test, so this remains a guess.
Thread: https://marc.info/?l=openbsd-tech&m=
163424607918042&w=2
6 month bump: https://marc.info/?l=openbsd-tech&m=
165124251401342&w=2
Committed after 9 months without review.
cheloha [Sat, 23 Jul 2022 22:10:58 +0000 (22:10 +0000)]
kernel: remove global "randompid" toggle
Apparently, we used to created several kthreads before the kernel
random number generator was up and running. A toggle, "randompid",
was needed to tell allocpid() whether it made sense to attempt to
allocate random PIDs.
However, these days we get e.g. arc4random(9) into a working state
before any kthreads are spawned, so the toggle is no longer needed.
Thread: https://marc.info/?l=openbsd-tech&m=
165541052614453&w=2
Very nice historical context provided by miod@.
probably ok miod@ deraadt@
florian [Sat, 23 Jul 2022 16:16:25 +0000 (16:16 +0000)]
Delete autoconf or temporary address if flag is removed.
OK kn
claudio [Sat, 23 Jul 2022 10:24:00 +0000 (10:24 +0000)]
Refactor and rename bgpd_filternexthop() to bgpd_oknexthop()
Simplify the logic and adjust kroute_match() which makes the code
easier to understand.
OK tb@
florian [Sat, 23 Jul 2022 09:33:18 +0000 (09:33 +0000)]
Let the kernel delete the (default) route when we deconfigure the
interface.
This works around a problem where the kernel always deletes
the first default route if there are multiple present
with the same gateway.
This only fixes the problem when running ifconfig inet -autoconf.
There are other cases where we call configure_rotures(RTM_DELETE), for
example when setting ignore routes in dhcpleased.conf and issuing a
reload. To fix that we either need help from the kernel to distinguish
routes by IFP or track priorities and hope they are unique.
Problem reported by mbuhl.
OK claudio
florian [Sat, 23 Jul 2022 09:29:20 +0000 (09:29 +0000)]
Send an IFP to distinguish (default) routes over different interfaces
to the same gateway.
Unfortunately this doesn't help with deleting the correct route when
issuing ifconfig inet -autoconf, the kernel always deletes the first
route. This is the one with the lowest priority if the routes have
different priorities.
What does work is identifying routes by priority but dhcpleased(8)
doesn't set the priority so that the kernel choses the right one
when adding a route and it doesn't yet track the priority the
kernel set.
Another issue is that we might end up with routes having the same
gateway and same priority pointing out of different interfaces. For
example when two ethernet interfaces are set to autoconf and they are
connected to the layer 2 network. This seems like a bad idea but it is
something that could be configured.
Problem reported by mbuhl, claudio suggested to try to send an IFP.
Even though it doesn't work, it seems worthwhile to send the IFP for
when the kernel gains the ability to distinguish routes by IFP.
florian [Sat, 23 Jul 2022 09:00:10 +0000 (09:00 +0000)]
Delete addresses when interface is no longer autoconf.
This brings it in line with dhcpleased(8) as well as what we do for
the default route and DNS proposals.
I missed this when I rewrote the state machine to match
dhcpleased(8).
claudio [Sat, 23 Jul 2022 08:44:06 +0000 (08:44 +0000)]
There is no need to set kf.flags to F_KERNEL here.
From a previous diff that was reverted because of a different issue.
was OK tb@
tb [Sat, 23 Jul 2022 07:13:03 +0000 (07:13 +0000)]
Fix file names in comments.
sdk [Sat, 23 Jul 2022 05:55:16 +0000 (05:55 +0000)]
Discard relative movement packets outside of [-127, 127] range to
prevent cursor jumps when using the trackpoint on some lenovo laptops.
Known affected models:
- Lenovo Thinkpad X13 Gen1
- Lenovo Thinkpad T14(s)
- Lenovo Thinkpad E15 Gen3
- Lenovo A475
With help from stsp@
OK stsp@ miod@ deraadt@ bru@
stsp [Fri, 22 Jul 2022 20:37:56 +0000 (20:37 +0000)]
In tcpdump(8), fix use of wrong index into 802.11 PMKID data when multiple
PMKIDs are present. Same error as found by Mikhail for ciphers and AKMs.
stsp [Fri, 22 Jul 2022 20:31:45 +0000 (20:31 +0000)]
In tcpdump(8), fix printing of multiple 802.11 RSN ciphers and AKMs.
Also, pretty-print SAE (used by WPA3) if found in AKMs.
Errors introduced by me in CVS commit hgtOdzeJfB27Yyq0 / r1.40.
Patch by Mikhail
jmc [Fri, 22 Jul 2022 20:31:39 +0000 (20:31 +0000)]
add missing full stop;
kn [Fri, 22 Jul 2022 20:29:27 +0000 (20:29 +0000)]
Zap nd6_recalc_reachtm_interval indirection
Only used once, so use the macro directly like ND6_SLOWTIMER_INTERVAL
is used in many places.
OK florian
jsing [Fri, 22 Jul 2022 19:54:46 +0000 (19:54 +0000)]
Convert TLS transcript from BUF_MEM to tls_buffer.
ok beck@ tb@
jsing [Fri, 22 Jul 2022 19:34:55 +0000 (19:34 +0000)]
Extend TLS buffer regress to cover read/write usage.
jsing [Fri, 22 Jul 2022 19:33:53 +0000 (19:33 +0000)]
Add read and write support to tls_buffer.
tls_buffer was original created for a specific use case, namely reading in
length prefixed messages. This adds read and write support, along with a
capacity limit, allowing it to be used in additional use cases.
ok beck@ tb@
claudio [Fri, 22 Jul 2022 17:26:58 +0000 (17:26 +0000)]
Revert previous commit. The RTP_MINE checks on struct kroute_full are
not correct because kr_tofull() replaces RTP_MINE with the real priority.
Noticed because of incorrect nexthop selection.
tobhe [Fri, 22 Jul 2022 15:53:33 +0000 (15:53 +0000)]
Include an OpenIKED Vendor ID payload in the initial handshake. This will
make it easier to handle interoperability problems with older versions in
the future. The ID is constructed from the string "OpenIKED-" followed by
the version number.
Sending of the vendor ID payload can be disabled by specifying
"set novendorid" in iked.conf(5).
ok markus@ bluhm@
kn [Fri, 22 Jul 2022 15:34:46 +0000 (15:34 +0000)]
Leftovers from florian's RS/NA purge from the kernel in 2017.
OK bluhm
tobhe [Fri, 22 Jul 2022 15:33:53 +0000 (15:33 +0000)]
Fix potential leak of reply in error case.
From markus@
ok bluhm@
tb [Fri, 22 Jul 2022 14:53:07 +0000 (14:53 +0000)]
Simplify tls13_server_encrypted_extensions_recv
We can rely on tlsext_client_parse() to set the alert, so no need to
do this in the error path.
ok jsing
kn [Fri, 22 Jul 2022 13:27:17 +0000 (13:27 +0000)]
Zap dead store nd6_allocated
There since KAME IPv6 import in 1999.
OK "Pool statistics has this info already." bluhm
kn [Fri, 22 Jul 2022 13:26:00 +0000 (13:26 +0000)]
Call nd6_timer() without argument
nd6_timer_to is a global struct and nd6_timer() accesses it as such,
thereby ignoring its function argument.
Make that clear when setting the timeout, which now goes like the other
two timeouts.
OK bluhem
tb [Fri, 22 Jul 2022 13:10:31 +0000 (13:10 +0000)]
Remove redundant length checks in parse functions
The main parsing function already checks that the entire extension data
was consumed, so the length checks inside some of the parse handlers are
redundant. They were also not done everywhere, so this makes the parse
handlers more consistent.
Similar diff was sent by jsing a long while back
ok jsing
claudio [Fri, 22 Jul 2022 11:17:48 +0000 (11:17 +0000)]
Retire the F_KERNEL flag, it got superseded by route priority and RTP_MINE.
Only problem is when route(8) is used to modify/delete a bgpd owned route.
Exact behaviour for that is still a bit unclear but F_KERNEL does not help
in this case either. In the kr_fib_delete/change remove F_BGPD_INSERTED
in that case as a first step.
OK tb@
jsg [Fri, 22 Jul 2022 09:04:44 +0000 (09:04 +0000)]
fix use after free in debug path
ok jan@ miod@
nicm [Fri, 22 Jul 2022 07:14:07 +0000 (07:14 +0000)]
Clear marks when the search string changes. From Anindya Mukherjee,
GitHub issue 3255.
jsg [Fri, 22 Jul 2022 06:21:51 +0000 (06:21 +0000)]
drm/aperture: Run fbdev removal before internal helpers
From Thomas Zimmermann
31f351eb534e889d11cd149de547d99eb5a15c64 in linux 5.15.y/5.15.56
bf43e4521ff3223a613f3a496991a22a4d78e04b in mainline linux
jsg [Fri, 22 Jul 2022 06:19:59 +0000 (06:19 +0000)]
drm/amd/pm: Prevent divide by zero
From Yefim Barashkin
8c37e7a2000d795aaad7256950f43c25f2aac67f in linux 5.15.y/5.15.56
0638c98c17aa12fe914459c82cd178247e21fb2b in mainline linux
jsg [Fri, 22 Jul 2022 06:18:21 +0000 (06:18 +0000)]
drm/amd/display: Only use depth 36 bpp linebuffers on DCN display engines.
From Mario Kleiner
cded1186f7e930045fb4ee17dbfa6bae41f3882c in linux 5.15.y/5.15.56
add61d3c31de6a4b5e11a2ab96aaf4c873481568 in mainline linux
jsg [Fri, 22 Jul 2022 06:16:07 +0000 (06:16 +0000)]
drm/i915: Require the vm mutex for i915_vma_bind()
From Thomas Hellstrom
a6cecaf058c48c6def2548473d814a2d54cb3667 in linux 5.15.y/5.15.56
c2ea703dcafccf18d7d77d8b68fb08c2d9842b7a in mainline linux
jsg [Fri, 22 Jul 2022 06:13:09 +0000 (06:13 +0000)]
drm/i915/uc: correctly track uc_fw init failure
From Daniele Ceraolo Spurio
60d1bb301ea5a4be3e1071d3d0c179140b270ef8 in linux 5.15.y/5.15.56
35d4efec103e1afde968cfc9305f00f9aceb19cc in mainline linux
jsg [Fri, 22 Jul 2022 06:10:27 +0000 (06:10 +0000)]
drm/i915/gt: Serialize TLB invalidates with GT resets
From Chris Wilson
86062ca5edf1c2acc4de26452a34ba001e9b6a68 in linux 5.15.y/5.15.56
a1c5a7bf79c1faa5633b918b5c0666545e84c4d1 in mainline linux
jsg [Fri, 22 Jul 2022 06:08:40 +0000 (06:08 +0000)]
drm/i915/gt: Serialize GRDOM access between multiple engine resets
From Chris Wilson
0ee5874dad61d2b154a9e3db196fc33e8208ce1b in linux 5.15.y/5.15.56
b24dcf1dc507f69ed3b5c66c2b6a0209ae80d4d4 in mainline linux
jsg [Fri, 22 Jul 2022 06:06:27 +0000 (06:06 +0000)]
drm/i915/dg2: Add Wa_22011100796
From Bruce Chang
f8ba02531476196f44a486df178b4f1fec178234 in linux 5.15.y/5.15.56
154cfae6158141b18d65abb0db679bb51a8294e7 in mainline linux
jsg [Fri, 22 Jul 2022 06:04:44 +0000 (06:04 +0000)]
drm/i915/selftests: fix a couple IS_ERR() vs NULL tests
From Dan Carpenter
40c12fc520234b0145bb776f38642507180dfad8 in linux 5.15.y/5.15.56
896dcabd1f8f613c533d948df17408c41f8929f5 in mainline linux
jsg [Fri, 22 Jul 2022 06:02:46 +0000 (06:02 +0000)]
drm/i915/gvt: IS_ERR() vs NULL bug in intel_gvt_update_reg_whitelist()
From Dan Carpenter
f6e3ced9c60f3cab517cfb748572c26576573715 in linux 5.15.y/5.15.56
e87197fbd137c888fd6c871c72fe7e89445dd015 in mainline linux
jsg [Fri, 22 Jul 2022 06:00:45 +0000 (06:00 +0000)]
drm/i915: fix a possible refcount leak in intel_dp_add_mst_connector()
From Hangyu Hua
505114dda5bbfd07f4ce9a2df5b7d8ef5f2a1218 in linux 5.15.y/5.15.56
85144df9ff4652816448369de76897c57cbb1b93 in mainline linux
jsg [Fri, 22 Jul 2022 05:55:05 +0000 (05:55 +0000)]
avoid use after free
ok deraadt@
deraadt [Thu, 21 Jul 2022 22:45:06 +0000 (22:45 +0000)]
repair error section; Martin Vahlensieck
deraadt [Thu, 21 Jul 2022 21:42:49 +0000 (21:42 +0000)]
sync
kettenis [Thu, 21 Jul 2022 18:24:24 +0000 (18:24 +0000)]
Add support for the new DART variant found on the Apple M2 SoC. Untested,
but hopefully this will encourage someone with the hardware to test a snap.
ok jsg@