openbsd
3 years agoSupport storing syscall arguments in a map/hist.
mpi [Tue, 31 Aug 2021 11:30:21 +0000 (11:30 +0000)]
Support storing syscall arguments in a map/hist.

3 years agowhitespace
tb [Tue, 31 Aug 2021 11:19:19 +0000 (11:19 +0000)]
whitespace

3 years agoAdjust rde_decide test vectors to the fact that struct prefix got changed.
claudio [Tue, 31 Aug 2021 10:54:40 +0000 (10:54 +0000)]
Adjust rde_decide test vectors to the fact that struct prefix got changed.
Reminded by bluhm@ that bgpd regress tests failed

3 years agoenter uuid/
jasper [Tue, 31 Aug 2021 09:58:17 +0000 (09:58 +0000)]
enter uuid/

3 years agoadd initial tests for uuid_from_string, uuid_to_string, uuid_create_nil
jasper [Tue, 31 Aug 2021 09:57:27 +0000 (09:57 +0000)]
add initial tests for uuid_from_string, uuid_to_string, uuid_create_nil

prompted by the bug krw@ fixed yesterday in uuid_from_string()

3 years agoshorten some code
deraadt [Tue, 31 Aug 2021 09:56:12 +0000 (09:56 +0000)]
shorten some code

3 years agoSpacing. OK tb@
claudio [Tue, 31 Aug 2021 09:51:25 +0000 (09:51 +0000)]
Spacing. OK tb@

3 years agoTest for operator precedence
mpi [Tue, 31 Aug 2021 08:39:46 +0000 (08:39 +0000)]
Test for operator precedence

3 years agoRewrite grammar to implement operator precedence without using %right or %prec.
mpi [Tue, 31 Aug 2021 08:39:26 +0000 (08:39 +0000)]
Rewrite grammar to implement operator precedence without using %right or %prec.

Arithmetic operator should now behave as expeted and tests can now be written
without superfluous parenthesis, for example:

syscall:select:entry
/($1 == 0) || (pid == $1)/
{
}

Can now be written:

syscall:select:entry
/$1 == 0 || pid == $1/
{
}

While here improve filter debugging support.

3 years agoremove empty forward structs fro bge_ring_data as found with ctfconv.
jasper [Tue, 31 Aug 2021 08:06:56 +0000 (08:06 +0000)]
remove empty forward structs fro bge_ring_data as found with ctfconv.

tested by and ok jmatthew@

3 years agoSpecify path to PuTTY keys. Portable needs this and it makes no
dtucker [Tue, 31 Aug 2021 07:13:59 +0000 (07:13 +0000)]
Specify path to PuTTY keys.  Portable needs this and it makes no
difference on OpenBSD, so resync them.

3 years agoWhen running PuTTY interop tests and using a PuTTY version older than
dtucker [Tue, 31 Aug 2021 06:13:23 +0000 (06:13 +0000)]
When running PuTTY interop tests and using a PuTTY version older than
0.76, re-enable the ssh-rsa host key algorithm (the 256 and 512 variants
of RSA were added some time between 0.73 and 0.76).

3 years agoadd support for obtaining sense status and source slot of a media
robert [Tue, 31 Aug 2021 05:29:55 +0000 (05:29 +0000)]
add support for obtaining sense status and source slot of a media

this fixes a bug in bacula where the catalog was not properly kept
up-to-date if a tape was in a drive becuse its source slot was
unknown

based on code from FreeBSD; ok krw@

