timeout(1): pass full 32bit error return code from the exited child
Switch to use waitid(2) to receive siginfo_t with the complete error
code from the exited process.
Tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D50752
timeout(1): only start the child command after the parent is fully set up
Since the default disposition for SIGCHLD is ignore, the prematurely
exited child would cause SIGCHLD dropped. This makes timeout(1) hang,
because REAP_STATUS reports a zombie not waited for, but SIGCHLD for it
was already lost, so the main loop cannot exit, instead calling into
sigsuspend().
Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D50752
timeout(1): silence warnings for ESRCH
It is possible for the child to become zombie and then there is nothing
to signal.
Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D50752
exit1(): Ensure that SIGCHLD from reparented child is queued to reaper
We have a reaper R and child A with grandchild B. Now, suppose that B
already have exited, and that A did not waited on B. When A is exiting,
its child B is reparented to R, but its p_ksi was already queued for A.
This means that SIGCHLD is not queued to R, it is only marked as pending
in bitmap.
If other SIGCHLD is queued, we would miss a delivery of the notification
for B exiting. Additionally, R does not see siginfo for B.
Do not even try to send SIGCHLD if the target is zombie. Only update
the ksi state for possible consumption by the reaper.
Tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D50752
kern_sigsuspend: rename wchan
The existing name "pause" is not most intuitive to guess where the
process sleep.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D50752
inpcb: provide policy cr_canexport_ktlskeys() and the privilege PRIV_NETINET_KTLSKEYS
The policy defines the visibility of the ktls session keys to a thread.
Reviewed by: markj
Sponsored by: NVidia networking
Differential revision: https://reviews.freebsd.org/D50653
netinet/in_prot.c: normalize includes
Remove sys/cdefs.h.
Remote opt_inet*.h, they are not used.
Order alphabetically.
Update the herald comment.
Reviewed by: markj
Sponsored by: NVidia networking
Differential revision: https://reviews.freebsd.org/D50653
kern_prot: extract code to check that active ids are superset of obj ids
Export it as a helper cr_xids_subset().
Reviewed by: markj
Sponsored by: NVidia networking
Differential revision: https://reviews.freebsd.org/D50653
net80211: LinuxKPI: migrate HE defines to net80211, put correct values
Migrate most LinuxKPI 802.11 definitions for HE IEs to net80211.
During that process also properly define them as most of them only
had dummy values. Some of the definitions are sparse; that is, only
the bits used by drivers so far were listed and annotated with the
standards section.
There seems to be little point to mangle the names and have two copies
of all these bit field definitions. We can add "_S" (shift/mask)
variants to those we need in net80211 (if we do).
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D50677
ifconfig: 802.11: decode more information elements (IEs)
Start dealing with Element ID Extension present (IE T=255) and start
parsing elemants from the Element ID Extension set.
Namely (partially) decode HE_CAPA, HE_OPER, MU_EDCA_PARAM_SET,
and as well as SUP_OP_CLASS.
For length reasons also rename UNKNOWN_ELEMID_%d to ELEMID_%d.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D50678
net80211: LinuxKPI: migrate HE IE structs from LinuxKPI to net80211
Take the HE IE structures as they are used by drivers and put them
into net80211 rather than LinuxKPI. There is little need to
re-invent the wheel on those. They settled for long enough.
Do not export them by default to user space as some also overlap with
wpa and we still do not have a clear distinction for what is available
only in kernel and what to user space. In our case ifconfig(8)
is a consumer of these structs which it can setting WANT_NET80211 like
we have done for some VHT bits before.
Add struct net80211_he_cap which holds the IE fields but also a bool
and is meant to be put into ic/vap/ni. The bool will give us the same
naming for all layers rather than having individual flags in each part
which was highly confusing. In theory this struct should be in
ieee80211_var.h but that would pull things apart.
Extend struct ieee80211_mu_edca_param_set by a union as it will help
[6 lines not shown]
ifconfig: 802.11: decode RSNXE IE
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D50675
ifconfig: 802.11: print node unicast key (PTK) if available in STA mode
Add a variable when querying the BSSID so we can later use it rather
than losing the "data" buffer.
When printing key information also query the node unicast key if in
STA mode (the key for the BSSID). Do not error in case we fail.
This is helpful for debugging mostly; was also useful when testing
GCMP support.
Sponsored by: The FreeBSD Foundation
MFC after; 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D50554
ifconfig: 802.11: factor out keyix printing
The node unicast key (PTK) uses a key index of (-1) and printing
a 64k number does not look great. Factor out printing the key
number into a buffer and use 'ucast' for the node unicast key.
Hope is that this will be useful for the future as well when we
will have more/different keys possibly.
Looks like (with -vk):
AES-CCM 2:128-bit <xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> rsc 0 tsc 0 rx
AES-CCM 3:128-bit <xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> rsc 0 tsc 0 rx
AES-GCM ucast:128-bit <xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> rsc 0 tsc 0 tx+rx
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D50555
ifconfig: 802.11: also print IEEE80211_CIPHER_AES_GCM_128 information
While we currently do not print the STA unicast key (PTK) we will not
see this but it is for fullness and in preparations for follow-up
hanges.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D50553
pf tests: frag6.py:TestFrag6_RouteTo::test_too_big requires scapy
Mark it as such so we skip rather than fail if scapy is not installed.
Sponsored by: Rubicon Communications, LLC ("Netgate")
pf tests: killstate:key requires scapy
Mark it as such so we skip rather than fail if scapy is not installed.
Sponsored by: Rubicon Communications, LLC ("Netgate")
pf: reorganise fragment reassembly
To avoid packet loss due to reuse of the 16 bit IPv4 fragment id,
we need suitable data structures. Organize the pf fragments with
two red-black trees. One is holding the address and protocol
information and the other has only the fragment id. This will allow
to drop fragemts for specific connections more aggressively.
from markus@; OK sashan@
Obtained from: OpenBSD, bluhm <bluhm at openbsd.org>, 09228e5ff0
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D50723
pf: use time_uptime rather than time_seconds
Use time_uptime as value for when pf was enabled instead of time_second. Since
time_second changes depending on the wall- clock time, time_second is not a
reliable source for the status. We can even end up with a negative time delta.
Thus, use the monotonically growing time_uptime and compute the correct wall
clock time when userspace requests the status.
ok bluhm@ mikeb@
Reviewed by: imp
Obtained from: OpenBSD, patrick <patrick at openbsd.org>, 63b24bda99
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D50722