jail: clean up locking around do_jail_attach
jail_attach_jd passed PD_DEREF to do_jail_attach, assuming it would take
care of freeing the held prison. This is not true, as do_jail_attach
immediately cleared that flag, leaving the jail stock in dying state
when it is later removed.
Reported by: markj
Reviewed by: markj
Differential Revision: <https://reviews.freebsd.org/D57674>
(cherry picked from commit 3584cde63e416d150214192721cead4b735ca0b5)
pflog: create bpf tapping points without ifnet(9)
Just as was done for ipfw's log device stop creating entire struct
ifnet's for pflog devices. Create only a bpf_t.
This does mean we lose the create/destroy infrastructure provided by the
clone interface. Rather than implement this ourselves we allow users to
configure the number of pflog interfaces using the net.pflog.if_count
sysctl. We default to 8 devices, but allow up to 256.
The /etc/rc.d/pflog script will create extra devices as required.
While it was possible to rename pflog devices pfctl expected the pflogX
name, so it's safe to assume users never did this.
Requested by: glebius
Reviewed by: glebius
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D57851
loopback: improve checksum offloading
* Allow disabling IFCAP_RXCSUM_IPV6 or IFCAP_TXCSUM_IPV6.
* Do not pretend the checksum is correct by setting the LO_CSUM_SET
flags if IFCAP_RXCSUM_IPV6 or IFCAP_RXCSUM is enabled. Instead,
remove the LO_CSUM_SET flags (in case they have been set somehow)
if IFCAP_RXCSUM_IPV6 or IFCAP_RXCSUM is disabled.
* Do not unset the transmit checksum offload flags LO_CSUM_FEATURES or
LO_CSUM_FEATURES6 since they now have a meaning for the receive path.
Reviewed by: glebius, pouria, tuexen
Okayed by: bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D57518
virtio_pci_modern: Remove endianness conversion for config space
The bus_* functions already handle converting from PCI endianness
(i.e. little-endian) to native endianness when accessing the config
space (see ofw_pcib_bus_get_bus_tag), so converting again with
virtio_htogX/virtio_gtohX undoes any byte-swapping and breaks
big-endian systems. They should only be used for operating on shared
memory.
Note part of this reverts commit fb53b42e36a9 ("virtio-modern: fix PCI
common read/write functions on big endian targets").
PR: 294706
Reviewed by: adrian, tuexen
Fixes: fb53b42e36a9 ("virtio-modern: fix PCI common read/write functions on big endian targets")
Fixes: 9da9560c4dd3 ("virtio: Add VirtIO PCI modern (V1) support")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D57392
adduser: Normalize supplemental groups
Rather than insist on a space-separated list, normalize the input so
that any number of spaces, commas, colons, or semicolons are accepted.
Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D57774
(cherry picked from commit 65fba082f44cb9451d2b12bcd99c3287d0a47acc)
rc: Improve load_kld
* Centralize the usage message.
* Document and enforce that -e and -m are mutually exclusive; previously,
speficying both would result in only -e being applied.
* If -e was not specified, and -m was not specified or did not match,
fall back to `kldstat -n file` which will always work for modules that
aren't built into the kernel.
This means the kld and ntpd scripts can now rely on load_kld to dtrt.
MFC after: 1 week
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D57706
(cherry picked from commit a95d324dd3107afcbc16767d183acca7a57ebca9)
rc: Fix improper use of load_kld
Fix scripts that needlessly used -e when the simpler -m would work, or
that used -m when the module and file name are the same, or, in one
particularly egregious case, used -m with the wrong name when using
nothing at all would have worked just fine.
MFC after: 1 week
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D57705
(cherry picked from commit cfe1962a19259fea8f51673f4da6c96656776486)
rc: Make devmatch use load_kld
The default behavior of load_kld is now robust enough for devmatch.
Switching means settings from /etc/sysctl.kld.d are now properly applied
when the corresponding modules are loaded by devmatch.
While here, reduce the amount of output produced by devmatch from one
line per module to a single line.
MFC after: 1 week
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D57707
(cherry picked from commit b9f616d031566e94e6967a2c533b8aa7f36123b9)
adduser: Normalize supplemental groups
Rather than insist on a space-separated list, normalize the input so
that any number of spaces, commas, colons, or semicolons are accepted.
Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D57774
(cherry picked from commit 65fba082f44cb9451d2b12bcd99c3287d0a47acc)
rc: Make devmatch use load_kld
The default behavior of load_kld is now robust enough for devmatch.
Switching means settings from /etc/sysctl.kld.d are now properly applied
when the corresponding modules are loaded by devmatch.
While here, reduce the amount of output produced by devmatch from one
line per module to a single line.
MFC after: 1 week
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D57707
(cherry picked from commit b9f616d031566e94e6967a2c533b8aa7f36123b9)
rc: Fix improper use of load_kld
Fix scripts that needlessly used -e when the simpler -m would work, or
that used -m when the module and file name are the same, or, in one
particularly egregious case, used -m with the wrong name when using
nothing at all would have worked just fine.
MFC after: 1 week
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D57705
(cherry picked from commit cfe1962a19259fea8f51673f4da6c96656776486)
rc: Improve load_kld
* Centralize the usage message.
* Document and enforce that -e and -m are mutually exclusive; previously,
speficying both would result in only -e being applied.
* If -e was not specified, and -m was not specified or did not match,
fall back to `kldstat -n file` which will always work for modules that
aren't built into the kernel.
This means the kld and ntpd scripts can now rely on load_kld to dtrt.
MFC after: 1 week
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D57706
(cherry picked from commit a95d324dd3107afcbc16767d183acca7a57ebca9)
tcp.fastopen.client_enable: Fix documented default
The default value has been 1 since June 2018, but the docs were not
updated to reflect the change.
MFC after: 3 days
Reviewed by: ziaee
Fixes: af4da5865557 (Enable TCP_FASTOPEN by default)
Signed-off-by: Matteo Riondato <matteo at FreeBSD.org>
Closes: https://github.com/freebsd/freebsd-src/pull/2285
(cherry picked from commit 0bc852cc62afcd79fc776f784623c3f2b7691d27)
mount_udf.8: Alphabetize and align options
While here, remove "The following UDF specific options are available:".
It is unused and does not appear to have ever been used.
MFC after: 3 days
(cherry picked from commit 05f132adc530cd53203b9cd09d7e1b211d2babc4)
mdoc.7: Revert upstream changes to Lb/LIBRARY
Since this manual describes the mdoc syntax throughout the ecosystem,
I had to blend what we had before with what upstream is doing now.
Thanks: adrian
MFC after: 3 days (we shipped this doc in 15.0/14.4)
Reviewed by: ivy, mhorne, des, adrian
Discussed with: arch@
Differential Revision: https://reviews.freebsd.org/D56153
(cherry picked from commit 4e2bf6e90a65bee317e4dd379e098ba2eb5d8c0d)