picker 0:  sense: <0x00/0x00> voltag: <:0> avoltag: <:0> source: <>
slot 0: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1168L1:0> avoltag: <:0> source: <slot 0>
slot 1: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1187L1:0> avoltag: <:0> source: <slot 1>
slot 2: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1184L1:0> avoltag: <:0> source: <slot 2>
slot 3: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1195L1:0> avoltag: <:0> source: <slot 3>
slot 4: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1037L1:0> avoltag: <:0> source: <slot 4>
slot 5: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1038L1:0> avoltag: <:0> source: <slot 5>
slot 6: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1166L1:0> avoltag: <:0> source: <slot 6>
slot 7: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1167L1:0> avoltag: <:0> source: <slot 7>
slot 8: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1180L1:0> avoltag: <:0> source: <slot 8>
slot 9: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1186L1:0> avoltag: <:0> source: <slot 9>
slot 10: <ACCESS> sense: <0x00/0x00> voltag: <:0> avoltag: <:0> source: <picker 0>
slot 11: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1182L1:0> avoltag: <:0> source: <slot 11>
slot 12: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1181L1:0> avoltag: <:0> source: <slot 12>
slot 13: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1196L1:0> avoltag: <:0> source: <slot 13>
slot 14: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1169L1:0> avoltag: <:0> source: <slot 14>
slot 15: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1197L1:0> avoltag: <:0> source: <slot 15>
slot 16: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1165L1:0> avoltag: <:0> source: <slot 16>
slot 17: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1199L1:0> avoltag: <:0> source: <slot 17>
slot 18: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1189L1:0> avoltag: <:0> source: <slot 18>
slot 19: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1185L1:0> avoltag: <:0> source: <slot 19>
slot 20: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1198L1:0> avoltag: <:0> source: <slot 20>
slot 21: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1039L1:0> avoltag: <:0> source: <slot 21>
slot 22: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1035L1:0> avoltag: <:0> source: <slot 22>
slot 23: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1188L1:0> avoltag: <:0> source: <slot 23>
drive 0: <ACCESS,FULL> sense: <0x00/0x00> voltag: <XX1183L1:0> avoltag: <:0> source: <slot 10>

3 years agoIn enumerating mode, calculate the bit offset using the HID input
anton [Tue, 31 Aug 2021 05:17:49 +0000 (05:17 +0000)]
In enumerating mode, calculate the bit offset using the HID input
location as the product of the corresponding Report Count and Report
Size can be greater than one.

Fixes Richard Toohey's <richardjtoohey at gmail dot com> Dell keyboard.

3 years agoProtect against missing bit to key symbols in ucc_bit_to_sym(). This can
anton [Tue, 31 Aug 2021 05:16:45 +0000 (05:16 +0000)]
Protect against missing bit to key symbols in ucc_bit_to_sym(). This can
only happen if ucc_hid_parse() has a bug, better play it safe.

3 years agosprinkle barriers and dmamem_syncs around the hibernate io path.
dlg [Tue, 31 Aug 2021 04:21:04 +0000 (04:21 +0000)]
sprinkle barriers and dmamem_syncs around the hibernate io path.

at the very least it stops the compiler omgoptimising away important
code.

tested by and ok deraadt@ jmatthew@

3 years agorevert change to use single rockchip U-Boot image in rev 1.13
jsg [Tue, 31 Aug 2021 01:54:12 +0000 (01:54 +0000)]
revert change to use single rockchip U-Boot image in rev 1.13
abieber@ reports it fails to boot on pinebook-pro-rk3399

3 years agoSpecify hostkeyalgorithms in sshd's default set for the SSHFP test,
dtucker [Tue, 31 Aug 2021 01:25:27 +0000 (01:25 +0000)]
Specify hostkeyalgorithms in sshd's default set for the SSHFP test,
from djm@.  Make the reason for when the test is skipped a bit clearer.

3 years agoMake uuid_from_string() reject a string of the correct length but having a
krw [Mon, 30 Aug 2021 20:41:33 +0000 (20:41 +0000)]
Make uuid_from_string() reject a string of the correct length but having a
non-hex digit in the last character.

Inspired by code in uuid_parse() from Ted Ts'o.

ok millert@

3 years agoDocument new include*/exclude* options in the man page
job [Mon, 30 Aug 2021 20:25:24 +0000 (20:25 +0000)]
Document new include*/exclude* options in the man page

3 years agoAdd include/exclude to usage()
job [Mon, 30 Aug 2021 20:25:01 +0000 (20:25 +0000)]
Add include/exclude to usage()

OK claudio@

3 years agoClean up and simplify info and msg callbacks.
jsing [Mon, 30 Aug 2021 19:25:43 +0000 (19:25 +0000)]
Clean up and simplify info and msg callbacks.

The info and msg callbacks result in duplication - both for code that
refers to the function pointers and for the call sites. Avoid this by
providing typedefs for the function pointers and pulling the calling
sequences into their own functions.

ok inoguchi@ tb@

3 years agoAccept dns proposals for the loopback addresses
kn [Mon, 30 Aug 2021 19:14:30 +0000 (19:14 +0000)]
Accept dns proposals for the loopback addresses

