kettenis [Sat, 1 Jan 2022 11:45:35 +0000 (11:45 +0000)]
Add missing locking to pmap_extract(9) and pmap_unwire(9).
ok patrick@, mpi@
jsg [Sat, 1 Jan 2022 08:10:29 +0000 (08:10 +0000)]
Multiprocol -> Multiprotocol
jsg [Sat, 1 Jan 2022 08:01:27 +0000 (08:01 +0000)]
Identifiier -> Identifier
jsg [Sat, 1 Jan 2022 07:00:57 +0000 (07:00 +0000)]
copyright++;
jsg [Sat, 1 Jan 2022 05:55:06 +0000 (05:55 +0000)]
spelling
djm [Sat, 1 Jan 2022 04:18:06 +0000 (04:18 +0000)]
fix memleak in process_extension(); oss-fuzz issue #42719
jsg [Sat, 1 Jan 2022 03:59:22 +0000 (03:59 +0000)]
eascape -> escape
jsg [Sat, 1 Jan 2022 03:57:20 +0000 (03:57 +0000)]
approciate -> appropriate
jsg [Sat, 1 Jan 2022 02:44:22 +0000 (02:44 +0000)]
failured -> failed
cheloha [Sat, 1 Jan 2022 02:20:38 +0000 (02:20 +0000)]
uniq(1): freopen(3) stdin, stdout
uniq(1) defaults to stdin and stdout, has exactly one input and one
output, and permits the user to replace the default input and/or the
default output with a given file.
freopen(3) is the right idiom in this context. Get rid of file() and
the extra FILE pointers. Switch from fprintf(3) to printf(3).
While here, const the "str" argument to show().
Thread: https://marc.info/?l=openbsd-tech&m=
164078603312936&w=2
ok millert@
jsg [Sat, 1 Jan 2022 02:18:28 +0000 (02:18 +0000)]
contibutions -> contributions
jsg [Sat, 1 Jan 2022 02:06:07 +0000 (02:06 +0000)]
identfier -> identifier
jsg [Sat, 1 Jan 2022 01:55:30 +0000 (01:55 +0000)]
spelling
ok dtucker@
jsg [Fri, 31 Dec 2021 23:19:50 +0000 (23:19 +0000)]
spelling
ok ratchov@
jsg [Fri, 31 Dec 2021 22:40:40 +0000 (22:40 +0000)]
excpetions -> exceptions
jsg [Fri, 31 Dec 2021 22:38:01 +0000 (22:38 +0000)]
deafult -> default
nicm [Fri, 31 Dec 2021 11:35:49 +0000 (11:35 +0000)]
Try to turn on less-capable mouse modes when turning on more-capable, to
increase the chances we get something even if the terminal doesn't support
the one we really want. GitHub issue 3020.
jsg [Fri, 31 Dec 2021 11:24:24 +0000 (11:24 +0000)]
Interrups -> Interrupts
kettenis [Fri, 31 Dec 2021 11:21:45 +0000 (11:21 +0000)]
Add missing locking to pmap_extract(9) and pmap_unwire(9).
ok patrick@, mpi@
jsg [Fri, 31 Dec 2021 10:44:05 +0000 (10:44 +0000)]
avaialble -> available
jsg [Fri, 31 Dec 2021 10:40:30 +0000 (10:40 +0000)]
specifed -> specified
patrick [Fri, 31 Dec 2021 09:24:18 +0000 (09:24 +0000)]
Newer Apple firmware on chipsets without a hardware RNG require the host to
provide a buffer of random bytes to the device on initialization.
jmatthew [Fri, 31 Dec 2021 08:15:47 +0000 (08:15 +0000)]
Fix up handling of IFF_ALLMULTI and call uaq_iff() from uaq_init().
from Brad
dv [Thu, 30 Dec 2021 20:51:34 +0000 (20:51 +0000)]
typo: p5-Socket-SSL -> p5-IO-Socket-SSL
ok kn@
dv [Thu, 30 Dec 2021 20:38:43 +0000 (20:38 +0000)]
relayd(8): don't create sockets between CAs and RELAYs.
CA and RELAY process types don't need to communicate with other CA
or RELAY processes respectively, so don't create and distribute ipc
socketpairs.
Tested by and ok denis@
kevlo [Thu, 30 Dec 2021 15:09:49 +0000 (15:09 +0000)]
Add Xiaomi MiniWif to list of devices supported by mtw(4).
Works for me on amd64.
ok hastings@
anton [Thu, 30 Dec 2021 14:25:39 +0000 (14:25 +0000)]
Use a distinct variable while iterating the list of existing devices.
ok mvs@
Reported-by: syzbot+e2d1df67f742a5a47938@syzkaller.appspotmail.com
Reported-by: syzbot+72298724beda82ec8e7f@syzkaller.appspotmail.com
guenther [Thu, 30 Dec 2021 08:39:19 +0000 (08:39 +0000)]
Sync from libc: Use _MAX_PAGE_SHIFT, rather than #ifdef mips64
ok otto@
ajacoutot [Thu, 30 Dec 2021 08:14:29 +0000 (08:14 +0000)]
Sync rcexec with reality.
claudio [Thu, 30 Dec 2021 08:12:23 +0000 (08:12 +0000)]
Add back support for -B net -b bsd.rd which emulates a PXE install and
results in an autoinstall. This can be used to quickly create new OpenBSD
installs.
OK dv@
anton [Thu, 30 Dec 2021 06:55:37 +0000 (06:55 +0000)]
minor tweak
anton [Thu, 30 Dec 2021 06:55:11 +0000 (06:55 +0000)]
Prevent a double free by assigning the new keymap and corresponding size
after the allocation and initialization is done. Otherwise, a race is
possible if malloc ends up sleeping.
ok sashan@
Reported-by: syzbot+7f8224e9f1a3487caf25@syzkaller.appspotmail.com
guenther [Thu, 30 Dec 2021 04:48:13 +0000 (04:48 +0000)]
Delete dead (duplicate) test
mvs [Thu, 30 Dec 2021 00:49:41 +0000 (00:49 +0000)]
Prevent concurrent access to incomplete or dying `sc' caused by sleep
points in pppacopen() and pppacclose() paths. Use the same "sc_ready"
logic we use for 'pppx_if' structure.
Reported-by: syzbot+a7ac144b48f7f471f689@syzkaller.appspotmail.com
ok anton@ dlg@
jsg [Thu, 30 Dec 2021 00:25:41 +0000 (00:25 +0000)]
combine ifdef blocks
from Ted Bullock
tb [Wed, 29 Dec 2021 23:04:12 +0000 (23:04 +0000)]
Plug memleaks
CID 345150
tb [Wed, 29 Dec 2021 23:02:52 +0000 (23:02 +0000)]
Plug memleak
CID 345156
tb [Wed, 29 Dec 2021 23:02:00 +0000 (23:02 +0000)]
More EVP_* return value checks
CID 345152
tb [Wed, 29 Dec 2021 23:00:32 +0000 (23:00 +0000)]
Remove redundant NULL checks
CID 345154
tb [Wed, 29 Dec 2021 22:58:40 +0000 (22:58 +0000)]
Minor cleanup after EC_POINT_get_affine_coordinates() unified the
_GFp and _GF2m variants.
CID 345155
tb [Wed, 29 Dec 2021 22:56:25 +0000 (22:56 +0000)]
More return value checks for EVP_* API
CID 345159
tb [Wed, 29 Dec 2021 22:54:41 +0000 (22:54 +0000)]
Check return values of EVP_* API
CID 345158
tb [Wed, 29 Dec 2021 22:53:04 +0000 (22:53 +0000)]
knfmt makes this slightly nicer.
tb [Wed, 29 Dec 2021 22:50:30 +0000 (22:50 +0000)]
One more leak of the same kind
tb [Wed, 29 Dec 2021 22:49:23 +0000 (22:49 +0000)]
Plug memleak
CID 345160
tb [Wed, 29 Dec 2021 22:48:09 +0000 (22:48 +0000)]
Set failed in test_random_points()
CID 345141
jmc [Wed, 29 Dec 2021 21:41:28 +0000 (21:41 +0000)]
make the argument name for veb's "child-iface" consistent;
from caspar schutijser
mpi [Wed, 29 Dec 2021 20:22:06 +0000 (20:22 +0000)]
Consistently name page argument `pg'.
Reduce differences with NetBSD, no functional changes.
sdk [Wed, 29 Dec 2021 19:31:01 +0000 (19:31 +0000)]
Add regress tests for grep -A, -B and -C flags
ok otto@
patrick [Wed, 29 Dec 2021 18:48:45 +0000 (18:48 +0000)]
PHYs that we want to talk to over SGMII need to be switched into SGMII
mode for the link to go up. This is relevant on RJ45 SFPs.
ok sthen@
patrick [Wed, 29 Dec 2021 18:44:52 +0000 (18:44 +0000)]
Mention attachment and reference to acpi(4).
patrick [Wed, 29 Dec 2021 18:40:48 +0000 (18:40 +0000)]
Enable ohci(4) and ehci(4) at acpi(4).
patrick [Wed, 29 Dec 2021 18:40:19 +0000 (18:40 +0000)]
Allow ohci(4) and ehci(4) to attach to acpi(4).
ok kettenis@
patrick [Wed, 29 Dec 2021 17:52:22 +0000 (17:52 +0000)]
acpi_intr_disestablish() is available on all our ACPI platforms which
support interrupts via ACPI, so there's need for an ifdef around it.
ok kettenis@
claudio [Wed, 29 Dec 2021 11:37:57 +0000 (11:37 +0000)]
Cleanup struct entity. Remove the unneeded has_data field, the same
information can be figured out by looking at the data pointer itself.
It is NULL when there is no data and not-NULL if there is data.
OK benno@
claudio [Wed, 29 Dec 2021 11:35:23 +0000 (11:35 +0000)]
Merge multiple similar code bits together into repo_done(). Which currently
finds all repos that point to the passed backend and flushes their queues.
Also make sure that REPO_FAILED is set in cases where no sync happened and
also fall back from rrdp to rsync in any case of failure (including errors
merging the rrdp repo itself).
OK tb@
anton [Wed, 29 Dec 2021 07:16:30 +0000 (07:16 +0000)]
Ensure file descriptor send/receive is not allowed.
anton [Wed, 29 Dec 2021 07:15:13 +0000 (07:15 +0000)]
Do not allow send/receive of kcov descriptors as the file descriptor can
be kept alive longer than expected causing syzkaller to no longer being
able to enable remote coverage.
ok visa@
Reported-by: syzbot+ab2016d729cda7b0d003@syzkaller.appspotmail.com
krw [Wed, 29 Dec 2021 00:04:45 +0000 (00:04 +0000)]
Tweak some DEBUG output.
Always put '0x' prefix in front of displayed hex values,
i.e. the checksums.
Add missing letoh32() so bad endian checksum is clear.
Be consistent when displaying 'expected' and 'got' checksums,
i.e. 'expected' == calculated checksum and 'got' == checksum
found in GPT.
mvs [Wed, 29 Dec 2021 00:04:35 +0000 (00:04 +0000)]
Add unp_dispose() threads to 'unsopassgc' test.
krw [Tue, 28 Dec 2021 23:44:02 +0000 (23:44 +0000)]
Tweak some DEBUG output.
'EFI PART' reads better than "TRAP IFE" and
checksums are easier to read/compare when shown
in hex rather than decimal.
Prompted by recent GPT vs disklabel misc@ thread
concerning Rob Whitlock's problematic GPT.
dlg [Tue, 28 Dec 2021 23:13:20 +0000 (23:13 +0000)]
whitespace tweak, no functional change.
dlg [Tue, 28 Dec 2021 23:10:58 +0000 (23:10 +0000)]
it doesnt make sense to configure a vport as a span port.
dlg [Tue, 28 Dec 2021 23:10:30 +0000 (23:10 +0000)]
move away from using the M_PROTO1 flag to prevent loops with vports
if a vlan interface is configured on a vport interface, vlan(4)
will take the packet away from ether_input before the veb bridge
input handler gets to clear M_PROTO1. this leaves the flag on the
mbuf as it goes through the l3 stacks. if it goes back out a vport
into a veb, the presence of M_PROTO1 means the packet ends up getting
dropped, which is unexpected.
this diff specialises vport handling by veb even more to avoid the
problem the flag was handling. vports get their own bridge input
handler that skips veb processing completely because a packet being
received on a vport can only occur if a veb has decided to forward
it there and has already processed it. when the stack sends a packet
out a vport interface, then we do actual veb bridge input handling.
bug reported on misc@ and the fix tested by Simon Baker
tb [Tue, 28 Dec 2021 21:23:40 +0000 (21:23 +0000)]
Fix typo in comment
naddy [Tue, 28 Dec 2021 21:14:24 +0000 (21:14 +0000)]
lld: restore upstream default for --[no-]allow-shlib-undefined
ok patrick@ kettenis@
naddy [Tue, 28 Dec 2021 21:13:20 +0000 (21:13 +0000)]
lld: do not report undefined weak references in shared libraries
https://github.com/llvm/llvm-project/commit/
52bfd2c1ccd86ff813ee6df5a6700690acdd912f
This fixes an issue introduced in
D101996.
A weak reference in a shared library could be incorrectly reported if
there is another library that has a strong reference to the same symbol.
Differential Revision: https://reviews.llvm.org/
D115041
ok patrick@ kettenis@
tb [Tue, 28 Dec 2021 21:06:01 +0000 (21:06 +0000)]
Use lowercase letters for hexadecimal constants, as both jsing and I
prefer this.
tb [Tue, 28 Dec 2021 21:00:27 +0000 (21:00 +0000)]
Rewrite X509v3_addr_canonize() with new accessors
This is again a straightforward conversion and leads to something which
matches our usual style more.
ok jsing
tb [Tue, 28 Dec 2021 20:58:05 +0000 (20:58 +0000)]
Validate AFIs before sorting in X509v3_adr_canonize()
Again, we're dealing with necessarily not fully validated data here,
so a check up front seems prudent.
ok jsing
tb [Tue, 28 Dec 2021 20:50:37 +0000 (20:50 +0000)]
Rewrite/simplify X509v3_addr_is_canonical()
This is a more or less straightforward conversion using the new
IPAddressFamily accessor API. As a result, some checks have become
a bit stricter, which is only desirable here.
ok jsing
tb [Tue, 28 Dec 2021 20:44:56 +0000 (20:44 +0000)]
Check AFI/SAFI before comparing them in X509v3_addr_is_canonical()
As mentioned in a previous commit, IPAddressFamily_cmp() can't really
check for trailing garbage in addressFamily->data. Since the path
validation and hence the X.509 validator call X509v3_addr_is_canonical(),
this deals with only partially validated data.
ok jsing
tb [Tue, 28 Dec 2021 20:07:17 +0000 (20:07 +0000)]
Make IPAddressFamily_cmp() more pleasing on the eye
Define and use MINIMUM() instead of a ternary operator and separate
the code from the declarations. Also, we can spare a line to make the
return legible instead of squeezing it into another ternary operator.
addressFamily->data contains a two-bytes AFI and an optional one-byte
SAFI. This function currently also compares any trailing garbage that
may be present. Since comparison functions can't really error, this
needs to be checked bofore it is used. Such checks will be added in
subsequent commits.
ok jsing
tb [Tue, 28 Dec 2021 19:59:33 +0000 (19:59 +0000)]
Style improvements in X509v3_addr_add_range()
ok jsing
tb [Tue, 28 Dec 2021 19:56:45 +0000 (19:56 +0000)]
Style improvements in X509v3_addr_add_prefix()
ok jsing
anton [Tue, 28 Dec 2021 17:50:10 +0000 (17:50 +0000)]
The initial kd_lookup() in kcovopen() is redundant as kcov is a cloning
device. Turn it into an assertion instead to better state the expected
semantics of D_CLONE.
Prompted after a discussion with visa@
tb [Tue, 28 Dec 2021 17:45:41 +0000 (17:45 +0000)]
Another small readability tweak in X509v3_addr_inherits()
Declare IPAddressFamily before using it.
tb [Tue, 28 Dec 2021 17:25:46 +0000 (17:25 +0000)]
Use an accessor in X509v3_addr_inherits()
tb [Tue, 28 Dec 2021 16:40:13 +0000 (16:40 +0000)]
Add a comment to i2r_IPAddrBlocks that we may want/have to deal with
unknown address family types.
Pointed out by jsing during review.
tb [Tue, 28 Dec 2021 16:37:37 +0000 (16:37 +0000)]
Add a few accessors for IPAddressFamily and make first use of them
One reason why this file is hard to read are endless repetitions of
checks and assignments reaching deep inside structs. This can be made
much more readable by adding a bunch of accessors. As a first step,
we deal with IPAddressFamily, where we want to check the type of the
ipAddressChoice member, check whether the inheritance element is present
or access the addressOrRanges field.
This diff already makes minimal use of these accessors to appease -Werror.
More use and additional accessors will follow in later passes.
ok inoguchi jsing
otto [Tue, 28 Dec 2021 16:29:59 +0000 (16:29 +0000)]
Now that -A prints -- markers as it is supposed to filter them out when
doing the consistency check for locore.o; ok millert@
otto [Tue, 28 Dec 2021 16:27:53 +0000 (16:27 +0000)]
Fix printing of -- marker when using -A as noted by gnezdo@
ok millert@
tb [Tue, 28 Dec 2021 16:26:53 +0000 (16:26 +0000)]
Simplify and explain expand_addr() a bit
RFC 3779 section 2.1.2 does a decent job of explaining how IP addresses
are encoded in. What's stored amounts to a prefix with all trailing zero
octets omitted. If there are trailing zero bits in the last non-zero octet,
bs->flags & 7 indicates how many. addr_expand() expands this to an address
of length 4 or 16 depending on whether we deal with IPv4 or IPv6.
Since an address can be the lower or the upper bound of a prefix or
address range, expansion needs to be able to zero-fill or one-fill the
unused bits/octets. No other expansion is ever used, so simplify the
meaning of fill accordingly. There's no need to special case the case
that there are no unused bits, the masking/filling is a noop.
ok jsing
tb [Tue, 28 Dec 2021 16:21:59 +0000 (16:21 +0000)]
Add a comment so I don't forget to think about input validation
in make_IPAddressFamily()
tb [Tue, 28 Dec 2021 16:10:47 +0000 (16:10 +0000)]
Convert make_IPAddressFamily to CBS/CBB
The IPAddrBlocks type, which represents the IPAddrBlocks extension,
should have exactly one IPAddressFamily per AFI+SAFI combination to
be delegated. make_IPAddressFamily() first builds up a search key
from the afi and safi arguments and then looks for an existing
IPAddressFamily with that key in the IPAddrBlocks that was passed
in. It returns that if it finds it or allocates and adds a new one.
This diff preserves the current behavior that the afi and *safi
arguments are truncated to 2 and 1 bytes, respectively. This may
change in the future.
ok inoguchi jsing
tb [Tue, 28 Dec 2021 16:05:23 +0000 (16:05 +0000)]
Remove two pointless NULL checks and allocations
The ASN.1 template for IPAddressFamily doesn't mark either of its two
members as optional, so they are allocated by IPAddressFamily_new().
ok inoguchi jsing
tb [Tue, 28 Dec 2021 15:59:13 +0000 (15:59 +0000)]
Check for trailing garbage in X509_addr_get_afi()
Per RFC 3779 2.2.3.3, the addressFamily field contains the 2-byte AFI
and an optional 1-byte SAFI. Nothing else. The optional SAFI is nowhere
exposed in the API. It is used expliclty only for pretty printing. There
are implicit uses in a few places, notably for sorting/comparing where
trailing garbage would be erroneously taken into account.
Erroring in this situation will let us avoid this in upcoming revisions.
ok inoguchi jsing
tb [Tue, 28 Dec 2021 15:49:11 +0000 (15:49 +0000)]
Convert X509v3_adr_get_afi() to CBS
The manual byte bashing is performed more safely using this API
which would have avoided the out-of-bounds read that this API had
until a few years back.
The API is somewhat strange in that it uses the reserved AFI 0 as an
in-band error but it doesn't care about the reserved AFI 65535.
ok inoguchi jsing
patrick [Tue, 28 Dec 2021 15:45:17 +0000 (15:45 +0000)]
Compile out-of-line helpers for atomic operations which can be enabled
through -moutline-atomics. These are included by default in this updated
version of compiler-rt, we just haven't enabled them yet. Some ports start
to make use of that option, so it makes sense to provide these helpers.
The helpers would make use of the ARMv8.1 LSE instructions, if we flagged
that the running system supports those. As we do not yet have a mechanism
to show support for LSE, the code will always fall back to regular atomics.
Issue raised by jca@
Tested by phessler@
Input from jsg@
ok kettenis@
mpi [Tue, 28 Dec 2021 13:16:28 +0000 (13:16 +0000)]
Unlock bottom part of the fault handler.
Tested by many during the past months, thanks!
ok sthen@
claudio [Tue, 28 Dec 2021 11:59:48 +0000 (11:59 +0000)]
In io_write_buf() adjust the calculation of the multiplex message size
so that the loop works even for buffers bigger than 0xffffff. The code
does not produce such big buffers but better make the code correct.
Reported by Blago Dachev (blago (at) dachev (dot) com)
OK benno@
patrick [Mon, 27 Dec 2021 17:56:03 +0000 (17:56 +0000)]
Not only BCM4378, but all PCIe core revisions >= 64 need to be accessed
using the new sets of registers.
patrick [Mon, 27 Dec 2021 17:32:14 +0000 (17:32 +0000)]
Map the chip ids used on Apple M1 Pro/Max and Apple T2 Macs to firmware
names.
patrick [Mon, 27 Dec 2021 17:12:34 +0000 (17:12 +0000)]
Support reading OTP information from a few more chips, necessary to learn
firmare names on Apple M1 Pro/Max and Apple T2 Macs.
visa [Mon, 27 Dec 2021 16:38:06 +0000 (16:38 +0000)]
Reduce sensitivity to TCP segmentation in urgent data test case
Use one-byte sequences before and after urgent data so that the
socket-tcp test would be less sensitive to TCP segmentation.
visa [Mon, 27 Dec 2021 16:20:20 +0000 (16:20 +0000)]
Disable poll/select iocond regress
Some of the tests are unreliable because of inadequate synchronization
in the test code.
anton [Mon, 27 Dec 2021 15:38:25 +0000 (15:38 +0000)]
Yet another errno correction.
florian [Mon, 27 Dec 2021 15:18:51 +0000 (15:18 +0000)]
knf
jsing [Mon, 27 Dec 2021 15:12:22 +0000 (15:12 +0000)]
Pull BN_{new,init,clear,clear_free,free} up to the top of bn_lib.c
Discussed with tb@
jsing [Mon, 27 Dec 2021 14:50:57 +0000 (14:50 +0000)]
Provide a set of RSA and ECDSA test certificates/keys.
These are generated using the make-certs.sh script.