netbsd-tests: Update a test case to chase grep symlink handling changes
This test case verifies that grep detects symlink loops when traversing
a directory hierarchy.
Fixes: fc12c191c087 ("grep: Default to -p instead of -S.")
Reviewed by: ngie, jhb
Reported by: Jenkins
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D46544
(cherry picked from commit a700bef1e4ee3e6f4e1a86a374bf9b4044f69a70)
netbsd-tests: Update a test case to chase grep symlink handling changes
This test case verifies that grep detects symlink loops when traversing
a directory hierarchy.
Fixes: fc12c191c087 ("grep: Default to -p instead of -S.")
Reviewed by: ngie, jhb
Reported by: Jenkins
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D46544
(cherry picked from commit a700bef1e4ee3e6f4e1a86a374bf9b4044f69a70)
mlx5en: sync channel close with the rq completion processing
Without the wait, mlx5e_destroy_rq() might free mbuf that is passed up
to the network stack on receive in mlx5e_poll_rx_cq().
Sponsored by: NVidia networking
MFC after: 1 week
uma: Avoid excessive per-CPU draining
After commit 389a3fa693ef, uma_reclaim_domain(UMA_RECLAIM_DRAIN_CPU)
calls uma_zone_reclaim_domain(UMA_RECLAIM_DRAIN_CPU) twice on each zone
in addition to globally draining per-CPU caches. This was unintended
and is unnecessarily slow; in particular, draining per-CPU caches
requires binding to each CPU.
Stop draining per-CPU caches when visiting each zone, just do it once in
pcpu_cache_drain_safe() to minimize the amount of expensive sched_bind()
calls.
Fixes: 389a3fa693ef ("uma: Add UMA_ZONE_UNMANAGED")
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: gallatin, kib
Differential Revision: https://reviews.freebsd.org/D49349
(cherry picked from commit f506d5af50fccc37f5aa9fe090e9a0d5f05506c8)
top: Make locale issues non-fatal.
If the `setlocale()` call fails, emit a warning and sleep briefly so the
user has a chance to see the warning before we redraw the screen. Note
that we have no way of knowing exactly what is wrong, but at least we
can suggest that they check their environment.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D49230
(cherry picked from commit 180065eb09e699820a1e1c45d3d00156e0effe29)
uma: Avoid excessive per-CPU draining
After commit 389a3fa693ef, uma_reclaim_domain(UMA_RECLAIM_DRAIN_CPU)
calls uma_zone_reclaim_domain(UMA_RECLAIM_DRAIN_CPU) twice on each zone
in addition to globally draining per-CPU caches. This was unintended
and is unnecessarily slow; in particular, draining per-CPU caches
requires binding to each CPU.
Stop draining per-CPU caches when visiting each zone, just do it once in
pcpu_cache_drain_safe() to minimize the amount of expensive sched_bind()
calls.
Fixes: 389a3fa693ef ("uma: Add UMA_ZONE_UNMANAGED")
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: gallatin, kib
Differential Revision: https://reviews.freebsd.org/D49349
(cherry picked from commit f506d5af50fccc37f5aa9fe090e9a0d5f05506c8)
top: Make locale issues non-fatal.
If the `setlocale()` call fails, emit a warning and sleep briefly so the
user has a chance to see the warning before we redraw the screen. Note
that we have no way of knowing exactly what is wrong, but at least we
can suggest that they check their environment.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D49230
(cherry picked from commit 180065eb09e699820a1e1c45d3d00156e0effe29)
linux: Handle IP_RECVTOS cmsg type
This unbreaks apps using GameNetworkingSockets from Valve.
(cherry picked from commit 186dc094cf1ce14b26c6dfa329a445357121238a)
linux: Fix a typo in linux_recvmsg_common
We are supposed to check the result of bsd_to_linux_sockopt_level here
rather than its input.
(cherry picked from commit 9f55630b8d72602f6ec86b15b607f5fc5fde911e)
linprocfs: Correct sysfs /proc/<pid>/mountinfo entry
Technically mount source could be an arbitrary string (since it's
effectively ignored), but it's common to repeat fs type there.
(cherry picked from commit b9752d5d1cea30a39e89c83ea3aeb539581418cb)
tcp: don't ever return ECONNRESET on close(2)
The SUS doesn't mention this error code as a possible one [1]. The FreeBSD
manual page specifies a possible ECONNRESET for close(2):
[ECONNRESET] The underlying object was a stream socket that was
shut down by the peer before all pending data was
delivered.
In the past it had been EINVAL (see 21367f630d72), and this EINVAL was
added as a safety measure in 623dce13c64ef. After conversion to
ECONNRESET it had been documented in the manual page in 78e3a7fdd51e6, but
I bet wasn't ever tested to actually be ever returned, cause the
tcp-testsuite[2] didn't exist back then. So documentation is incorrect
since 2006, if my bet wins. Anyway, in the modern FreeBSD the condition
described above doesn't end up with ECONNRESET error code from close(2).
The error condition is reported via SO_ERROR socket option, though. This
can be checked using the tcp-testsuite, temporarily disabling the
getsockopt(SO_ERROR) lines using sed command [3]. Most of these
[35 lines not shown]
netlink/route: fix nlattr_get_multipath() to check length
of supplied nexthop sub-attributes. While here, use unsigned types for
length calculations and improve style(9).
PR: 283860
(cherry picked from commit 49a6e213416b5c0c9eccdff0af1c6b01f34c3693)
acpi_ibm: pass brightness events to evdev(4)
unless the dev.acpi_ibm.0.handlerevents sysctl is set to process
them internally. The default for the latter is to ignore them,
so passing to evdev(4) is enabled by default.
Reviewed by: wulf, imp
Tested on: Lenovo Thinpad X11 Carbon 7Th Gen
Differential Revision: https://reviews.freebsd.org/D48174
(cherry picked from commit c21f5751ef0932796676e55953461e0679020e28)
top: Sync usage and synopsis
Switching between io and cpu sorting uses a great example in the usage.
[-m io | cpu]. Use that everywhere.
MFC after: 3 days
Reviewed by: mhorne
Approved by: mhorne (mentor)
Differential Revision: https://reviews.freebsd.org/D49515
(cherry picked from commit 187d954eab94fdcb33609d91966dbd727acfd720)
top: Polish key bindings in usage and manual
Organize key bindings by ascii(7) for consistency and maintainability,
mark them as Interactive Commands, wordsmith them, and sync their
organization between the manual and help screen.
MFC after: 3 days
PR: 282734
Fixes: c8aa5e526 (move command mapping to commands.c)
Reviewed by: imp, mhorne, Jim Brown <jpb at jimby.name>
Approved by: mhorne (mentor)
Differential Revision: https://reviews.freebsd.org/D49462
(cherry picked from commit 0a85254d5a33800600477ce57fbaab64591aa6ea)
hier.7: Storage partitions are not filesystems
I recommended the incorrect text to the submitter.
MFC after: 3 days
Fixes: f47cbb29e1c2 (Add /dev/gpt)
Reported by: Mark Millard <marklmi at yahoo.com>
Reviewed by: imp, mhorne
Approved by: mhorne (mentor)
Differential Revision: https://reviews.freebsd.org/D49523
(cherry picked from commit 50296dccddf1a7734be2aef606cd8e0408ee8780)
tcp: remove support for TCPPCAP
This feature could be used to store the last sent and received TCP
packets for a TCP endpoint. There was no utility to get these packets
from a live system or core.
This functionality is now provided by TCP Black Box Logging, which also
stores additional events. There are tools to get these traces from a
live system or a core.
Therefore remove TCPPCAP to avoid maintaining it, when it is not
used anymore.
Reviewed by: rrs, rscheff, Peter Lei, glebiu
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D49589
pf: inline pf_addrcpy()
Make it easier for the compiler to inline this in the many cases where the 'af'
is known at compile time.
Reviewed by: glebius, markj
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D49581
pf: explicitly NULL state key pointers
After the pf_state_insert() call we may not use these pointers again.
Explicitly NULL them to ensure we don't.
Also NULL them out if we free the keys directly.
Reviewed by: glebius, markj
MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D49553
pf: simplify action resolution in pf_test_rule()
Rather than looking at state keys after the fact just save the action in the
nat64 section. This simplifies things and it also ensures we don't use state
keys after pf_insert_state().
Reviewed by: glebius, markj
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D49552
pf: don't use state keys after pf_state_insert()
pf_state_insert() may free the state keys, it's not safe to access these
pointers after the call.
Introduce osrc/odst (similar to osport/odport) to store the original source and
destination addresses. This allows us to undo NAT transformations without having
to access the state keys.
Reviewed by: glebius, markj
MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D49551
pf: improve pf_state_key_attach() error handling
If we fail to attach the stack key that means we've already attached the wire
key. That means the state could be found by other cores, and given that we then
free it, be used after free.
Fix this by not releasing the ID hashrow lock and key locks until after we've
removed the inserted key again, ensuring the state cannot be found by other
cores.
Reported by: markj
Submitted by: glebius
Reviewed by: glebius, markj
MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D49550
Import iwx as ported from OpenBSD by Future Crew.
This driver originates from OpenBSD and was ported to FreeBSD by Future
Crew LLC who kindly provided a source release.
iwx supports many recent Intel WiFi card and this driver should support running
these cards with legacy, HT and VHT rates. There are some issues remaining in
the port, but at this point wider testing is sought.
To avoid breaking deployed WiFi configurations iwx probes with a lower
priority than iwlwifi. This can be changed by blocking iwlwifi with
devmatch.
Reviewed by: adrian
Obtained from: Future Crew LLC
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49259
hyperv/storvsc: Avoid conditional asserts in storvsc_xferbuf_prepare()
whu@ cannot reproduce the assertion failure which led to these ifdefs
being added in the first place, and since they appear wrong, i.e., the
assertions ought to apply to all platforms, let's remove them.
This reverts commits 0af5a0cd2788efce9f444f4f781357d317bb0bb1 and
6f7b1310b6fe36f9bb653d3e97bc257adced3a2b.
PR: 285681
Tested by: whu
MFC after: 2 weeks