Don't reserve^Wignore them for unwind(8);  there are non-unwind use-cases
and so far resolvd(8) always seems to do the right thing when proposing
localhost while unwind is running.

OK benno

3 years agoReplace DTLS r_epoch with the read epoch from the TLSv1.2 record layer.
jsing [Mon, 30 Aug 2021 19:12:25 +0000 (19:12 +0000)]
Replace DTLS r_epoch with the read epoch from the TLSv1.2 record layer.

ok inoguchi@ tb@

3 years agoMove to an AEAD nonce allocated in the TLSv1.2 record layer.
jsing [Mon, 30 Aug 2021 19:00:49 +0000 (19:00 +0000)]
Move to an AEAD nonce allocated in the TLSv1.2 record layer.

There is little to gain by mallocing and freeing the AEAD nonce for each
record - move to an AEAD nonce allocated for the record layer, which
matches what we do for TLSv1.3.

ok inoguchi@ tb@

3 years agoFix max nameserver proposals limit
kn [Mon, 30 Aug 2021 18:49:19 +0000 (18:49 +0000)]
Fix max nameserver proposals limit

Count the total number of proposals and not five per address family each.
Don't print ignored addresses by default anymore and leave that to `-v'.

OK benno

3 years agoRemove magic offset from data structures. This makes it much easier to
kettenis [Mon, 30 Aug 2021 18:40:19 +0000 (18:40 +0000)]
Remove magic offset from data structures.  This makes it much easier to
compare the data structures with the Linux code which unfortunately is
the only documentation we have for the pin numbers used by ACPI.
While there make the data structures const.

ok jcs@

3 years agosync with OpenSSL 1.1.1, which is still under a free license;
schwarze [Mon, 30 Aug 2021 18:18:16 +0000 (18:18 +0000)]
sync with OpenSSL 1.1.1, which is still under a free license;
in particular, this includes new text by Matt Caswell
from OpenSSL commit 721eb8f6 Nov 28 12:03:00 2019 +0000
and corrects a wrong argument type that i introduced into the SYNOPSIS;
requested by tb@

3 years agoRemove tests that are now covered by regress/lib/libssl/verify
tb [Mon, 30 Aug 2021 17:50:05 +0000 (17:50 +0000)]
Remove tests that are now covered by regress/lib/libssl/verify

3 years agohook verify regress test to build
tb [Mon, 30 Aug 2021 17:34:32 +0000 (17:34 +0000)]
hook verify regress test to build

3 years agoRevert accidental commit
tb [Mon, 30 Aug 2021 17:34:01 +0000 (17:34 +0000)]
Revert accidental commit

3 years agolink verify regress tests to build
tb [Mon, 30 Aug 2021 17:28:46 +0000 (17:28 +0000)]
link verify regress tests to build

3 years agoReimplement part of the openssl/x509 regress tests in C
tb [Mon, 30 Aug 2021 17:27:45 +0000 (17:27 +0000)]
Reimplement part of the openssl/x509 regress tests in C

Instead of using s_client and s_server and complicated shell scripts,
we can reuse the framework from the ssl_get_shared_cipher() regress
test and inspect the verify return value directly.

Discussed with beck jan jsing

3 years agoDocument that %n has been neutered -- it now does syslog+abort.
deraadt [Mon, 30 Aug 2021 17:07:47 +0000 (17:07 +0000)]
Document that %n has been neutered -- it now does syslog+abort.
ok ingo

3 years agoFix a locking assertion in error path.
mpi [Mon, 30 Aug 2021 16:59:17 +0000 (16:59 +0000)]
Fix a locking assertion in error path.

In amap_copy() make the new amap share the source amap's lock right in
the begining and only allocate a new one if no anon have been referenced.

Issue reported by Thomas L. <tom.longshine at web dot de> on bugs@.

ok tb@

3 years agoImprove dubgging in /etc/netstart. Enable print only in ifcreate.
bluhm [Mon, 30 Aug 2021 16:58:52 +0000 (16:58 +0000)]
Improve dubgging in /etc/netstart.  Enable print only in ifcreate.
Add debugging output for ipv6 routes.  Make localhost and multicast
code aware of the print only switch.  Allow netstart -n to work
also if no interface is given.
OK kn@

3 years agoIgnore warning alert returns from servername callback in TLSv1.3
tb [Mon, 30 Aug 2021 16:50:23 +0000 (16:50 +0000)]
Ignore warning alert returns from servername callback in TLSv1.3

