igmp: Avoid leaving dangling pointers in the state-change queue
When igmp_v3_merge_state_changes() is iterating over state-change
packets, there is a case where it'll free a queued packet but will fail
to remove it from the queue. Fix that.
Reported by: Yuxiang Yang, Yizhou Zhao, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM5.1 from Z.ai
Reviewed by: pouria, glebius
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D56947
(cherry picked from commit beab4a237a45aea809e81802b9e1e9ff30f3d929)
if_vxlan: Update *m0 after a pullup
vxlan_input()'s caller is supposed to free *m0 if it is non-NULL after
the function returns. vxlan_input() failed to update *m0 after the
pullup however, so if it hits an error case after the pullup, we'll free
the mbuf twice. Currently this can happen only if the interface is
brought down or due to a packet loop.
Reported by: Yuxiang Yang, Yizhou Zhao, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM5.1 from Z.ai
Reviewed by: pouria, zlei
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D56944
(cherry picked from commit a6c4fe2d1a38885914b1c3e85508b965ccdb7874)
tests/timerfd: Serialize
At least one of these tests changes the system clock, which potentially
interferes with concurrently running tests and causes them to fail.
MFC after: 1 week
(cherry picked from commit 001cfc7b8aa38122c4e0fe8ae48fae3556a1f2b6)
routing: Use a better error number in sysctl_fibs()
ENOTCAPABLE is for capsicum and its use here is inappropriate. In
particular, note that syscallret() treats this value specially.
Reviewed by: glebius, pouria, zlei
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D56481
(cherry picked from commit 8de0fc10a1c2d65bdb39eff862266ab1f87902c8)
tests/if_lagg: Minor improvements
- Set require.kmods instead of relying on ifconfig to load if_lagg.ko,
as this doesn't work when running within a jail.
- Simplify helper functions which create tap and lagg devices.
MFC after: 1 week
(cherry picked from commit 47ae0135d461854b72b905ac77bf3e1f5b2868bc)
tests/socket_afinet: Fix the bind_connected_port test
The test verifies that a socket can bind to a local address assigned by
connect(2) to a different socket. It was however trying to bind to the
wrong address, and the check of the result was inverted, so this went
unnoticed. It also needs to set SO_REUSEADDR for this to succeed.
Reported by: glebius
MFC after: 1 week
(cherry picked from commit d3d0466cae546254c50c80cf3e0c060bbbbba53c)
tests/posixshm: Check for hardware support in largepage_pkru
MFC after: 3 days
Fixes: ca87c0b8e396 ("pkru: Fix handling of 1GB largepage mappings")
(cherry picked from commit 75c66218401c00f4728d5312e2b933b8d3aefde1)
netbsd-tests: Fix the mmap_truncate_signal test
Add a volatile qualifier in the loop which triggers SIGBUS, as otherwise
the compiler is smart enough to elide it, replacing it with a check for
page != 0.
MFC after: 1 week
(cherry picked from commit e3b8e55e710bf355f371d798aa943281007a7ea9)
routing: Initialize V_rt_numfibs earlier during boot
V_rt_numfibs can be set at compile time (with the ROUTETABLES kernel
config option) or boot time (with the net.fibs tunable).
vnet_rtables_init(), running during SI_PROTO_DOMAIN, was checking the
tunable and updating V_rt_numfibs accordingly, but that means that
earlier SYSINITs, such as vnet_mroute_init(), see the compile-time value
for V_rt_numfibs before it gets corrected in vnet_rtables_init().
Fix this by initializing V_rt_numfibs earlier, so that SYSINITs are less
likely to use the wrong value.
Add a comment describing the weird, preexisting semantic of resetting
rt_numfibs to 1 in VNET jails.
PR: 294510
Reviewed by: glebius, zlei, pouria
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D56473
[2 lines not shown]
net: bandaid for plugging a fw_com leak in fwip_detach()
Adding a temporary workaround for plugging a fw_com upon if_fwip unloading.
Steps to reproduce(needs two hosts connected with firewire):
while true; do
ifconfig fwip0 10.0.0.5 up
fwcontrol -r
ping -c 10.0.0.3
kldunload if_fwip
done
There's a chance that the unloading of if_fwip.ko triggers following warning:
Warning: memory type fw_com leaked memory on destroy (1 allocations, 64 bytes leaked).
commit d79b6b8ec267e7eef6e07cf4245159705e24acd5 (origin/main, origin/HEAD)
(cherry picked from commit 25a5bb7318052322190a2880e0e7ef18e06d54bd)
tests/if_carp: Run all tests with execenv=jail
Otherwise failures can occur when running tests in parallel since some
tests reuse jail names.
MFC after: 1 week
libufs: Avoid using param.h constants in libufs.h
MAXBSIZE is defined in param.h, which defines many other things. To
avoid forcing all consumers of libufs.h to include param.h, let's
instead redefine it and verify the definition in inode.c.
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D56859
(cherry picked from commit 271d25a066b59df1e2bb774990948c985382126a)
fsck_ffs: Avoid relying on param.h pollution from libufs.h
- gjournal.c needs param.h to get a definition of isclr().
- fsck.h needs signal.h for sig_atomic_t.
Sort includes while here.
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D56858
(cherry picked from commit 3cd3900b690d8296094921cec844da3f72d30cbb)
cpuset: Move userspace declarations out of _cpuset.h
The _*.h headers are for structure definitions and should avoid
dependencies on other headers. This convention is violated by using
__BEGIN_DECLS/__END_DECLS.
Move the declarations to cpuset.h, I see no reason they can't be there.
Reviewed by: olce, brooks, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D56856
(cherry picked from commit 8b4b995effb7911cc13706dc309d5e03c83b9a94)
vmem: Include param.h in the userspace port as well
It is required at least for NBBY.
MFC after: 1 week
(cherry picked from commit fab4acbb7db8ffc7082d1b60b3c8e446a7cfef90)
tests/ip_mroute: Remove test timeouts
The configured timeout of 30s is a bit too low for a couple of tests
which create 4+ VNET jails when running tests in parallel and with
kernel sanitizers enabled. There's no reason to have custom timeouts,
just use the default.
MFC after: 1 week
(cherry picked from commit 3b16e96b005c723717aa6a4ebc48000354e64fa1)
igmp: Avoid leaving dangling pointers in the state-change queue
When igmp_v3_merge_state_changes() is iterating over state-change
packets, there is a case where it'll free a queued packet but will fail
to remove it from the queue. Fix that.
Reported by: Yuxiang Yang, Yizhou Zhao, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM5.1 from Z.ai
Reviewed by: pouria, glebius
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D56947
(cherry picked from commit beab4a237a45aea809e81802b9e1e9ff30f3d929)
tests/if_lagg: Minor improvements
- Set require.kmods instead of relying on ifconfig to load if_lagg.ko,
as this doesn't work when running within a jail.
- Simplify helper functions which create tap and lagg devices.
MFC after: 1 week
(cherry picked from commit 47ae0135d461854b72b905ac77bf3e1f5b2868bc)
tests/timerfd: Serialize
At least one of these tests changes the system clock, which potentially
interferes with concurrently running tests and causes them to fail.
MFC after: 1 week
(cherry picked from commit 001cfc7b8aa38122c4e0fe8ae48fae3556a1f2b6)
if_vxlan: Update *m0 after a pullup
vxlan_input()'s caller is supposed to free *m0 if it is non-NULL after
the function returns. vxlan_input() failed to update *m0 after the
pullup however, so if it hits an error case after the pullup, we'll free
the mbuf twice. Currently this can happen only if the interface is
brought down or due to a packet loop.
Reported by: Yuxiang Yang, Yizhou Zhao, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM5.1 from Z.ai
Reviewed by: pouria, zlei
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D56944
(cherry picked from commit a6c4fe2d1a38885914b1c3e85508b965ccdb7874)
execve: Add guard pages around execve KVA buffers
This helps ensure that overflows will trigger a panic instead of
silently corrupting adjacent buffers, as happened in SA-26:13.exec.
Extend kmap_alloc_wait() to support allocation of guard pages on both
sides of a KVA allocation. Modify the exec_map setup accordingly. Add
the "vm.exec_map_guard_pages" tunable to provide control over the guard
page allocations.
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D56711
(cherry picked from commit eca4dd133883c9e9aaeca68e0119a638ba0aaca7)
hastd: Include param.h instead of relying on pollution in hooks.c
This is needed at least for MAX() and PATH_MAX.
MFC after: 1 week
(cherry picked from commit fae5815a1d7ef6ef07a15231ca695cba0f848e18)