bluhm [Thu, 5 May 2022 09:45:15 +0000 (09:45 +0000)]
Using mutex initializer for static variable does not compile with
witness. Make ratecheck mutex global.
Reported-by: syzbot+9864ba1338526d0e8aca@syzkaller.appspotmail.com
tb [Thu, 5 May 2022 08:51:21 +0000 (08:51 +0000)]
Add hkdf_pkey_meth to the standard_methods[]
ok beck jsing
tb [Thu, 5 May 2022 08:50:35 +0000 (08:50 +0000)]
Link kdf/ to the build
ok beck jsing
tb [Thu, 5 May 2022 08:48:50 +0000 (08:48 +0000)]
Provide EVP_PKEY_HKDF alias for NID_hkdf
ok beck jsing
tb [Thu, 5 May 2022 08:48:05 +0000 (08:48 +0000)]
Provide KDFerr() and KDFerror() macros
ok beck jsing
claudio [Thu, 5 May 2022 08:43:37 +0000 (08:43 +0000)]
No longer consider IN_EXPERIMENTAL aka 240/4 as not forwardable.
We already allow 240/4 in and out so lets allow it through as well.
One of many steps to make 240/4 useable.
Diff by Seth David Schoen (schoen at loyalty.org)
OK bluhm@ djm@
tb [Thu, 5 May 2022 08:42:27 +0000 (08:42 +0000)]
Provide versions of EVP_PKEY_CTX_{str,hex}2ctrl() for internal use.
ok beck jsing
tb [Thu, 5 May 2022 08:24:14 +0000 (08:24 +0000)]
Ditch #defines for tls1_prf and scrypt. Drop unused errors and massage
some const.
ok beck jsing
tb [Thu, 5 May 2022 08:14:14 +0000 (08:14 +0000)]
Translate from OpenSSL's HKDF API to BoringSSL API.
ok beck jsing
tb [Thu, 5 May 2022 08:10:39 +0000 (08:10 +0000)]
Remove function codes from errors, i.e., KDFerr(A, B) -> KDFerror(B)
ok beck jsing
tb [Thu, 5 May 2022 08:07:24 +0000 (08:07 +0000)]
Fix typo in previous.
tb [Thu, 5 May 2022 08:05:58 +0000 (08:05 +0000)]
Inline OPENSSL_memdup() using malloc() + memcpy()
ok beck jsing
tb [Thu, 5 May 2022 08:03:11 +0000 (08:03 +0000)]
Translate OPENSSL_{cleanse,clear_free,free,zalloc}() to libc API.
ok beck jsing
tb [Thu, 5 May 2022 07:57:33 +0000 (07:57 +0000)]
Adjust includes for LibreSSL
ok beck jsing
tb [Thu, 5 May 2022 07:53:30 +0000 (07:53 +0000)]
Use C99 initializres for hkdf_pkey_meth
ok beck jsing
tb [Thu, 5 May 2022 07:50:06 +0000 (07:50 +0000)]
Remove OpenSSL versions of HKDF*().
ok beck jsing
tb [Thu, 5 May 2022 07:48:07 +0000 (07:48 +0000)]
Fix includes of the removed kdferr.h
tb [Thu, 5 May 2022 07:45:57 +0000 (07:45 +0000)]
Add NID for HKDF
ok beck jsing
djm [Thu, 5 May 2022 01:04:14 +0000 (01:04 +0000)]
sshkey_unshield_private() contains a exact duplicate of the code in
private2_check_padding(). Pull private2_check_padding() up so the code
can be reused. From Martin Vahlensieck, ok deraadt@
djm [Thu, 5 May 2022 00:56:58 +0000 (00:56 +0000)]
channel_new no longer frees remote_name. So update the comment
accordingly. As remote_name is not modified, it can be const
as well. From Martin Vahlensieck
djm [Thu, 5 May 2022 00:55:11 +0000 (00:55 +0000)]
mux.c: mark argument as const; from Martin Vahlensieck
dv [Wed, 4 May 2022 23:17:25 +0000 (23:17 +0000)]
vmctl(8)/vmd(8): convert disk sizes from MB to bytes
Continue converting other parts to storing data in bytes instead
of MB. In this case, the logic for disk sizes was being scaled.
This fixes issues reported by Martin Vahlensieck where vmctl could
no longer create disks larger than 7 MiB after previous commits to
change storing memory sizes as bytes.
While this keeps the vm memory limit check in vmctl's size parser,
it skips the limit check for disks. The error messages adjust
accordingly and this removes the double error message logging.
Update comments and function types accordingly.
ok marlkin@
bluhm [Wed, 4 May 2022 21:24:33 +0000 (21:24 +0000)]
Introduce mutex for ratecheck(9) and ppsratecheck(9). A global
mutex with spl high for all function calls is used for now. It
protects the lasttime and curpps parameter. This solution is MP
safe for the usual use case, allows progress, and can be optimized
later. Remove a useless #if 1 while there.
OK claudio@
tb [Wed, 4 May 2022 19:34:26 +0000 (19:34 +0000)]
remove accidentally duplicated line
tb [Wed, 4 May 2022 19:15:52 +0000 (19:15 +0000)]
Whitespace nit (knfmt(1) agrees after inserting an empty line after the
variable declaration)
deraadt [Wed, 4 May 2022 18:57:50 +0000 (18:57 +0000)]
Found two multiple evaluation macros. One of them so long and scary it
too many people to unravel correctly and place into a static function.
While here, move the flags bits into local variables, which reduces
the amount of () in the checks.
help from millert, miod, tedu
tb [Wed, 4 May 2022 18:56:34 +0000 (18:56 +0000)]
KNF according to knfmt(1)
tb [Wed, 4 May 2022 18:49:50 +0000 (18:49 +0000)]
Add RCS tags
tb [Wed, 4 May 2022 18:48:55 +0000 (18:48 +0000)]
Restore copyright years to 2016-2018 as they were before the previous
commit.
tb [Wed, 4 May 2022 18:47:26 +0000 (18:47 +0000)]
Reinstate the licenses that were replaced with license stubs in
OpenSSL commits
d2e9e320186f0917cc940f46bdf1a7e4120da9b0 and
b6cff313cbb1d0381b329fe4f6a8f009cdb270e4
tb [Wed, 4 May 2022 18:37:00 +0000 (18:37 +0000)]
Bump copyright years to 2016-2018 as it was before the previous commit.
tb [Wed, 4 May 2022 18:36:03 +0000 (18:36 +0000)]
Reinstate the license that was replaced with a stub in OpenSSL commit
21dcbebc6e35419f1842f39a125374ea1ba45693
tb [Wed, 4 May 2022 18:27:39 +0000 (18:27 +0000)]
Inline kdferr.h at the end of kdf.h
tb [Wed, 4 May 2022 18:19:17 +0000 (18:19 +0000)]
Rename hkdf.c to hkdf_evp.c to avoid a name clash with hkdf/hkdf.c
tb [Wed, 4 May 2022 18:02:07 +0000 (18:02 +0000)]
Import HKDF code from OpenSSL 1.1.1o
This imports verbatim copies as of the OpenSSL_1_1_1o tag of
crypto/kdf/hkdf.c
crypto/kdf/hkdf_err.c
include/openssl/kdf.h
include/openssl/kdferr.h
from https://www.github.com/openssl/openssl.git into lib/libcrypto/kdf.
We only want the EVP interface to HKDF since some ports need them. Not
yet linked to the build since it will not compile. Follow-on commits will
add KNF, clean up and make this compile.
Tests of an early draft version by abieber and Caspar Schutijser
ok jsing
claudio [Wed, 4 May 2022 16:52:10 +0000 (16:52 +0000)]
Move rttimer callback function from the rttimer itself to rttimer_queue.
All users use the same callback per queue so that makes sense.
Also replace rt_timer_queue_destroy() with rt_timer_queue_flush().
OK bluhm@
bluhm [Wed, 4 May 2022 15:29:58 +0000 (15:29 +0000)]
In ipsp_spd_lookup() rename the parameter tdbp to tdbin as it is
always the incoming TDB that has to be checked.
from markus@
tb [Wed, 4 May 2022 15:21:25 +0000 (15:21 +0000)]
rpki-client: bypass timeout in file mode.
ok claudio
mpi [Wed, 4 May 2022 14:58:26 +0000 (14:58 +0000)]
Merge swap-backed and object-backed inactive page lists.
ok millert@, kettenis@
bluhm [Wed, 4 May 2022 14:47:46 +0000 (14:47 +0000)]
Variable pri is uninitialized, use msg.m_pri instead. This affects
the priority of userland messages with kernel or unspecified facility.
broken in previous commit; fix from markus@
tb [Wed, 4 May 2022 13:07:35 +0000 (13:07 +0000)]
Tweak wording of a comment to reflect current reality better.
jsing [Wed, 4 May 2022 10:57:48 +0000 (10:57 +0000)]
Rewrite asn1_collect() and asn1_find_end() with CBS.
Use more readable variable and arguments names in the process.
ok tb@
jsing [Wed, 4 May 2022 10:53:26 +0000 (10:53 +0000)]
Avoid special handling of definite length before calling asn1_find_end().
The asn1_find_end() function handles definite length ASN.1, which means
that there is no point in the only caller having code to explicitly handle
definite length - it can just call the function.
ok tb@
jsing [Wed, 4 May 2022 10:47:36 +0000 (10:47 +0000)]
Change asn1_check_tag_cbs() out_len from long to size_t.
The long vs size_t checks can be handled in the asn1_check_tag() wrapper
and this will help to avoid propagating long vs size_t issues into new
code.
ok tb@
claudio [Wed, 4 May 2022 10:17:16 +0000 (10:17 +0000)]
Remove extra empty line
jsg [Wed, 4 May 2022 08:11:11 +0000 (08:11 +0000)]
regen
jsg [Wed, 4 May 2022 08:10:43 +0000 (08:10 +0000)]
update Intel ADL-S graphics ids, add ADL-N RPL-S RPL-P
markus [Wed, 4 May 2022 07:31:22 +0000 (07:31 +0000)]
make sure stdout is non-blocking; ok djm@
florian [Wed, 4 May 2022 05:57:18 +0000 (05:57 +0000)]
As found by n18fuhtm AT tutanota.com there are dhcp servers that send a
domain name option with length 1 and a single \0.
We strip trailing \0 and then end up with length 0.
This is a protocol violation, the minimum length for domain name option
is 1, and we ignore the lease.
Since we are not going to get this fixed this server side, we might as
well just pretend that we didn't receive a domain name (or host name).
We only ever care about them in the installer anyway. Not getting a
lease because of this corner case is not helpful.
OK deraadt
jsg [Wed, 4 May 2022 05:25:28 +0000 (05:25 +0000)]
drm/i915/adl-n: Enable ADL-N platform
From Tejas Upadhyay
7e28d0b26759846485978ada860ef4a427e06c8f in mainline linux
jsg [Wed, 4 May 2022 05:20:33 +0000 (05:20 +0000)]
drm/i915/rpl-s: Add PCI IDS for Raptor Lake S
From Anusha Srivatsa
52407c220c44c8dcc6aa8aa35ffc8a2db3c849a9 in mainline linux
jsg [Wed, 4 May 2022 05:17:14 +0000 (05:17 +0000)]
drm/i915/dg1: Add new PCI id
From Jose Roberto de Souza
5f0d4214938db66969a50d4b1262307e39f4f2b2 in mainline linux
jsg [Wed, 4 May 2022 05:14:35 +0000 (05:14 +0000)]
drm/i915/adl_s: Update ADL-S PCI IDs
From Tejas Upadhyay
c79b846f892d64f169d3dba18fd2500a83805e3a in mainline linux
dv [Wed, 4 May 2022 02:24:26 +0000 (02:24 +0000)]
Missed removing some memory scaling in vmm, vmctl.
Continuation of commitid RbITgDkOsW8SMssz removing use of megabytes
instead of bytes in vmm(4) and vmctl(8). Missed this spot that only
manifests after a vm is started and has its runtime details
inspected.
dv [Tue, 3 May 2022 21:39:18 +0000 (21:39 +0000)]
vmm/vmd/vmctl: standardize memory units to bytes
At different points in the vm lifecycle vmm(4), vmctl(8), and vmd(8)
refer to a vm's memory range sizes in either bytes or megabytes.
This is needlessly complex.
Switch to using bytes everywhere and adjust types and constants
accordingly. While this makes it possible to specify vm's with
memory in fractions of megabytes, the logic requiring whole
megabyte values remains.
Feedback from deraadt@, mlarkin@, and Matthew Martin.
ok mlarkin@
bluhm [Tue, 3 May 2022 21:20:35 +0000 (21:20 +0000)]
Rate limit uvn_flush error during pageout messages. They occur
when a memory mapped file cannot be written to disk, e.g. if the
file system is full. Too much printf() during kernel relinking
slows down the system boot.
OK deraadt@
sashan [Tue, 3 May 2022 13:32:47 +0000 (13:32 +0000)]
Make pf(4) more paranoid about IGMP/MLP messages. MLD/IGMP messages
with ttl other than 1 will be discarded. Also MLD messages with
other than link-local source address will be discarded. IGMP
messages with destination address other than multicast class
will be discarded.
feedback and OK bluhm@, cluadio@
ratchov [Tue, 3 May 2022 13:03:30 +0000 (13:03 +0000)]
sioctl_onval(3) returns int not void
Fix from Carlin Bingham <cb at viennan.net>, thanks!
krw [Tue, 3 May 2022 11:48:47 +0000 (11:48 +0000)]
Rework display of partition types, removing unnecessary trailing
blanks in the arrays of type names, simplifying the code and
making better use of printf().
Along the way discover that "APFS Recovery" fits, so nuke the
annoying "AFPS Recovry" contraction.
No intentional functional change.
Some "APFS Recovery" nits pointed out by jsg@
bluhm [Tue, 3 May 2022 11:47:03 +0000 (11:47 +0000)]
Activate parallel IP forwarding. Start 4 softnet tasks. Limit the
usage to the number of CPUs.
lots of testing Hrvoje Popovski; OK sashan@ sthen@
claudio [Tue, 3 May 2022 09:18:11 +0000 (09:18 +0000)]
Retire CRYPTO_F_MPSAFE it is no longer of any use. The crypto framework
no longer uses a callback and so there is no need to define the
callback as MPSAFE.
OK bluhm@
florian [Tue, 3 May 2022 07:42:27 +0000 (07:42 +0000)]
Add FIDO AUTHENTICATOR section and explain a bit how FIDO works. The
wording came mostly from the 8.2 OpenSSH release notes, addapted to
fit the man page.
Then move the -O bits into the new section as is already done for
CERTIFICATES and MODULI GENERATION.
Finally we can explain the trade-offs of resident keys.
While here, consistently refer to the FIDO thingies as "FIDO
authenticators", not "FIDO tokens".
input & OK jmc, naddy
anton [Mon, 2 May 2022 06:30:45 +0000 (06:30 +0000)]
Disable DMA as part of the hardware reset, preventing the device from
ending up in an odd state during netboot in which u-boot (in my case)
hands of the device in a somewhat initialized state.
ok kettenis@
anton [Mon, 2 May 2022 06:30:05 +0000 (06:30 +0000)]
Use the given queue id argument which happen to already be equal to
GENET_DMA_DEFAULT_QUEUE.
ok kettenis@
jmc [Mon, 2 May 2022 05:40:37 +0000 (05:40 +0000)]
remove an obsolete rsa1 format example from an example;
from megan batty
ok djm
deraadt [Sun, 1 May 2022 23:50:48 +0000 (23:50 +0000)]
sync
djm [Sun, 1 May 2022 23:20:30 +0000 (23:20 +0000)]
fix some integer overflows in sieve_large() that show up when trying
to generate modp groups > 16k bits. Reported via GHPR#306 by
Bertram Felgenhauer, but fixed in a different way. feedback/ok tb@
tedu [Sun, 1 May 2022 23:00:04 +0000 (23:00 +0000)]
regen
tedu [Sun, 1 May 2022 22:59:49 +0000 (22:59 +0000)]
no need to test for toupper function in awk
ok cheloha millert miod
bluhm [Sun, 1 May 2022 20:23:11 +0000 (20:23 +0000)]
Install useful btrace scripts into /usr/share/btrace directory.
OK tedu@
schwarze [Sun, 1 May 2022 16:18:59 +0000 (16:18 +0000)]
Split a new function roff_parse_comment() out of roff_expand() because this
functionality is not needed when called from roff_getarg(). This makes the
long and complicated function roff_expand() significantly shorter, and also
simpler in so far as it no longer needs to return ROFF_APPEND.
No functional change intended.
kettenis [Sun, 1 May 2022 11:03:48 +0000 (11:03 +0000)]
Prevent out-of-bounds array access with binaries that use unsupported
relocations.
ok guenther@
mglocker [Sun, 1 May 2022 10:28:54 +0000 (10:28 +0000)]
Check for the correct length field when checking the control transfer data
length. Remove obsolete comment while here.
ok kettenis@
bluhm [Sat, 30 Apr 2022 21:13:57 +0000 (21:13 +0000)]
Run IP input and forwarding with shared netlock. Also distribute
packets from the interface receive rings into multiple net task
queues.
Note that we still have only one softnet task. So there will be
no concurrency yet, but we can notice wrong exclusive lock assertions.
Soon the final step will be to increase the NET_TASKQ define.
lots of testing Hrvoje Popovski; OK sashan@
schwarze [Sat, 30 Apr 2022 18:46:16 +0000 (18:46 +0000)]
Provide a new function roff_req_or_macro() to parse and handle a request
or macro, including context-dependent error handling inside tbl(7) code
and inside .ce/.rj blocks. Use it both in the top level roff(7) parser
and inside conditional blocks.
This fixes an assertion failure triggered by ".if 1 .ce" inside tbl(7)
code, found by tb@ using afl(1).
As a side benefit for readability, only one place remains in the
code that calls the main handler functions for the various roff(7)
requests. This patch also improves column numbers in some error
messages and various comments.
mpi [Sat, 30 Apr 2022 17:58:43 +0000 (17:58 +0000)]
Recheck PG_BUSY after locking the page.
Another thread can set the bit if we sleep during rw_enter(9) in which case
the page shouldn't be touched.
ok semarie@
schwarze [Sat, 30 Apr 2022 15:08:56 +0000 (15:08 +0000)]
Add comments to some of the enum roff_tok values;
particularly useful for values that have non-obvious semantics
like ROFF_MAX, ROFF_cblock, ROFF_RENAMED, and TOKEN_NONE;
no code change.
visa [Sat, 30 Apr 2022 14:44:04 +0000 (14:44 +0000)]
Enforce proper memory ordering in refcnt_rele() and refcnt_finalize()
Make refcnt_rele() and refcnt_finalize() order memory operations so that
preceding loads and stores happen before 1->0 transition. Also ensure
that loads and stores that depend on the transition really begin only
after the transition has occurred. Otherwise the object destructor might
not see the object's latest state.
OK bluhm@
mvs [Sat, 30 Apr 2022 13:28:53 +0000 (13:28 +0000)]
When performing ipsp_ids_free(), grab `ipsec_flows_mtx' mutex(9) before do
`id_refcount' decrement. This should be consistent with `ipsp_ids_gc_list'
list modifications, otherwise concurrent ipsp_ids_insert() could remove
this dying `ids' from the list before if was placed there by
ipsp_ids_free(). This makes atomic operations with `id_refcount' useless.
Also prevent ipsp_ids_lookup() to return dying `ids'.
ok bluhm@
schwarze [Sat, 30 Apr 2022 11:32:39 +0000 (11:32 +0000)]
Refactor the handler function roff_block_sub() for clarity and simplicity.
1. Do not needlessly access the function pointer table roffs[].
Instead, simply call the block closing function directly.
2. Sort code: handle both cases of block closing at the beginning
of the function rather than one at the beginning and one at the end.
3. Trim excessive, partially repetitive and obvious comments, also
making the comments considerably more precise.
No functional change.
ratchov [Sat, 30 Apr 2022 08:47:18 +0000 (08:47 +0000)]
Tweak to clarify sio_stop(3) and sio_flush() description, from jmc@
claudio [Sat, 30 Apr 2022 07:20:35 +0000 (07:20 +0000)]
Convert the 2nd rttimer callback from struct rttimer to u_int rtableid.
The callback only needs to know the rtableid all the other info from
struct rtableid is not needed.
Also change the default rttimer callback to only delete routes that are
RTF_HOST and RTF_DYNAMIC. This way 2 of the ICMP handlers can use NULL
as the callback.
OK bluhm@
tedu [Sat, 30 Apr 2022 01:29:05 +0000 (01:29 +0000)]
add support for printing some extra large numbers to histograms
ok mpi
bluhm [Fri, 29 Apr 2022 18:58:33 +0000 (18:58 +0000)]
Send IP options with maximum length to check for overflow.
bluhm [Fri, 29 Apr 2022 17:27:37 +0000 (17:27 +0000)]
Cleanup makefile so that tests are similar. Link pair to build.
bluhm [Fri, 29 Apr 2022 11:59:10 +0000 (11:59 +0000)]
Link pf_opts to the tree.
jsg [Fri, 29 Apr 2022 11:29:47 +0000 (11:29 +0000)]
sync
espie [Fri, 29 Apr 2022 10:44:05 +0000 (10:44 +0000)]
finally, turn on caching by default
change the defines:
TEST_CACHING -> !NO_CACHING
TEST_CACHING_VERBOSE -> CACHING_VERBOSE
TEST_CACHING_RECHECK -> CACHING_RECHECK
okay with sthen@
mbuhl [Fri, 29 Apr 2022 09:55:43 +0000 (09:55 +0000)]
Release PF und NET lock before calling copyout for DIOCIGETIFACES.
OK sashan@
Reported-by: syzbot+b6afd166e314799e3809@syzkaller.appspotmail.com
bluhm [Fri, 29 Apr 2022 09:45:05 +0000 (09:45 +0000)]
Check that IGMP and ICMP6 MLD packets with router alert option pass.
Other combinations with IP options are still blocked.
ratchov [Fri, 29 Apr 2022 09:12:57 +0000 (09:12 +0000)]
Wait until the buffer is drained before closing the device
Fixes last few samples not being played when very large buffers
are used.
bluhm [Fri, 29 Apr 2022 08:58:49 +0000 (08:58 +0000)]
IGMP and ICMP6 MLD packets always have the router alert option set.
pf blocked IPv4 options and IPv6 option header by default. This
forced users to set allow-opts in pf rules.
Better let multicast work by default. Detect router alerts by
parsing IP options and hop by hop headers. If the packet has only
this option and is a multicast control packet, do not block it due
to bad options.
tested by otto@; OK sashan@
ratchov [Fri, 29 Apr 2022 08:30:48 +0000 (08:30 +0000)]
Add sio_flush(3) function to stop playback immediately
The new sio_flush(3) functions works the same way as sio_stop(3),
except that it doesn't wait for play buffer to be drained. Instead,
it discards its contents and returns immediately.
djm [Fri, 29 Apr 2022 04:55:07 +0000 (04:55 +0000)]
be stricter in which characters will be accepted in specifying a mask
length; allow only 0-9. From khaleesicodes via GHPR#278; ok dtucker@
djm [Fri, 29 Apr 2022 03:24:30 +0000 (03:24 +0000)]
mention that the helpers are used by ssh(1), ssh-agent(1) and
ssh-keygen(1). Previously only ssh(1) was mentioned.
From Pedro Martelletto
dtucker [Fri, 29 Apr 2022 03:16:48 +0000 (03:16 +0000)]
Don't leak SK device. Patch from Pedro Martelletto via github PR#316.
ok djm@
djm [Fri, 29 Apr 2022 03:13:32 +0000 (03:13 +0000)]
fix memleak on session-bind path; from Pedro Martelletto, ok dtucker@
jca [Thu, 28 Apr 2022 22:11:59 +0000 (22:11 +0000)]
Use $(( )) arithmetic expansion instead of `expr something`
No need to use an external tool when the shell can handle this basic task.
dv [Thu, 28 Apr 2022 21:04:24 +0000 (21:04 +0000)]
btrace(8): fix lexer to allow whitespace after filters.
Whitespace is allowed after the closing slash of a filter and before
the opening brace of an action. This makes the lexer scan ahead and
collect any whitespace and newlines into the end of filter token.
ok mpi@
jsing [Thu, 28 Apr 2022 18:36:38 +0000 (18:36 +0000)]
Add tests that decode sequences into ASN.1 strings.
Test decoding of sequences with length and indefinite length into an ASN.1
string - in this case the ASN.1 is not decoded, rather the octets are
stored directly as the content of the string.
This exercises a specific path through the ASN.1 decoder.
(you know asn1complex is living up to its name when you have to import
openssl/asn1t.h directly...)