If a servername callback returns SSL_TLSEXT_ERR_ALERT_WARNING, this
results in a fatal error in TLSv1.3 since alert levels are implicit
in the alert type and neither close_notify nor user_canceled make
sense in this context. OpenSSL chose to ignore this, so we need to
follow suit.

Found via a broken servername callback in p5-IO-Socket-SSL which
returns a Boolean instead of SSL_TLSEXT_ERR_*. This happened to
have worked before TLSv1.3 since warning alerts are often ignored.

This "fixes" sni.t and sni-verify.t in p5-IO-Socket-SSL.

ok beck jsing

3 years agoProperly account entity_queue when the file has already been seen
job [Mon, 30 Aug 2021 16:05:55 +0000 (16:05 +0000)]
Properly account entity_queue when the file has already been seen

Thanks to Ben Maddison for helping create a test case

OK claudio@

3 years agoClarify how dns proposals are replaced not added per interface
kn [Mon, 30 Aug 2021 15:46:07 +0000 (15:46 +0000)]
Clarify how dns proposals are replaced not added per interface

OK benno

3 years agoremove a bunch of forward-only structs that were found with ctfconv.
jasper [Mon, 30 Aug 2021 14:44:39 +0000 (14:44 +0000)]
remove a bunch of forward-only structs that were found with ctfconv.

ok mpi@

3 years agoRemove unused files
job [Mon, 30 Aug 2021 12:44:02 +0000 (12:44 +0000)]
Remove unused files

OK deraadt@

3 years agoClean up end of do_body in openssl(1) ca
inoguchi [Mon, 30 Aug 2021 12:25:54 +0000 (12:25 +0000)]
Clean up end of do_body in openssl(1) ca

suggested from tb@

3 years agoRemove NULL check before free in openssl(1) ca
inoguchi [Mon, 30 Aug 2021 12:12:11 +0000 (12:12 +0000)]
Remove NULL check before free in openssl(1) ca

ok tb@

3 years agoImplement '<' and '>' operators in filters.
mpi [Mon, 30 Aug 2021 11:57:45 +0000 (11:57 +0000)]
Implement '<' and '>' operators in filters.

Based on a diff from and ok dv@

3 years agojca and I converted %n to a syslog warning about a year ago, and the ports
deraadt [Mon, 30 Aug 2021 11:16:49 +0000 (11:16 +0000)]
jca and I converted %n to a syslog warning about a year ago, and the ports
ecosystem experienced a very good cleanup.  Time has arrived to switch (as
planned) to syslog + abort, which will result in a coredump thus identifying
the remaining culprits in a more visible fashion.
vfprintf(3) and vfwprintf(3) man pages still require documentation changes.
with jca

3 years agoINADDR_LOOPBACK check needs htonl(3) to work
kn [Mon, 30 Aug 2021 11:09:58 +0000 (11:09 +0000)]
INADDR_LOOPBACK check needs htonl(3) to work

Found in resolvd(8) which uses the same code.

3 years agoINADDR_LOOPBACK check needs htonl(3) to work
kn [Mon, 30 Aug 2021 11:04:50 +0000 (11:04 +0000)]
INADDR_LOOPBACK check needs htonl(3) to work

3 years agoincrease hibernate writeout speed a little. modern machines have vast
deraadt [Mon, 30 Aug 2021 09:45:29 +0000 (09:45 +0000)]
increase hibernate writeout speed a little.  modern machines have vast
tracts of unused memory, and the empty-space RLE scanner (uvm_page_rle)
would rescan for empty space needlessly wasting excessive cpu time
16G machine, 100sec -> 9sec
40G machine, 325sec -> 28sec
with kettenis mlarkin

3 years agoTest for the pathetic case that the 2nd unveil in
claudio [Mon, 30 Aug 2021 09:09:21 +0000 (09:09 +0000)]
Test for the pathetic case that the 2nd unveil in
    unveil(NULL, NULL); if (fork() == 0) unveil("/", "rwx")
fails with EPERM.

3 years agoAdmit that we return error 20 in the failure case here. Changing
beck [Mon, 30 Aug 2021 09:06:04 +0000 (09:06 +0000)]
Admit that we return error 20 in the failure case here. Changing
our verifier to return 21 results in other regress failures in
ruby and perl.

