aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* unix: only treat an empty sun_path as a peer descriptor for connectat(2)Devin Teske4 days1-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | connect(2) passes AT_FDCWD to unp_connectat(), so the empty-path descriptor branch added in 6563dcb6b1f5 turned any sockaddr whose sun_path begins with a NUL byte into getsock(AT_FDCWD), failing with EBADF where the pathname lookup historically failed with ENOENT. Linux abstract namespace names are exactly that: the linuxulator passes them through with the leading NUL intact, and libxcb tries the abstract socket first, falling back to the pathname socket only on ENOENT or ECONNREFUSED. The EBADF made every Linux X11 client fail at startup with "Missing X server or $DISPLAY". Restrict the descriptor interpretation to fd != AT_FDCWD, matching the contract stated in 6563dcb6b1f5's commit message ("Accept an empty sun_path when fd is not AT_FDCWD"): connect(2) again reaches the pathname lookup and fails with ENOENT as it always did. Add a regression test: a NUL-leading, nonzero-length sun_path through connect(2) or connectat(2) with AT_FDCWD must fail the pathname lookup with ENOENT, not EBADF. Fixes: 6563dcb6b1f5 ("unix: allow connectat(2) to name the peer socket by descriptor") Reviewed by: John Ericson <John.Ericson@Obsidian.Systems>, markj Differential Revision: https://reviews.freebsd.org/D58792
* pfsync test: reduce the number of states to bulk-syncKristof Provost4 days1-1/+1
| | | | | | | | | We created so many states that our bulk-sync occasionally caused epair to drop packets, which in turn caused the test to fail. That's not what we're testing here, make it more robust by creating fewer states. PR: 297307 Sponsored by: Rubicon Communications, LLC ("Netgate")
* unix: Fix mchain handling in uipc_sosend_stream_or_seqpacket()Mark Johnston4 days1-0/+87
| | | | | | | | | | | | | | | | | | Empty mchains cannot be copied with simple assignment. I think this bug is mostly harmless: if mcnext is empty, then it won't be accessed again before it is reinitialized in the next loop iteration. So the bug only trips an assertion in INVARIANTS kernels and won't be visible otherwise. Add a regression test which triggers this corner case. Reported by: Jan Bramkamp Fixes: d15792780760 ("unix: new implementation of unix/stream & unix/seqpacket") Reviewed by: glebius MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58791
* net: Revert the ioctl SR-IOV VF status interfaceKevin Bowling7 days4-246/+1
| | | | | | | | | | | | | | | | | | | | | | A native route Netlink interface will replace this stack. Requested by: glebius This reverts commit 1ccf543b21eff6e0828142e5c1d09519247143f4. This reverts commit 2c04cfa148ec4dd5cef7e228aaea6a05957fcb15. This reverts commit 2d6114f6d26bf7dfa5ad94e1db9b09ee7108dc7a. This reverts commit d15f2551b25f79ddcbe289faa95e655100b952da. This reverts commit ceb282bbd62eed5e84df9abaede0dd183f66997a. This reverts commit c30021fe0df9e045a17292dbe50dfc054b69871f. This reverts commit fb1820d23a04856a6d3047b4c088cc8df8f76da1. This reverts commit 8696cc600f44767e7988a92c8e6fb943e97d4cc7.
* tests/netinet/socket_afinet: add more tests to multibindGleb Smirnoff7 days1-0/+12
| | | | | | | | | | | | Add tests where first socket and second socket are bound to different addresses, e.g. first specific and second wildcard and vice versa. Mark success with SO_REUSEPORT on the second socket as a bug suspect. Mark failure to bind to INADDR_ANY in presence of other UID's specific bound socket to the same port as probably too strict. Differential Revision: https://reviews.freebsd.org/D58088
* tests/netinet/socket_afinet: multibind second socket can be differentGleb Smirnoff7 days1-39/+40
| | | | | | | | Allows to add tests to the table where the second socket doesn't take address from the first. No functional change yet, all tests test the same conditions. Differential Revision: https://reviews.freebsd.org/D58087
* tests/netinet/socket_afinet: unroll multibind test into a tableGleb Smirnoff7 days1-106/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | The test has 6 dimensions: address family, socket type, socket option on the first socket, socket option on the second socket, is first socket bound to specific address or wildcard and is the second socket priveleged or not. Before the change 3 dimensions are implemented as 3 nested for() loops, 2 dimensions are implemented as repetitions in the test body and one dimension as two actions in the innermost loop. I'm about to add one more dimension: whether the second socket is bound to a specific address or wildcard instead of using first socket's getsockopt(2) result. Also, there is a change under discussion that would make SOCK_STREAM sockets behave different to SOCK_DGRAM. That would break result consistency in the dimensions of socket type. We expect that consistency in the dimension of address families shall never break, thus this one remains a for() loop. The priveleged & non- privileged bind(2) attempts also remain as two actions, but expected results are in the table. The rest of dimensions are unrolled into a table, which at the moment has quite a lot of lines with identical results. However, as more tests are added and SOCK_STREAM behavior changes, the table will get more mixed results. Also, reading a test that is written in a declarative manner a table is much easier and modifying it is more resistent to accidential breakage. Differential Revision: https://reviews.freebsd.org/D58085
* tests/netinet6: remove test that uses Jumbo Payload OptionGleb Smirnoff7 days3-351/+0
| | | | | | | | This test was already marked as always skipped. Fixes: 069a67374ed9641ff1ada2aecaac1cc61a560649 Reviewed by: pouria Differential Revision: https://reviews.freebsd.org/D58114
* unix: allow listening on an unbound socket, and binding after listenJohn Ericson7 days2-6/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | `uipc_listen()` refused a socket that had not been bound, with `EDESTADDRREQ`. That made sense while a pathname was the only way to name a peer: an unbound listener could never be reached, so allowing it would only have created sockets nothing could connect to. Now that `connectat(2)` can name a peer socket by descriptor, an unbound listener *is* reachable, and the restriction only stands in the way. It also left stream sockets oddly stricter than datagram ones, which could already reach an unbound peer. Dropping the check additionally permits `bind(2)` after `listen(2)`: `uipc_bindat()` already allows this, as it only rejects re-binding a socket that has a name. That ordering closes a window listeners otherwise have to leave open. Today the socket file must exist before the socket may listen, so a client connecting in between is refused; binding afterwards publishes the name only once the socket is ready to accept. `unix_seqpacket_test:listen_unbound` asserted the old behaviour, and is inverted accordingly. Signed-off-by: John Ericson <John.Ericson@Obsidian.Systems> Assisted-by: Claude Code (Claude Opus 4.8 and Fable 5) Reviewed by: glebius, markj MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D58683
* tests: exercise unix connectat(2) with a socket peer descriptorJohn Ericson7 days2-0/+671
| | | | | | | | | | | | | | | | | | | | Cover the new fd-direct connect path: stream connect and data passing, the peer address reported by `getpeername(2)`, datagram to an unbound peer, the `EINVAL`/`ENOTSOCK`/`EPROTOTYPE`/`ECONNREFUSED` error matrix, and the Capsicum token semantics — a descriptor limited to `CAP_CONNECTAT` can be connected to but not listened on, accepted from, or read, and one lacking `CAP_CONNECTAT` cannot be a connect target. Stream listeners are always bound: `uipc_listen()` refuses unbound sockets with `EDESTADDRREQ`, so an unbound fd-direct listener is not reachable even with this feature. Signed-off-by: John Ericson <John.Ericson@Obsidian.Systems> Assisted-by: Claude Code (Claude Opus 4.8 and Fable 5) Reviewed by: markj MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D58406
* unix: Fix some bugs in the SOCK_STREAM receive pathMark Johnston7 days1-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main problem is with the handling of errors from unp_externalize(). It turns out that this was quite broken, and unfortunately it's easy to trigger such errors (e.g., by setting a low per-process fd limit with setrlimit()). In non-peek mode, uipc_soreceive_stream_or_seqpacket() cuts a bunch of mbufs from the head of the socket buffer, to be consumed by userspace. When unp_externalize() returns an error, we splice the removed mbuf chain back onto the head of the socket buffer. This is expensive, but that's ok since such errors are rare. The problem is that this cutting is not correctly implemented: it does not clear the "next" pointer for the last mbuf in the chain, so it still points to the first mbuf still resident in the socket buffer. This means that mc_init_m() creates a chain that still includes the rest of the socket buffer, so splicing the chain back into the socket buffer does not work properly. Fix this: fully detach the control chain from the socket buffer so that we can safely use mc_init_m(). Then, incrementally add data mbufs, taking care to handle "part". Fix some related bugs while here: - Don't swallow the error if unp_externalize() fails and there's nothing left in the socket buffer (i.e., control->m_next == NULL). - Roll back changes to the partially read mbuf. Reviewed by: glebius MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58695
* rtnetlink: Report SR-IOV VF statusKevin Bowling9 days4-1/+246
| | | | | | | | | | | | | | | | Honor RTEXT_FILTER_VF on RTM_GETLINK requests and expose the versioned SR-IOV VF status through typed nested FreeBSD attributes. Report IFLA_NUM_VF with a successful requested query and preserve per-provider errors in the status container. Map the common nvlist schema to native integer, boolean, string, and binary attributes. Carry namespaced driver extensions as packed versioned nvlists so adding a driver-specific field does not expand the common netlink ABI. Add SNL parsers, parser verification, a constructed nested-status test, and an RTM_GETLINK test for an interface without SR-IOV support. Document the query contract and every attribute.
* pfsync: handle large MTU pfsync interfacesKristof Provost9 days1-3/+8
| | | | | | | | | | | | | pfsync packets were allocated with m_get2(), which can't return packets larger than MJUMPAGESIZE. As a result 9k MTU pfsync interfaces simply didn't work. Use m_get3(), which can allocate sufficiently large mbufs. Extend the pfsync:bulk test case to provoke this problem. PR: 297307 MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate")
* ptrace_test: require debug.ptrace_transparent_attach enabled for its testKonstantin Belousov11 days2-0/+5
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* tests/sys/kern: Skip capsicum procdesc tests when capability mode is unavailableOlivier Cochard12 days3-0/+13
| | | | | | | | | | pdwait's capsicum/enotcap and procdesc's pdopenpid_capmode enter capability mode. Require security_capability_mode (and security_capabilities for enotcap) so the cases skip cleanly on kernels built without CAPABILITIES instead of failing. Approved by: asomers, gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D58545
* exterror(9): dynamic kernel categoriesBrooks Davis14 days1-0/+27
| | | | | | | | | | | | | | | | Make it possible to define categories without compiling their paths into libc (important for third-party modules). The EXTERR_CATEGORY_DYNAMIC macro can be defined to a string describing the compilation unit (generally the path relative to src/sys) which takes the place of EXTERR_CATEGORY. These strings are assembled in linker sets with category numbers assigned at system startup or module load time. The strings can be retrieved from the kern.exterr.categories.<category> sysctl. Reviewed by: kib Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D58237
* pf: attempt to handle overlapping group and interface namesKristof Provost2026-08-031-0/+23
| | | | | | | | | | | | | | | pf assumes that network groups and network interfaces share a namespace (that is, a name is unused, a group or an interface, never both a the same time). Unfortunately this assumption was broken when interface renaming was introduced. Attempt to cope with this rather than panicking. Note that this is a band-aid, not a full solution. The correct fix is for the network stack to go back to enforcing a single namespace for groups and interfaces. PR: 297220 Reported by: Robert Morris MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate")
* tests/sys/capsicum: adjust tests for the new reaping behaviorKonstantin Belousov2026-08-012-51/+40
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58569
* tests/sys/kern: adjust tests for the new reaping behaviorKonstantin Belousov2026-08-014-15/+20
| | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58530
* if_gif: Add netlink support with testsPouria Mousavizadeh Tehrani2026-07-312-0/+161
| | | | | | | | Migrate to new if_clone KPI and implement netlink support for gif(4). Also break GIFSOPTS ioctl logic out of gif_ioctl. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D57666
* if_gre: Add a regression testPouria Mousavizadeh Tehrani2026-07-302-0/+397
| | | | | | | | | Add a regression test for gre(4) to make sure all of the gre capabilities and options are working as intended. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D55363
* tests/procdesc: Fix race in pdopenpid_pdwait_only_oneOlivier Cochard2026-07-301-2/+15
| | | | | | | | | | | The child exited immediately after pdfork(), so the parent's pdopenpid() could catch it mid-exit (P_WEXIT) and fail with EBUSY. Block the child on a pipe until the parent has opened the second descriptor, then release it Approved by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D58546
* wg(4): Add a test that the driver handles a decryption failureJohn Baldwin2026-07-293-0/+122
| | | | | | | | | | | | | The test uses a fail point to inject a decryption error in OCF while sending a ping across the tunnel. The driver should then fail to respond to the ping and increment the input error counter on the interface. Approved by: so Security: FreeBSD-SA-26:52.if_wg Security: CVE-2026-58085 Reviewed by: markj Sponsored by: Chelsio Communications
* kqueue: Avoid enqueuing an already-enqueued knoteMark Johnston2026-07-291-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | knotes with a non-trivial f_copy implementation may be activated before kqueue_fork_copy_knote() is finished. In particular, it may be enqueued at the time that kqueue_fork_copy_knote() calls knote_enqueue(). Guard against this. Add a test case which triggers the race. Fix several other problems with the replication of knote state: - Make sure only the KN_ACTIVE and KN_DISABLED status flags are inherited, the rest should not be copied. - Ignore marker knotes. - Ignore knotes for kqueues. They cannot be safely copied into the child without more work, as kqueues are inherently local to a process; on fork, we need to ensure that such knotes are patched to reference the new kqueue, not the original. - Try to keep knote state stable by holding the kqueue and knlist locks while copying. Approved by: so Security: FreeBSD-SA-26:50.kqueue Security: CVE-2026-58083 Reviewed by: kib Reported by: Hazley Samsudin of GovTech CSG Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58223
* routing: Add tests for prefsrc route attributePouria Mousavizadeh Tehrani2026-07-281-0/+154
| | | | | | | | | Add tests for both IPv4 and IPv6 routes with the prefsrc attribute. Also test IPv4 routes over IPv6 nexthops and borrow their IPv4 addresses from the loopback interface. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D58326
* Revert "tests/ktls: merge two sysctl checking helpers into one"Gleb Smirnoff2026-07-281-8/+27
| | | | | | With certain sysctl configuration the test will fail. This reverts commit 801c0f383c0a719165c21ff5c29f231fb7b920c4.
* tests/ktls: merge two sysctl checking helpers into oneGleb Smirnoff2026-07-271-27/+8
| | | | No functional change.
* unix: Preserve FD_RESOLVE_BENEATH when passing an fdMark Johnston2026-07-241-0/+31
| | | | | | | | | | | | | | | | The FD_RESOLVE_BENEATH flag is supposed to be sticky. It's set when you receive an fd from a different jail and preserved by openat(<dfd>) etc.. However, if you send the fd to yourself, the flag is stripped since SCM_RIGHTS message don't preserve file descriptor flags. Fix this by preserving those flags and checking for UF_RESOLVE_BENEATH in restrict_rights(). Fixes: 350ba9672a7f ("unix: Set O_RESOLVE_BENEATH on fds transferred between jails") Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58317
* tests/sys/pmc: only build if MK_PMC != noEnji Cooper2026-07-231-1/+5
| | | | | | | | | This unbreaks the build when pmc support is explicitly disabled via the aforementioned build knob. MFC after: 10 days Fixes: 2cfd82f74 ("hwpmc: add regression tests for ...") Differential Revision: https://reviews.freebsd.org/D58401
* pf(4) fix NULL pointer dereference in outbound packet path.Kristof Provost2026-07-231-0/+46
| | | | | | | | | | | | | | | | | | | | | | | Outbound packet which matches rule with source limiter attached, for example: source limiter "crash" id 1 entries 10000 limit 1000 pass out from any to any source limiter "crash" keep state triggers a NULL pointer dereference. The issue was kindly reported and initial version of fix submitted by SecBuddyF, Tencent KeenLab. The submitted diff fixed the issue for failing look up by destination address in outbound packet. dlg@ also pointed out the change should be further improved so NULL pointer dereference is avoided when rule uses nat-to/rdr-to option. OK dlg@ Obtained from: OpenBSD, sashan <sashan@openbsd.org>, f0f215c11e Sponsored by: Rubicon Communications, LLC ("Netgate")
* tests/exterr_test: use ATF_REQUIRE_FEATURE to check exterr_stringsSiva Mahadevan2026-07-222-2/+5
| | | | | | | | This keeps the skipped test message consistent with others. Reviewed by: netchild MFC after: 3 days Sponsored by: The FreeBSD Foundation
* tests/netpfil: start ipfilter for ipfnat firewall typeSiva Mahadevan2026-07-221-1/+1
| | | | | | | | | | | | | | | | This requested fix[0] was not complete before the change was committed. Cleans up this error message when running tests[1]: "Cannot 'start' ipfilter. Set ipfilter_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'." [0] https://reviews.freebsd.org/D21065?id=60288#inline-131488 [1] https://ci.freebsd.org/job/FreeBSD-main-amd64-test/28917/testReport/sys.netpfil.common/rdr/ipfnat_local_redirect/ Fixes: f97a8a36153a9 MFC after: 3 days Sponsored by: The FreeBSD Foundation
* bind(2): Lookup local address in current FIB if '*.bind_all_fibs' is activeBojan Novković2026-07-222-0/+101
| | | | | | | | | | | | | | | | | | | When a protocol-specific 'bind_all_fibs' tunable is set to 0, a listening socket will only receive traffic originating from the FIB it was bound to. However, there are no checks to determine whether an address exists in the target FIB when binding the socket, which can lead to a situation where a socket and the address it was bound to belong to different FIBs. Prevent this footgun by looking up the requested address in the current FIB if 'bind_all_fibs' is active and returning an error if the address does not exist. Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D58281 Reviewed by: glebius, pouria, markj MFC after: 2 weeks
* exterror tests: harden the checksAlexander Leidinger2026-07-211-1/+23
| | | | | | | | | | | Skip the message-content check on kernels that do not advertise the exterr_strings feature, and pin the output format by clearing EXTERROR_VERBOSE. Reviewed by: kib MFC after: 1 week Assisted-by: Claude Code (Fable 5) Differential Revision: https://reviews.freebsd.org/D58322
* hwpmc: add regression tests for detaching a live process-mode PMCAlexander Leidinger2026-07-202-0/+180
| | | | | | | | | | | | | | | | | Attach a process-mode counting PMC to the current process, start it, then detach and release it while it is still loaded on the hardware - the case that previously leaked the PMC's runcount reference and wedged pmc_wait_for_pmc_idle() at release. A second case does the same from a multi-threaded process so the sibling threads' references have to be drained too. The tests need an allocatable process-mode counting event and skip where none is available (hwpmc(4) not loaded, or a VM without a vPMU). Reviewed by: adrian MFC after: 2 weeks Assisted-by: Claude Code (Fable 5) Differential Revision: https://reviews.freebsd.org/D58343
* hwpmc: add regression tests for counting-PMC counter wraparoundAlexander Leidinger2026-07-203-0/+224
| | | | | | | | | | | | | | | | | | Exercise a process-mode counting PMC whose accumulated count crosses, or already exceeds, the range of the underlying hardware counter. Before the previous commit, the first context switch after the hardware counter wrapped panicked INVARIANTS kernels with "negative increment" and silently corrupted the accumulated count on other kernels. The tests need a hardware counting event backed by a counter narrower than 64 bits and skip where none is available (hwpmc(4) not loaded, or a VM without a vPMU). Reviewed by: adrian MFC after: 2 weeks Assisted-by: Claude Code (Fable 5) Differential Revision: https://reviews.freebsd.org/D58341
* subr_physmem_test: add tests for two edge-casesMitchell Horne2026-07-131-0/+43
| | | | | | | | | | | | | | | Help validate my assertion that "physmem will never report empty ranges". Part of this is covered by the existing tests, which check the merging of adjacent/overlapping regions. The other part is to ensure that addition of zero-sized ranges is ignored. The physmem implementation also includes logic to ignore the first physical page of memory (physical addresses 0 to PAGE_SIZE-1). Add a second test case for this. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45914
* routing: Add test for nexthop subscriptionPouria Mousavizadeh Tehrani2026-07-111-6/+84
| | | | | | | Make sure we have reachability when one of our nexthops gets down without deleting the route. Differential Revision: https://reviews.freebsd.org/D57552
* fusefs: fix gcc build error with shadowed variable in testsRyan Libby2026-07-101-2/+2
| | | | | | | Reported by: gcc -Werror=shadow Reviewed by: asomers, markj Fixes: ee1c3d38a26a ("fusefs: fix vnode locking violations during execve") Differential Revision: https://reviews.freebsd.org/D58130
* tests/inotify: Make an error message more usefulMark Johnston2026-07-091-1/+2
| | | | MFC after: 3 days
* pf: fix a crash on sendfile()KUROSAWA Takahiro2026-07-082-1/+147
| | | | | | | | | | | | The network layer must not pass unmapped (M_EXTPG) mbufs to if_output() of network interfaces without IFCAP_MEXTPG. pf should convert these mbufs by mb_unmapped_to_ext() for such interfaces but it didn't. The problem had occurred on sendfile because sendfile system call uses unmapped mbufs for the file data. Reported by: feld Reviewed by: kp, glebius Differential Revision: https://reviews.freebsd.org/D58021
* if_epair: support IFCAP_MEXTPGKristof Provost2026-07-081-1/+3
| | | | | | | | | | | Enable IFCAP_MEXTPG by default, which may bring performance benefits. Allow it to be disabled, and when disabled assert that we do not receive any mbufs with M_EXTPG set. This is useful for testing. Default the tests to disabling MEXTPG support. Reviewed by: zlei Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D58054
* tests/sendfile_helper: support remote connectionKUROSAWA Takahiro2026-07-081-6/+64
| | | | | | | | | | In order to use the sendfile_helper program in a pf test script that requires non-loopback interfaces, add functionality to sendfile with a TCP socket that is connected to a remote host. The behavior for unix sockets and TCP loopback sockets is unchanged. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D58041
* tests/sendfile: move the helper program to commonKUROSAWA Takahiro2026-07-084-4/+6
| | | | | | | | | | In order to reuse the sendfile_helper program in pf tests, move it to tests/sys/common directory, indicatint that it is also used from another places than sys/kern. Also make the readlen variable static. Reviewed by: gelbius, kp Differential Revision: https://reviews.freebsd.org/D58040
* pddupfd(2): add basic testKonstantin Belousov2026-07-071-0/+74
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57163
* tests/procdesc: Add some test cases for pdopenpid()Mark Johnston2026-07-071-0/+467
| | | | | | Reviewed by: kib MFC with: 5c32aa785184 ("kern: add pdopenpid(2)") Differential Revision: https://reviews.freebsd.org/D58023
* inotify: Unconditionally generate IN_IGNORED events for files/dirsMark Johnston2026-07-061-0/+24
| | | | | | | | | | | | | | | | | | | | The implementation previously only generated an IN_IGNORED event for a deleted watched file if the watch explicitly requested IN_DELETE_SELF. This is not correct, IN_IGNORED should always be raised when the watched subject is deleted. Adjust the implementation of inotify_log_one() accordingly. This also fixes a problem where a deleted watched file's watch would not be removed if IN_DELETE_SELF was not in the watch's event mask, in which case the unlinked vnode would linger until the inotify descriptor itself is closed. Add a regression test. Reported by: jrtc27 Reviewed by: jrtc27 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D58050
* tests/if_wg: Let wg_vnet_parent_routing run in a VNET jailMark Johnston2026-07-031-0/+2
| | | | MFC after: 1 week
* tests/aslr: Fix spurious test failuresMark Johnston2026-07-031-4/+16
| | | | | | | | | /sbin/ping and /sbin/ping6 are hard-linked, and the vmmap sysctl handler doesn't know which name was used to launch the process. PR: 296116 MFC after: 3 days Fixes: 080a4087014e ("tests: Fix race condition in aslr_setuid")
* fusefs: fix vnode locking violations during execveAlan Somers2026-07-035-2/+364
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix two locking violations that could happen during execve, while executing a file stored on fusefs. Both would cause panics on an INVARIANTS kernel after 15.0, or a DEBUG_VFS_LOCKS kernel prior to that. Neither is likely to be noticeable on a release kernel. * Don't assume that the vnode is exclusively locked during VOP_CLOSE. It usually is thanks to !MNTK_LOOKUP_SHARED, but isn't during execve, which locks the vnode outside of the lookup path. * Totally rewrite fuse_io_invalbuf. It's had a number of problems ever since its original introduction[^1]: - Don't assume that the vnode is exclusively locked. That assumption failed during execve just like the assumption in fuse_vnop_close. - Don't livelock forever if vinvalbuf returns ENOSPC or EDQUOT. - Don't attempt to handle multiple threads calling this function at the same time. That would be impossible if the vnode truly were exclusively locked. So the code was dead. Or it would've been, if the assumption hadn't been wrong. Furthermore, both vinvalbuf and vnode_pager_clean_sync only require a shared vnode lock, and are already capable of dealing with multiple simultaneous callers. - Using fvdat->flag in this way would require some sort of mutex protection, if the vnode weren't exclusively locked. * Add new test cases that trigger both of the aforementioned panics. [^1]: https://github.com/glk/fuse-freebsd/commit/efe6eb3005e7633b4e31d5e453eacbaa0cba42fa PR: 295957 Reported by: dan.kotowski@a9development.com MFC after: 2 weeks Sponsored by: ConnectWise Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D57536