ratchov [Thu, 28 Jan 2021 11:10:00 +0000 (11:10 +0000)]
In slot_xxx(), store dev pointer in local variable
This removes many redundant dereferences to obtain the dev pointer
from the slot stucture and makes the source slightly more readable.
No behavior change.
ratchov [Thu, 28 Jan 2021 11:06:58 +0000 (11:06 +0000)]
Use everywhere the same pattern to handle fractional clock ticks
No behavior change; this change is only to make the maths easier to
proofread
ratchov [Thu, 28 Jan 2021 11:06:07 +0000 (11:06 +0000)]
Make slot_{attach,detach}() the opposite of each other
No bahavior change. Now, slot_attach() moves slot's clock forward and
puts the slot on device list; slot_detach() does the opposite: remove
from device list and move clock backwards. This will allow to detach a
client and attach it later in exactly the same state.
ratchov [Thu, 28 Jan 2021 11:02:28 +0000 (11:02 +0000)]
Drop unused dev_nctl() function and few unused prototypes
dlg [Thu, 28 Jan 2021 09:37:20 +0000 (09:37 +0000)]
handle "once" rules before letting pfsync defer tx of a packet.
pfsync may want to defer the transmission of a packet. it does this so
it can try and get a state over to a peer firewall before a host may
send a reply to the peer, which would get dropped cos there's no
matching state.
i think the once rule processing should happen before that. the state
is created from the rule, whether the packet the state is for goes out
immediately or not shouldn't matter.
ok sashan@
florian [Thu, 28 Jan 2021 07:34:34 +0000 (07:34 +0000)]
A new resolver can be created while we currently run a check with the
old configuration. We will then request another check that runs in
parallel to the old check. If the new check finishes earlier, the
current check result will be overwritten by an outdated check result
which is likely wrong.
While here fix some whitespace.
OK phessler
kurt [Thu, 28 Jan 2021 01:48:54 +0000 (01:48 +0000)]
Rename bNumInterface to bNumInterfaces to fix build on arm64.
mortimer [Thu, 28 Jan 2021 01:39:19 +0000 (01:39 +0000)]
Extern dwarf2_loc_mark_labels. Fixes compiation with -fno-common.
ok deraadt@
mortimer [Thu, 28 Jan 2021 01:36:32 +0000 (01:36 +0000)]
Explicitly enable -fcommon, rather than untangle common symbols.
ok deraadt@
mortimer [Thu, 28 Jan 2021 01:20:37 +0000 (01:20 +0000)]
Extern privsep_process. Fixes compilation with -fno-common.
ok deraadt@
mortimer [Thu, 28 Jan 2021 01:18:44 +0000 (01:18 +0000)]
Extern transport_list. Fixed compilation with -fno-common.
ok deraadt@
dlg [Wed, 27 Jan 2021 23:53:35 +0000 (23:53 +0000)]
if the route resolved in pf_route is invalid, generate an icmp error.
of course this is limited to the !dup-to case.
ok sashan@ bluhm@
djm [Wed, 27 Jan 2021 23:49:46 +0000 (23:49 +0000)]
fix leak: was double allocating kex->session_id buffer
sthen [Wed, 27 Jan 2021 22:27:41 +0000 (22:27 +0000)]
update comment, SMALL was split into SMALL and NOSSL
rob [Wed, 27 Jan 2021 22:12:28 +0000 (22:12 +0000)]
Unveil ldapd. Follow recent precedent and elect to forego the unlinking of
some objects at shutdown thereby allowing for a tighter unveil.
Feedbackup from deraadt@ and martijn@.
OK deraadt@
eric [Wed, 27 Jan 2021 20:33:05 +0000 (20:33 +0000)]
remove bogus key hack now that it's handled by libtls
no objection claudio@
ok tb@ jsing@
tb [Wed, 27 Jan 2021 20:16:58 +0000 (20:16 +0000)]
wrap an overlong line
tb [Wed, 27 Jan 2021 18:01:55 +0000 (18:01 +0000)]
sync
tb [Wed, 27 Jan 2021 18:00:25 +0000 (18:00 +0000)]
Link SSL_get_finished.3 to build.
tb [Wed, 27 Jan 2021 17:59:57 +0000 (17:59 +0000)]
Write SSL_get_finished() documentation from scratch.
ok beck
tb [Wed, 27 Jan 2021 17:57:40 +0000 (17:57 +0000)]
Merge SSL_set_hostflags documentation from OpenSSL 1.1.1i and
add HISTORY section. This is currently ignored input next to
SSL_get0_peername() and will be unignored once the symbols are
made publicly visible in libssl.
mglocker [Wed, 27 Jan 2021 17:28:19 +0000 (17:28 +0000)]
The usb configuration descriptor parameter providing the number of
available device interfaces is called 'bNumInterfaces'.
ok phessler@, thfr@ (who provided the man page diff)
millert [Wed, 27 Jan 2021 17:02:50 +0000 (17:02 +0000)]
Promote nrules/maxrules to size_t and make sure they can't overflow.
reallocarray(3) will fail if nmemb * size would overflow.
OK tb@ martijn@
jmc [Wed, 27 Jan 2021 14:59:10 +0000 (14:59 +0000)]
mark up fixes; from lyndon
jmc [Wed, 27 Jan 2021 14:58:06 +0000 (14:58 +0000)]
word fix;
jmc [Wed, 27 Jan 2021 14:57:29 +0000 (14:57 +0000)]
spelling fixes;
jsg [Wed, 27 Jan 2021 10:48:44 +0000 (10:48 +0000)]
regen
jsg [Wed, 27 Jan 2021 10:47:58 +0000 (10:47 +0000)]
add some more amdgpu devices
nicm [Wed, 27 Jan 2021 10:42:52 +0000 (10:42 +0000)]
Flush pending output before entering or exiting alternate screen rather
than leaking it, oss-fuzz issue 29959.
djm [Wed, 27 Jan 2021 10:15:08 +0000 (10:15 +0000)]
this needs kex.h now
djm [Wed, 27 Jan 2021 10:05:28 +0000 (10:05 +0000)]
make ssh->kex->session_id a sshbuf instead of u_char*/size_t and
use that instead of global variables containing copies of it.
feedback/ok markus@
djm [Wed, 27 Jan 2021 09:26:53 +0000 (09:26 +0000)]
remove global variable used to stash compat flags and use the
purpose-built ssh->compat variable instead; feedback/ok markus@
mglocker [Wed, 27 Jan 2021 08:32:46 +0000 (08:32 +0000)]
Be consistent in not using parameter names for function prototypes.
florian [Wed, 27 Jan 2021 08:30:50 +0000 (08:30 +0000)]
Determine available address families (and monitor when this changes)
to configure libunbound accordingly. This way it no longer tries to
talk to IPv6 nameservers when only IPv4 is available and vice versa.
input deraadt
OK kn
dlg [Wed, 27 Jan 2021 07:46:11 +0000 (07:46 +0000)]
do better accounting of how many msix interrupts we want to use.
ok jmatthew@
deraadt [Wed, 27 Jan 2021 07:21:52 +0000 (07:21 +0000)]
these programs (with common ancestry) had a -fno-common problem related
to privsep_procid.
ok mortimer
deraadt [Wed, 27 Jan 2021 07:21:12 +0000 (07:21 +0000)]
split out extern and decl for -fno-common
deraadt [Wed, 27 Jan 2021 07:20:27 +0000 (07:20 +0000)]
makemap does not need a common which it does not use.
deraadt [Wed, 27 Jan 2021 07:19:54 +0000 (07:19 +0000)]
commons used rather than externs, fix for -fno-common
deraadt [Wed, 27 Jan 2021 07:18:41 +0000 (07:18 +0000)]
fix -fno-common issues; ok mortimer
deraadt [Wed, 27 Jan 2021 07:18:16 +0000 (07:18 +0000)]
fix -fno-common issues; ok mortimer
deraadt [Wed, 27 Jan 2021 05:06:12 +0000 (05:06 +0000)]
nsd contains two yacc parsers, but predates "yacc -b". Instead a
script renames the fields in one parser. Three additional variables
(yysslim, yyssp, yystacksize) need to be renamed also.
Yes it is worse than stepping out of bed on the wrong side into cat vomit.
deraadt [Wed, 27 Jan 2021 05:03:23 +0000 (05:03 +0000)]
shuffle externs (and definitions) around to satisfy -fno-common
ok mortimer
dlg [Wed, 27 Jan 2021 04:46:21 +0000 (04:46 +0000)]
have pf_route{,6} clear the pf_pdesc mbuf ref early for route-to/reply-to.
pf_route and pf_route6 are called to take over delivery of the
packet with route-to and reply-to instead of letting it get processed
normally. for the dup-to handling, it copies the mbuf but leaves
the original mbuf in place. pf_route takes over the packet by
clearing the mbuf pointer in the pf_pdesc struct. this diff moves
the clearing of that pointer to the start of the function, rather
than checking for dup-to again on the way out of the function.
i think this is better because it means that it's more robust in
the face of future code changes. even if that's not true, it's still
shorter code in a forwarding path.
ok sashan@ jmatthew@
dlg [Wed, 27 Jan 2021 03:02:06 +0000 (03:02 +0000)]
don't run copies of packets made by dup-to through pf_test.
dup-to is kind of like what you do with a span port, but is a bit
more fine grained. it copies packets in a connection out an interface
so that connection can be monitored. it doesnt make sense for pf
to see the copied packets and try to match or create new states for
them either. at best it needs config to stop pf seeing the copies
(eg, set skip on $dup_to_tgt_if). at worst it breaks the connections
you're monitoring because the states in pf get confused.
found while discussing larger route-to changes on tech@.
ok bluhm@ sashan@
visa [Wed, 27 Jan 2021 02:58:03 +0000 (02:58 +0000)]
kqueue: Fix termination assert
When a kqueue file is closed, the kqueue can still have threads
scanning it. Consequently, kqueue_terminate() can see scan markers
in the event queue. These markers are removed when the scanning threads
leave the kqueue. Take this into account when checking the queue's
state, to avoid a panic when kqueue is closed from under a thread.
OK anton@
Reported-by: syzbot+757c60a2aa1125137cce@syzkaller.appspotmail.com
deraadt [Wed, 27 Jan 2021 01:59:39 +0000 (01:59 +0000)]
satisfy -fno-common by duplicating deck chairs as required
ok mortimer millert
deraadt [Wed, 27 Jan 2021 01:57:37 +0000 (01:57 +0000)]
satisfy -fno-common
similar to the approach used by mortimer
dtucker [Wed, 27 Jan 2021 00:37:26 +0000 (00:37 +0000)]
Logical not bitwise or. ok djm@
tobhe [Tue, 26 Jan 2021 23:06:23 +0000 (23:06 +0000)]
Add support for RSA-PSS PKCS1 signatures. Don't enable them by
default for now because of interoperability issues.
ok patrick@
kettenis [Tue, 26 Jan 2021 23:02:18 +0000 (23:02 +0000)]
Recognize Apple Icestorm cores.
millert [Tue, 26 Jan 2021 20:42:49 +0000 (20:42 +0000)]
Fix build with -fno-common. OK deraadt@
tb [Tue, 26 Jan 2021 18:47:08 +0000 (18:47 +0000)]
Rewrap a comment line to fit into 80 columns.
tb [Tue, 26 Jan 2021 18:45:32 +0000 (18:45 +0000)]
zap a tab
tb [Tue, 26 Jan 2021 18:43:41 +0000 (18:43 +0000)]
Prepare to provide SSL_set_hostflags()
Yet another one of these X509_VERIFY_PARAM reacharounds into
libcrypto. Recently found in imapfilter, also used elsewhere.
Will be made publicly visible with the next minor bump.
ok jsing
deraadt [Tue, 26 Jan 2021 18:25:07 +0000 (18:25 +0000)]
one variable was common, fixing what I can.
(the portable code in here is not in great shape, and I am ignoring it)
deraadt [Tue, 26 Jan 2021 18:23:49 +0000 (18:23 +0000)]
satisfy -fno-common, by (1) copying all the variable decls from
indent_globs.h to indent.c, and (2) changing all the same decls in
indent_globs.h to be extern
ok mortimer
deraadt [Tue, 26 Jan 2021 18:22:45 +0000 (18:22 +0000)]
satisfy -fno-common, by (1) copying all the variable decls from
indent_globs.h to indent.c, and (2) changing all the same decls in
indent_globs.h to be extern
ok mortimer
deraadt [Tue, 26 Jan 2021 18:22:35 +0000 (18:22 +0000)]
sockb variable is unused (and even worse, was common unused)
deraadt [Tue, 26 Jan 2021 18:21:47 +0000 (18:21 +0000)]
satisfy -fno-common, by (1) copying all the variable decls from
indent_globs.h to indent.c, and (2) changing all the same decls in
indent_globs.h to be extern
ok mortimer
deraadt [Tue, 26 Jan 2021 18:21:25 +0000 (18:21 +0000)]
satisfy -fno-common, by (1) copying all the variable decls from
indent_globs.h to indent.c, and (2) changing all the same decls in
indent_globs.h to be extern
ok mortimer
deraadt [Tue, 26 Jan 2021 18:19:43 +0000 (18:19 +0000)]
satisfy -fno-common by repairing one enum decl
ok mortimer
naddy [Tue, 26 Jan 2021 15:40:17 +0000 (15:40 +0000)]
move HostbasedAcceptedAlgorithms to the right place in alphabetical order
jsing [Tue, 26 Jan 2021 14:22:19 +0000 (14:22 +0000)]
Move sequence numbers into the new TLSv1.2 record layer.
This allows for all of the DTLS sequence number save/restore code to be
removed.
ok inoguchi@ "whee!" tb@
eric [Tue, 26 Jan 2021 12:51:22 +0000 (12:51 +0000)]
Move private key setup to a helper function with proper error
checking. Only install the hash on the key if fake key is used,
and do it for EC keys too.
ok tb@ jsing@
florian [Tue, 26 Jan 2021 12:46:46 +0000 (12:46 +0000)]
Some config changes require a restart of all resolvers even DEAD ones;
handle them like UNKNOWN.
Found the hard way by kn.
florian [Tue, 26 Jan 2021 12:27:28 +0000 (12:27 +0000)]
When checking for available address family for AI_ADDRCONFIG consider
the routing domain we are currently in. Otherwise we might end up with
address families that are not available in the current rdomain but in
others since getifaddrs(3) gives us all interface addresses in the
system.
Clue-bat & OK claudio, input & OK eric, OK kn
espie [Tue, 26 Jan 2021 12:13:21 +0000 (12:13 +0000)]
remove test that's now bogus, as fullpkgpath takes precedence.
thanks bluhm@
dtucker [Tue, 26 Jan 2021 11:25:01 +0000 (11:25 +0000)]
Remove unused variables leftover from refactoring. ok djm@
nicm [Tue, 26 Jan 2021 09:32:52 +0000 (09:32 +0000)]
Always resize the original screen before copying when exiting the
alternate screen, GitHub issue 2536.
deraadt [Tue, 26 Jan 2021 08:01:09 +0000 (08:01 +0000)]
intrmap attribute missing from mcx; ok dlg
dtucker [Tue, 26 Jan 2021 05:32:21 +0000 (05:32 +0000)]
Rename HostbasedKeyTypes (ssh) and HostbasedAcceptedKeyTypes (sshd) to
HostbasedAcceptedAlgorithms, which more accurately reflects its effect.
This matches a previous change to PubkeyAcceptedAlgorithms. The previous
names are retained as aliases. ok djm@
djm [Tue, 26 Jan 2021 00:54:49 +0000 (00:54 +0000)]
refactor key constraint parsing in ssh-agent
Key constraints parsing code previously existed in both the "add regular
key" and "add smartcard key" path. This unifies them but also introduces
more consistency checking: duplicated constraints and constraints that
are nonsensical for a particular situation (e.g. FIDO provider for a
smartcard key) are now banned.
ok markus@
djm [Tue, 26 Jan 2021 00:53:31 +0000 (00:53 +0000)]
more ssh-agent refactoring
Allow confirm_key() to accept an additional reason suffix
Factor publickey userauth parsing out into its own function and allow
it to optionally return things it parsed out of the message to its
caller.
feedback/ok markus@
djm [Tue, 26 Jan 2021 00:51:30 +0000 (00:51 +0000)]
make struct hostkeys public; I have no idea why I made it opaque
originally.
ok markus@
djm [Tue, 26 Jan 2021 00:49:30 +0000 (00:49 +0000)]
move check_host_cert() from sshconnect,c to sshkey.c and refactor
it to make it more generally usable and testable.
ok markus@
djm [Tue, 26 Jan 2021 00:47:47 +0000 (00:47 +0000)]
use recallocarray to allocate the agent sockets table; also clear
socket entries that are being marked as unused.
spinkle in some debug2() spam to make it easier to watch an agent
do its thing.
ok markus
djm [Tue, 26 Jan 2021 00:46:17 +0000 (00:46 +0000)]
factor out common code in the agent client
Add a ssh_request_reply_decode() function that sends a message to
the agent, reads and parses a success/failure reply.
Use it for all requests that only expect success/failure
ok markus@
mvs [Mon, 25 Jan 2021 19:47:16 +0000 (19:47 +0000)]
We have this sequence in bridge(4) ioctl(2) path:
ifs = ifunit(req->ifbr_ifsname);
if (ifs == NULL) {
error = ENOENT;
break;
}
if (ifs->if_bridgeidx != ifp->if_index) {
error = ESRCH;
break;
}
bif = bridge_getbif(ifs);
This sequence repeats 8 times. Also we don't check value returned by
bridge_getbig() before use. Newly introduced bridge_getbig() function
replaces this sequence. This not only reduces duplicated code but also
makes `bif' dereference safe.
ok bluhm@
kettenis [Mon, 25 Jan 2021 19:37:17 +0000 (19:37 +0000)]
Give machdep.c a thorough cleanup that is long overdue.
ok patrick@
florian [Mon, 25 Jan 2021 16:57:37 +0000 (16:57 +0000)]
Revert local diff now that we no longer use syslog logging in
libunbound.
OK phessler
florian [Mon, 25 Jan 2021 16:56:59 +0000 (16:56 +0000)]
Disable logging to syslog for libunbound. We are not getting anything
useful for us out of it and it can be quite noisy when we are missing
IPv4 or IPv6 addresses.
It is still available when logging to stderr when running with -d.
OK phessler
mglocker [Mon, 25 Jan 2021 14:14:42 +0000 (14:14 +0000)]
Resolve data toggle out of sync problem for ugen(4) and uhidev(4) devices
on xhci(4) controllers by clearing the interface endpoints before opening
the pipes.
Tested by Mikolaj Kucharski for ugen(4) and gnezdo@ for uhidev(4), plus
myself for both.
ok mpi@
mglocker [Mon, 25 Jan 2021 14:05:57 +0000 (14:05 +0000)]
Add the new function usbd_clear_endpoint_feature() which allows to issue
an UR_CLEAR_FEATURE request on a specific endpoint address without the
need to have a pipe open to that endpoint.
From NetBSD, ok mpi@
sthen [Mon, 25 Jan 2021 14:02:18 +0000 (14:02 +0000)]
php.port.mk sets MODPHP_BUILDDEP=No by default now.
dlg [Mon, 25 Jan 2021 12:27:42 +0000 (12:27 +0000)]
raise the max number of queues/interrupts to 16, up from 1.
jmatthew@ has tried this before, but hrvoje popovski experienced
breakage so it wasn't enabled. we've tightened the code up since
then so it's time to try again.
this diff has been tested by hrvoje popovski and myself
ok jmatthew@
dlg [Mon, 25 Jan 2021 11:11:22 +0000 (11:11 +0000)]
if the rx descriptor reports the rss hash, use it for the mbuf flowid.
ok jmatthew@
dlg [Mon, 25 Jan 2021 09:36:48 +0000 (09:36 +0000)]
don't lose the M_FLOWID flag if the ipv4 cksum is ok.
found while poking around with hrvoje popovski
yes jmatthew@
claudio [Mon, 25 Jan 2021 09:17:33 +0000 (09:17 +0000)]
Adjust code since bgpd added an extra argument to aspath_verify() to
reject AS_SET segments. In bgpctl this is always off.
OK benno@
claudio [Mon, 25 Jan 2021 09:15:23 +0000 (09:15 +0000)]
RFC6472 discourages the use of AS_SET segements in ASPATH attributes.
The main reason is that AS_SET does not play nice with RPKI ROA.
Introduce a per neighbor and global config option
'reject as-set yes' and 'reject as-set no'
If set to yes received UPDATES with AS_SET segements are rejected.
This is done the same way other ASPATH soft-errors are handled. The UPDATE
is marked invalid and all prefixes are treated as withdraws.
`bgpctl show rib in error` can be used to show prefixes that where denied
and treated as withdraws because of errors.
By default this feature is off.
OK benno@
yasuoka [Mon, 25 Jan 2021 09:11:36 +0000 (09:11 +0000)]
Fix wg(4) ioctl to be able to handle multiple wgpeers.
Diff from Yuichiro NAITO.
ok procter
dlg [Mon, 25 Jan 2021 06:55:59 +0000 (06:55 +0000)]
fix filtering on kstat unit numbers
dlg [Mon, 25 Jan 2021 06:16:38 +0000 (06:16 +0000)]
r1.102 forgot to tweak the "redistribute rtlabel" part of the grammar.
fixes "redistribute rtlabel foo" without "depend on".
djm [Mon, 25 Jan 2021 06:00:17 +0000 (06:00 +0000)]
make ssh hostbased authentication send the signature algorithm in
its SSH2_MSG_USERAUTH_REQUEST packets instead of the key type.
This make HostbasedAcceptedAlgorithms do what it is supposed to -
filter on signature algorithm and not key type.
spotted with dtucker@ ok markus@
dlg [Mon, 25 Jan 2021 03:40:46 +0000 (03:40 +0000)]
if stoeplitz is enabled, use it to provide a flowid for tcp packets.
drivers that implement rss and multiple rings depend on the symmetric
toeplitz code, and use it to generate a key that decides with rx
ring a packet lands on. if the toeplitz code is enabled, this diff
has the pcb and tcp layer use the toeplitz code to generate a flowid
for packets they send, which in turn is used to pick a tx ring.
because the nic and the stack use the same key, the tx and rx sides
end up with the same hash/flowid. at the very least this means that
the same rx and tx queue pair on a particular nic are used for both
sides of the connection. as the stack becomes more parallel, it
will also help keep both sides of the tcp connection processing in
the one place.
dlg [Mon, 25 Jan 2021 01:45:55 +0000 (01:45 +0000)]
use an intrmap when establishing interrupts for queues.
mcx is still hardcoded/limited to 1 queue for now, but this lets
different mcx devices use different cpus for handling packets.
looks good jmatthew@
millert [Sun, 24 Jan 2021 20:18:50 +0000 (20:18 +0000)]
Update to tzdata2021a from iana.org. Major changes:
o South Sudan changes from +03 to +02 on 2021-02-01 at 00:00.
tobhe [Sun, 24 Jan 2021 19:10:19 +0000 (19:10 +0000)]
hmac-sha2-384 and hmac-sha2-512 are enabled by default.
florian [Sun, 24 Jan 2021 18:29:15 +0000 (18:29 +0000)]
Implement DNS64 synthesis.
When unwind(8) learns new autoconf resolvers (from dhcp or router
advertisements) it checks if a DNS64 is present in this network
location and tries to recover the IPv6 prefix used according to
RFC7050.
The learned autoconf resolvers are then prevented from upgrading to
the validating state since DNS64 breaks DNSSEC.
unwind(8) can now perform its own synthesis. If a query for a AAAA
record results in no answer we re-send the query for A and if that
leads to an answer we synthesize an AAAA answer using the learned
prefixes.
Testing & OK kn
jsg [Sun, 24 Jan 2021 10:21:43 +0000 (10:21 +0000)]
match on Intel Alder Lake and Meteor Lake I219 Ethernet ids