3 years agoMake sure unveil remains locked over fork even in the case where the
claudio [Mon, 30 Aug 2021 09:05:44 +0000 (09:05 +0000)]
Make sure unveil remains locked over fork even in the case where the
parent just called unveil(NULL, NULL) and nothing else.
With and OK beck@

3 years agoRevert previous change that changed our default return for unable to
beck [Mon, 30 Aug 2021 08:59:33 +0000 (08:59 +0000)]
Revert previous change that changed our default return for unable to
find leaf cert issuers.  This breaks perl and ruby regress, as noticed
by tb that "we tried this before".

Jan's regress that cares about 21 vs 20 needs to change
ok tb@

3 years agoRemove typedef of db_addr_t; mpi converted the users of it to vaddr_t already
jasper [Mon, 30 Aug 2021 08:11:12 +0000 (08:11 +0000)]
Remove typedef of db_addr_t; mpi converted the users of it to vaddr_t already
back in 2019.

ok mpi@

3 years agoCheck that fchdir() works. The problem in unveil was fixed some time ago.
claudio [Mon, 30 Aug 2021 08:07:22 +0000 (08:07 +0000)]
Check that fchdir() works. The problem in unveil was fixed some time ago.

3 years agoMake lines not wrap on 80 char terminals. Code gets more readable.
claudio [Mon, 30 Aug 2021 08:06:02 +0000 (08:06 +0000)]
Make lines not wrap on 80 char terminals. Code gets more readable.

3 years agoFix Jan's regress in openssl/x509 to do what it says it does,
beck [Mon, 30 Aug 2021 06:51:36 +0000 (06:51 +0000)]
Fix Jan's regress in openssl/x509 to do what it says it does,
then fix the only thing it still has complaints about which
is that we don't return the leaf version of the error code
when we can't verify the leaf (as opposed to the rest of the chain)

ok jan@ tb@

3 years agoadapt to RSA/SHA1 deprectation
djm [Mon, 30 Aug 2021 01:15:45 +0000 (01:15 +0000)]
adapt to RSA/SHA1 deprectation

3 years agoAfter years of forewarning, disable the RSA/SHA-1 signature algorithm
djm [Sun, 29 Aug 2021 23:53:10 +0000 (23:53 +0000)]
After years of forewarning, disable the RSA/SHA-1 signature algorithm
by default. It is feasible to create colliding SHA1 hashes, so we
need to deprecate its use.

RSA/SHA-256/512 remains available and will be transparently selected
instead of RSA/SHA1 for most SSH servers released in the last five+
years. There is no need to regenerate RSA keys.

The use of RSA/SHA1 can be re-enabled by adding "ssh-rsa" to the
PubkeyAcceptedAlgorithms directives on the client and server.

ok dtucker deraadt

3 years agowrap at 80 columns
djm [Sun, 29 Aug 2021 23:44:07 +0000 (23:44 +0000)]
wrap at 80 columns

3 years agoRevert: llvm: openbsd driver had one -lcompiler_rt too many
gnezdo [Sun, 29 Aug 2021 21:32:52 +0000 (21:32 +0000)]
Revert: llvm: openbsd driver had one -lcompiler_rt too many

Suggested by jca@ that kettenis@ looks at it first.

