LinuxKPI: 802.11: rework MC/configure_filter
(*prepare_multicast)(), for the drivers we support, is iwlwifi(4)-specific.
If it is not available do not let us stop from calling (*configure_filter)()
at least as well.
In addition to the interface setting mc_all_multi, if we have no way to
prepare the multicast filter list this way, set FIF_ALLMULTI for now.
This seems to help some with rtw89 but does not help me with other drivers
yet to get IPv6 link-local (e.g., ff02::1%wlan0) going.
This should also help in case we are scanning and are setting
FIF_BCN_PRBRESP_PROMISC . We should go and review the full FIF_ list and
start adding conditional support for the other options too.
Sponsored by: The FreeBSD Foundation
PR: 281982
MFC after: 3 days
zfs: Merge commit 86b064469dc9c2 from OpenZFS
FreeBSD: Fix a potential null dereference in zfs_freebsd_fsync()
In general it's possible for a vnode to not have an associated VM
object. This happens in particular with named pipes, which have
some distinct VOPs, defined in zfs_fifoops. Thus, this chunk of
zfs_freebsd_fsync() needs to check for the FIFO case, like other
vm_object_mightbedirty() callers do.
(Note that vn_flush_cached_data() calls are predicated on
zn_has_cached_data() returning true, and it checks for a NULL v_object
pointer already.)
Fixes: ef4058fcdc01838117dd93a654228bac7487a37c
Reported-by: Collin Funk <collin.funk1 at gmail.com>
Reviewed-by: Sean Eric Fagan <sef at FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
[4 lines not shown]
login.1: Remove mention of login copyright display
PR: 291649
Fixes: 905571c03119 ("Remove copyright strings printed at login time via login(1) or sshd(8).")
libc/amd64: fix overread conditions in stpncpy()
Due to incorrect unit test design, two overread conditions went
undetected in the amd64 baseline stpncpy() implementation.
For buffers of 1--16 and 32 bytes that do not contain nul bytes
and end exactly at a page boundary, the code would incorrectly
read 16 bytes from the next page, possibly crossing into an
unmapped page and crashing the program. If the next page was
mapped, the code would then proceed with the expected behaviour
of the stpncpy() function.
Three changes were made to fix the bug:
- an off-by-one error is fixed in the code deciding whether to
enter the runt case or not, entering it for 0<n<=32 bytes
instead of 0<n<32 bytes as it was before.
- in the runt case, the logic to skip reading a second 16-byte
chunk if the buffer ends in the first chunk was fixed to
account for buffers that end at a 16-byte boundary but do not
[16 lines not shown]
libc/tests/string: improve stpncpy() "bounds" unit test
The test is extended the same way I previously extended the memccpy()
test to fix what is probably the same kind of bug.
PR: 291359
Reported by: Collin Funk <collin.funk1 at gmail.com>
Reviewed by: ngie
Approved by: markj (mentor)
Fixes: 6fa9e7d8737548ef93c573387ce62402c368d486 (D42519)
See also: 61ed5748e4e9c7397fcb2638b442f46ac5c9e7c5 (D46051)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D54169
lib/libc/tests/string/stpncpy_test.c: apply ngie's fixes
pfsync: Avoid zeroing the state export union
pfsync_state_export() takes a pointer to a union that is in reality a
pointer to one of the three state formats (1301, 1400, 1500), and zeros
the union. The three formats do not have the same size, so zeroing is
wrong when the format isn't that which has the largest size.
Refactor a bit so that the zeroing happens at the layer where we know
which format we're dealing with.
Reported by: CHERI
Reviewed by: kp
MFC after: 1 week
Sponsored by: CHERI Research Centre (EPSRC grant UKRI3001)
Differential Revision: https://reviews.freebsd.org/D54163
netmap: Let memory allocator parameters be settable via loader.conf
This is useful when dev.netmap.port_numa_affinity is set to 1. When
interfaces attach, they get a memory allocator that is copied from
nm_mem. Parameters in nm_mem can be set using sysctls, but this happens
after their values are copied.
To work around this, we can make it possible to set these memory
parameters as tunables.
Reviewed by: vmaffione
MFC after: 1 week
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D54178
rc.subr: Use the variable we defined to invoke setaudit(8)
Reported by: gtetlow
Fixes: 39ee24182b92 ("rc.subr: Support setting the audit user when starting services")
MFC after: 1 week
proc: Fix proc_init / proc_dtor ordering issues
* Move the initialization of p_ktr into proc_init() and make the check
in proc_dtor() unconditional. Prior to this, it was possible to fail
and invoke proc_dtor() after the first thread had been created (which
was the condition for checking p_ktr in proc_dtor()) but before p_ktr
had been initialized.
* Move the p_klist initialization in fork1() past the last possible
failure point so we don't have to free it on failure. We didn't,
which meant we were leaking a knlist every time we failed to fork
due to hitting the resource limit.
PR: 291470
MFC after: 1 week
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D54215
vfs: Let prison_enforce_statfs zero the fsid
Currently, we unconditionally zero the fsid before returning a struct
statfs to a jailed process. Move this into prison_enforce_statfs() so
it only happens if enforce_statfs is greater than 1, or enforce_statfs
is 1 but the mountpoint is outside the jail.
PR: 291301
MFC after: 1 week
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D54214
libsysdecode: Use consistent include path
mkioctls should look at the same set of headers as mktables does.
MFC after: 1 week
Fixes: 139d114acc7b ("libsysdecode use MKTABLES_INCLUDEDIR")
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: sjg
Differential Revision: https://reviews.freebsd.org/D54106
(cherry picked from commit c51876a107310984ba3a31b088caebcfd86a9844)
cleanvar: Fix startup order
Instead of having FILESYSTEMS require cleanvar, which doesn't really
make semantic sense, say that cleanvar needs to run before FILESYSTEMS.
MFC after: 3 days
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D54118
(cherry picked from commit 6ce227d6274869a95150746d2f2d8c8c5ed9a266)
noshutdown: Fix startup order
This rc script exists solely to create a file, so have it explicitly
require FILESYSTEMS. In its current form, it was as likely as not to
end up running before cleanvar, which would undo its work.
MFC after: 3 days
Fixes: 384d976725a5 ("rc.d: Add precious_machine rc.conf knob to create /var/run/noshutdown")
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D54119
(cherry picked from commit e540e8b2c04f03b4210a3bf2f421c05b918d1b51)
nextboot: Reimplement missing -a option
* Reimplement the -a option which was available in the original shell
script and is still documented.
* Print the correct usage string when invoked as nextboot.
* Add the -D option to the manual page synopsis.
MFC after: 1 week
Fixes: fd6d47375a78 ("rescue,nextboot: Install nextboot as a link to reboot, rm nextboot.sh")
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D54120
(cherry picked from commit de670c611b17939712a81dc56f73a3ff84f6c178)
bus: Return 0 if reading an ivar fails
In the non-INVARIANTS case, return 0 rather than stack garbage if
reading an ivar fails (in the INVARIANTS case, we still panic).
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D54078
(cherry picked from commit 4c2295c15860e70c8bd3f05f9229d2fc40dfd50d)
pfctl: report ICMP states consistently for IPv4/IPv6
Remove the '#ifndef INET6', which never actually mattered because this
define is never set. This makes us report ICMP states for IPv4 and IPv6
the same way (and also aligns us with OpenBSD).
This means we will now always report state 0:0 rather than
NO_TRAFFIC:NO_TRAFFIC for icmp6 (like we already did for icmp).
Reported by: Lev Prokofev <lev at netgate.com>
Sponsored by: Rubicon Communications, LLC ("Netgate")
bhyvectl: fix build without BHYVE_SNAPSHOT
Build fails without BHYVE_SNAPSHOT due to undeclared identifier
'checkpoint_file'. Wrap that with a proper #ifdef.
Reported by: dhw