3 years agoLee "Scratch" Perry died :(
sthen [Sun, 29 Aug 2021 21:10:31 +0000 (21:10 +0000)]
Lee "Scratch" Perry died :(

3 years agollvm: openbsd driver had one -lcompiler_rt too many
gnezdo [Sun, 29 Aug 2021 21:05:15 +0000 (21:05 +0000)]
llvm: openbsd driver had one -lcompiler_rt too many

Tested by doing a full system build locally. Will work with brad@ for
upstream-ing.

OK patrick & mortimer

3 years agoiwm/iwx: propagate errors out of iw{m,x}_set_bits_mask_prph routines
gnezdo [Sun, 29 Aug 2021 20:31:18 +0000 (20:31 +0000)]
iwm/iwx: propagate errors out of iw{m,x}_set_bits_mask_prph routines

This might help with troubleshooting "iwx0: acquiring device failed"
errors.

OK stsp@

3 years agoDo not call X509_alias_get0(3) with NULL as the second argument.
schwarze [Sun, 29 Aug 2021 19:56:40 +0000 (19:56 +0000)]
Do not call X509_alias_get0(3) with NULL as the second argument.
Even if the buffer is guaranteed to be NUL-terminated in a particular
case, it is still setting a bad example.  Besides, it is unclear
to me whether there is any such guarantee in the case at hand.
Checking that would require auditing all of d2i_X509_bio(3),
ASN1_item_d2i_bio(&NETSCAPE_X509_it, ...), PEM_read_bio_X509_AUX(3),
and PKCS12_parse(3), since no such guarantee is documented for any
of these functions, and even then it would remain fragile with
respect to later changes of implementation details.

In the worst case, this could potentially result in a read buffer
overrun.

OK tb@ on an earlier version of this patch.

While we are here, deraadt@ requested to not use the word "string" in the
name of a variable that is not a string in the sense of the C language.

3 years agonameserver command requires an interface argument
kn [Sun, 29 Aug 2021 19:55:12 +0000 (19:55 +0000)]
nameserver command requires an interface argument

3 years agoPass volume related key presses as both raw and translating input to
anton [Sun, 29 Aug 2021 19:00:59 +0000 (19:00 +0000)]
Pass volume related key presses as both raw and translating input to
wskbd in order to make them visible in X11. Matches what ukbd(4) already
does.

3 years agofix an obvious mixup regarding the order of lines in the SYNOPSIS,
schwarze [Sun, 29 Aug 2021 19:00:20 +0000 (19:00 +0000)]
fix an obvious mixup regarding the order of lines in the SYNOPSIS,
and an omission below HISTORY

3 years agocorrect range upper bound in comment
anton [Sun, 29 Aug 2021 18:31:08 +0000 (18:31 +0000)]
correct range upper bound in comment

3 years agoMake the ucc match criteria more stringent by requiring at least one
anton [Sun, 29 Aug 2021 18:21:16 +0000 (18:21 +0000)]
Make the ucc match criteria more stringent by requiring at least one
usage greater than zero. Usage zero is defined as unassigned by the
specification and cannot be mapped to anything sensible.

Prevents ucc from attaching to bunch of odd report IDs from a Lenovo
ThinkPad USB-C Dock which only exposes the unassigned usage.  This is
not a problem in practice but I think we're better attaching them as
uhid devices instead as ucc cannot provide any functionality.

Thanks to Mario Peter <mp at mpeter dot de> for reporting and testing.

3 years agoSome reports embeds multiple report IDs inside the same collection
anton [Sun, 29 Aug 2021 18:20:18 +0000 (18:20 +0000)]
Some reports embeds multiple report IDs inside the same collection
causing ucc to only being able to attach to the last report ID. This in
turn is caused by hid_is_collection() only being able to observe an end
of collection item with the last report ID for the same collection.

Instead, change the matching of ucc to only consider report IDs with at
least one corresponding Consumer Control usage.

Fixes gnezdo@'s Google Pixel earbuds.

3 years agoAn interrupt report contains the state of all items (Input, Output and
anton [Sun, 29 Aug 2021 18:19:09 +0000 (18:19 +0000)]
An interrupt report contains the state of all items (Input, Output and
Feature) from the corresponding descriptor report for a given report ID.
The ordering of the items is identical in both the descriptor and
interrupt report. As the interrupt report can cover more than Consumer
Control related key presses, ucc must be more careful while examining
the interrupt report in order to not confuse other items as key presses.

While parsing the descriptor report, take note of the bits that
represents Consumer Control key presses and use it to slice the
interrupt report.

Thanks to florian@ gnezdo@ and Alessandro De Laurenzis <just22 at
atlantide dot mooo dot com> for testing.

3 years agoAs the Consumer Control usages are well defined by the HID Usage Tables
anton [Sun, 29 Aug 2021 18:17:51 +0000 (18:17 +0000)]
As the Consumer Control usages are well defined by the HID Usage Tables
specification ucc might as well enumerate all of them. Finding an
appropriate scan code recognized by X11 for each usage is more tricky.
I've added a few more but the majority are still unmapped. Linux has
defined a couple of more usages covered by the evdev[1] key codes but
those symbols are not picked up in an vanilla X11 configuration on
OpenBSD, according to setxkbmap(1).

This should at least lower the barrier for adding scan codes for wanted
keys.

Note that the strings are discarded unless UCC_DEBUG is enabled.

Thanks to gnezdo@ for testing.

[1] xenocara/dist/xkeyboard-config/keycodes/evdev

3 years agoMask viornd descriptor value to prevent out of bound reads.
dv [Sun, 29 Aug 2021 18:01:32 +0000 (18:01 +0000)]
Mask viornd descriptor value to prevent out of bound reads.

viornd did not mask the descriptor value in the avialable ring
allowing guest values to read past the end of the descriptor table.

While here, change fatal to fatalx because errno is not set.

Reported by Ilja van Sprundel

ok mlarkin@

3 years agoNuke unused variable and unnecessary initialization.
krw [Sun, 29 Aug 2021 17:29:14 +0000 (17:29 +0000)]
Nuke unused variable and unnecessary initialization.

3 years agoDon't call the verify callback twice on success.
beck [Sun, 29 Aug 2021 17:13:15 +0000 (17:13 +0000)]
Don't call the verify callback twice on success.
This fixes a problem in the perl regress where it notices the
callback is called twice and complains.

ok tb@ bluhm@

3 years agosync
deraadt [Sun, 29 Aug 2021 16:40:26 +0000 (16:40 +0000)]
sync

3 years agoPass the -quiet option to openssl s_server to make it ignore EOF.
tb [Sun, 29 Aug 2021 15:52:47 +0000 (15:52 +0000)]
Pass the -quiet option to openssl s_server to make it ignore EOF.
This makes some tests run from the Makefile behave as they should.

3 years agoThis needs extern.h for the rmatch prototype
claudio [Sun, 29 Aug 2021 15:37:58 +0000 (15:37 +0000)]
This needs extern.h for the rmatch prototype

3 years agonotify the user about a successful password change; ok millert@
robert [Sun, 29 Aug 2021 15:22:24 +0000 (15:22 +0000)]
notify the user about a successful password change; ok millert@

3 years agolibagentx regress relied on snmp(1) defaulting to -v2c -cpublic. Make this
martijn [Sun, 29 Aug 2021 15:15:45 +0000 (15:15 +0000)]
libagentx regress relied on snmp(1) defaulting to -v2c -cpublic. Make this
explicit.

Pointed out and OK bluhm@

3 years agoImplement --exclude/exclude-file and --include/include-file.
claudio [Sun, 29 Aug 2021 13:43:46 +0000 (13:43 +0000)]
Implement --exclude/exclude-file and --include/include-file.
Currently only simple include and excludes work, the advanced filters
introduced later in rsync are not implemented. It is unclear if the per
directory filters are something we want to implement. This requires
more modern protocols which openrsync is not able to handle right now.

This adds a special matching function to allow the ** matching which behaves
mostly like rsyncs version with the exception of how bad [] patterns are
expanded. For bad patterns openrsync follows more how fnmatch behaves and
not the somewhat strange rsync behaviour.

Not perfect but committing now so people can test and provide feedback.

3 years agoMerge sysupgrade watchdog and prompt timeout code
kn [Sun, 29 Aug 2021 13:31:52 +0000 (13:31 +0000)]
Merge sysupgrade watchdog and prompt timeout code

Provide TIMOUT_{ACTION,PERIOD_SEC} in {start,stop,reset}_timeout() to have
install.sub and dot.profile use the same mnemonic helpers.

3 years agoAdd ober_dup. Needed for upcoming SNMPv3 support for trap receiver in
martijn [Sun, 29 Aug 2021 13:27:11 +0000 (13:27 +0000)]
Add ober_dup. Needed for upcoming SNMPv3 support for trap receiver in
snmpd(8).

OK jmatthew@
OK deraadt@ for bumping libutil now.

3 years agoAdd back the echo Q thing.
tb [Sun, 29 Aug 2021 13:17:42 +0000 (13:17 +0000)]
Add back the echo Q thing.

3 years agoSync prompt timeout code with sysupgrade watchdog
kn [Sun, 29 Aug 2021 13:16:22 +0000 (13:16 +0000)]
Sync prompt timeout code with sysupgrade watchdog

Simplify code and employ the same technique in both places.
The "prompt timeout" hits when on non-interactive installations or upgrades:

Welcome to the OpenBSD/amd64 6.9 installation program.
Starting non-interactive mode in 5 seconds...
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell?
Performing non-interactive upgrade...

The existing code uses a regular background job and does quirky file
descriptor fiddling just to avoid job control messages when starting the
timeout in the background.

It also does `set +m' a second time for no reason and hardodes the number of
seconds in multiple places.

Do better by using a co-process just like sysupgrade's watchdog that reboots
when the upgrade did not finish in time.

reads good to aja

3 years agoStart naccept .desc with a capital
tb [Sun, 29 Aug 2021 13:16:17 +0000 (13:16 +0000)]
Start naccept .desc with a capital

noted by inoguchi

3 years agoStop parsing unsupported dhcp-options(5)
kn [Sun, 29 Aug 2021 13:05:43 +0000 (13:05 +0000)]
Stop parsing unsupported dhcp-options(5)

dhcpleased(8) does not support everything dhclient(8) did,
so stop pretending.

OK florian

3 years agoUse s_server -naccept 1 and remove echo "Q" | openssl s_client hack.
tb [Sun, 29 Aug 2021 12:40:37 +0000 (12:40 +0000)]
Use s_server -naccept 1 and remove echo "Q" | openssl s_client hack.

3 years agoImplement -naccept in the s_server.
tb [Sun, 29 Aug 2021 12:33:15 +0000 (12:33 +0000)]
Implement -naccept in the s_server.

doc fixes/ok jmc
ok beck

3 years agomask next descriptor value and fix chunk_size calculation
dv [Sun, 29 Aug 2021 12:17:38 +0000 (12:17 +0000)]
mask next descriptor value and fix chunk_size calculation

Guest can cause out of bounds read with a malformed descriptor. In same
loop, also fix a chunk size calculation.

Reported by Ilja van Sprundel.

ok mlarkin@

3 years agoReduce the number of openings for aplns(4) to 1. This isn't correct but
kettenis [Sun, 29 Aug 2021 12:02:52 +0000 (12:02 +0000)]
Reduce the number of openings for aplns(4) to 1.  This isn't correct but
make NVMe on the Apple M1 stable.  Hopefully we can figure out the real
issue in the future.

ok jmatthew@

3 years agocheck for null vioblk info
dv [Sun, 29 Aug 2021 11:41:27 +0000 (11:41 +0000)]
check for null vioblk info

If {c,m}alloc fail, info could be NULL and result in NULL deref.

Reported by Ilja van Sprundel.

ok mlarkin@

3 years agoReduce the number of openings for aplns(4) to 1. This isn't correct but
kettenis [Sun, 29 Aug 2021 11:23:29 +0000 (11:23 +0000)]
Reduce the number of openings for aplns(4) to 1.  This isn't correct but
make NVMe on the Apple M1 stable.  Hopefully we can figure out the real
issue in the future.

ok jmatthew@

3 years agocorrect device status write size
dv [Sun, 29 Aug 2021 11:14:27 +0000 (11:14 +0000)]
correct device status write size

Reported by Ilja van Sprundel.

ok mlarkin@

3 years agoremove old descriptor dump function
dv [Sun, 29 Aug 2021 11:09:05 +0000 (11:09 +0000)]
remove old descriptor dump function

Used originally to aid dev. Unneeded.

ok mlarkin@

3 years agonew installboot will sometimes reuse the existing msdos boot partition instead
deraadt [Sun, 29 Aug 2021 09:10:57 +0000 (09:10 +0000)]
new installboot will sometimes reuse the existing msdos boot partition instead
of running newfs_msdos, so fsck_msdos gets run behind the scenes.  A few
architectures were missing this binary on their install media
jsg notices two more arch need it also, due to crazy Makefile games in installboot

3 years agonew installboot will sometimes reuse the existing msdos boot partition instead
deraadt [Sun, 29 Aug 2021 09:05:21 +0000 (09:05 +0000)]
new installboot will sometimes reuse the existing msdos boot partition instead
of running newfs_msdos, so fsck_msdos gets run behind the scenes.  A few
architectures were missing this binary on their install media
noticed by sthen

3 years ago-w default is now 3;
jmc [Sun, 29 Aug 2021 06:50:29 +0000 (06:50 +0000)]
-w default is now 3;

3 years ago/bin/ps: Implement reporting of supplemental groups
chrisz [Sat, 28 Aug 2021 20:54:54 +0000 (20:54 +0000)]
/bin/ps: Implement reporting of supplemental groups

with help from sthen@ and tim@. OK tim@

3 years agowhitespace nit
sthen [Sat, 28 Aug 2021 19:59:49 +0000 (19:59 +0000)]
whitespace nit