Commit Graph

1827 Commits

Author SHA1 Message Date
Alexander Ziaee
088cc7d221 man filesystems: fix more xrefs after move to s4
Fixes: 1a720cbec5
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1282
2024-06-27 18:32:05 -06:00
Warner Losh
0c00c3d75b test: Change bug number
There was already a bug on this, so change to old bug

PR: 279354
Sponsored by:		Netflix
2024-06-26 09:18:50 -06:00
Warner Losh
b2351a4ba5 test: disable sys.kern.unix_seqpacket_test.random_eor_and_waitall
It's been failing for a while, at least some of the time.

PR: 279994
Sponsored by:		Netflix
2024-06-25 19:35:13 -06:00
Warner Losh
6176883697 sys.netinet6.divert.ipdivert_ip6_output_remote_success fails
Disable it. It's been failing with the useful
1 != 0 (1 != 0)
for weeks if not months now.

PR: 279975
Sponsored by:		Netflix
2024-06-24 15:11:05 -06:00
Alan Somers
6efba04df3 fusefs: fix two bugs regarding _PC_MIN_HOLE_SIZE
Background:

If a user does pathconf(_, _PC_MIN_HOLE_SIZE) on a fusefs file system,
the kernel must actually issue a FUSE_LSEEK operation in order to
determine whether the server supports it.  We cache that result, so we
only have to send FUSE_LSEEK the first time that _PC_MIN_HOLE_SIZE is
requested on any given mountpoint.

Problem 1:

Unlike fpathconf, pathconf operates on files that may not be open.  But
FUSE_LSEEK requires the file to be open.  As described in PR 278135,
FUSE_LSEEK cannot be sent for unopened files, causing _PC_MIN_HOLE_size
to wrongly report EINVAL.  We never noticed that before because the
fusefs test suite only uses fpathconf, not pathconf.  Fix this bug by
opening the file if necessary.

Problem 2:

On a completely sparse file, with no data blocks at all, FUSE_LSEEK with
SEEK_DATA would fail to ENXIO.  That's correct behavior, but
fuse_vnop_pathconf wrongly interpreted that as "FUSE_LSEEK not
supported".  Fix the interpretation.

PR:		278135
MFC after:	1 week
Sponsored by:	Axcient
Differential Revision: https://reviews.freebsd.org/D44618
2024-06-24 10:02:02 -06:00
Mark Johnston
ac52fa1f1b sendfile tests: Fix an error check in tcp_socketpair()
Fixes:	c368d3f20f ("tests/sendfile: factor out tcp_socketpair()")
Differential Revision:	https://reviews.freebsd.org/D45598
2024-06-21 14:18:22 -04:00
Kristof Provost
025df3e6a0 pf tests: test keepcounters when we exceed 32 bits
Ensure that we correctly transfer byte counts if the value exceeds what can be
stored in a single 32-bit counter.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-06-21 13:49:17 +02:00
Ryan Libby
7affbeeab1 virstor: basic functional test
Reviewed by:	asomers, markj
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D45535
2024-06-10 10:32:22 -07:00
Kristof Provost
d9ab899931 pf: migrate DIOCGETLIMIT/DIOCSETLIMIT to netlink
Event:		Kitchener-Waterloo Hackathon 202406
2024-06-07 20:59:02 +02:00
Kristof Provost
8ed5170c66 pf tests: test setting and retrieving timeout values 2024-06-06 20:46:19 +02:00
Kristof Provost
480ad40553 vnet tests: check for if_bridge.ko
A number of tests create a bridge, but did not check if if_bridge.ko is loaded.

We usually get away with that, because `ifconfig bridge create` autoloads the
module, but if we run the tests in a jail (e.g. because of kyua's upcoming
execenv.jail.params feature) we can't load the module and these tests can fail.

Check if the module is loaded, skip the test if it is not.

Reviewed by:	markj
MFC after:	1 week
Event:		Kitchener-Waterloo Hackathon 202406
Differential Revision:	https://reviews.freebsd.org/D45487
2024-06-04 22:16:56 +02:00
Kristof Provost
2144e31d8f netpfil tests: make the pls tests more robust
Give them more time to hit the expected loss numbers.
We see occasional failures during CI runs. This makes that less likely.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-06-04 14:59:59 +02:00
Kristof Provost
1c5b886e11 pf tests: make ether:dummynet test a little more robust
Allow slightly more bandwidth, but cause ping to give up sooner.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-06-04 14:59:59 +02:00
Kristof Provost
cce6951755 pf tests: basic debug level test
Set & retrieve the debug level.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-06-04 14:59:59 +02:00
Kristof Provost
a9d7ff4e5e pf tests: basic status get/clear test
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-06-04 14:59:58 +02:00
Kristof Provost
8b28ec3861 pf tests: test longer anchor names
PR:		279225
MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-05-28 22:29:38 +02:00
Kristof Provost
bdd12889ea if_vlan: handle VID conflicts
If we fail to change the vlan id we have to undo the removal (and vlan id
change) in the error path. Otherwise we'll have removed the vlan object from the
hash table, and have the wrong vlan id as well. Subsequent modification attempts
will then try to remove an entry which doesn't exist, and panic.

Undo the vlan id modification if the insertion in the hash table fails, and
re-insert it under the original vlan id.

PR:		279195
Reviewed by:	zlei
MFC atfer:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D45285
2024-05-22 09:08:02 +02:00
Zhenlei Huang
76df3c57a0 ifconfig: Redo fix vlan/vlanproto reconfiguration
When the if_vlan(4) interface has not been fully configured, i.e., a
bare interface without a physical interface associated with it,
retrieving the current settings of it and unconditionally overwriting
`params` will result in losing vlandev settings in `params`. That will
lead to failing to associate the if_vlan(4) interface with the requested
physical interface and the false report 'both vlan and vlandev must be
specified'.

Fix that by checking if the vlan interface has been fully configured.

The basic VLAN test is slightly modified to cover this case.

PR:		279181
Reviewed by:	kp
Tested by:	Mike Tancsa <mike@sentex.net>
Fixes:		b82b8055ad ifconfig: fix vlan/vlanproto reconfiguration
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D45283
2024-05-22 00:35:01 +08:00
Mariusz Zaborski
4b3141f5d5 geli: allocate a UMA pool earlier
The functions g_eli_init_uma and g_eli_fini_uma are used to trace
the number of devices in GELI. There is an issue where the g_eli_create
function may fail before g_eli_init_uma is called, however
g_eli_fini_uma is still executed in the fail path. This can
incorrectly decrease the device count to zero, potentially leading to
the UMA pool being freed. Accessing the device after the pool has been
freed causes a system panic.

This commit resolves the issue by ensuring devices count is increassed
eariler.

PR:		278828
Reported by:	Andre Albsmeier <mail@fbsd2.e4m.org>
Reviewed by:	asomers
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D45225
2024-05-19 14:53:17 +02:00
Kristof Provost
59a6666ec9 if_ovpn: cope with loops
User misconfiguration may lead to routing loops where we try to send the tunnel
packet into the tunnel. This eventually leads to stack overflows and panics.

Avoid this using if_tunnel_check_nesting(), which will drop the packet if we're
looping or we hit three layers of nested tunnels.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-05-13 12:11:06 +02:00
Alan Somers
b2792a300d fusefs: make the tests more robust to changes to maxphys
Remove assumptions in two test cases that maxphys won't be huge.

Reported by:	kib
MFC after:	2 weeks
Sponsored by:	Axcient
2024-05-09 11:09:23 -06:00
Brooks Davis
eb5fd01b53 soxstack: slience 32-bit gcc warning
Modern GCC complains when casting pointers to integers of a different
size (even a larger one).  Switch from uint64_t to uintptr_t which will
always be the right size for a stack address instead of maybe being too
big.

Reviewed by:	dchagin, emaste
Differential Revision:	https://reviews.freebsd.org/D45087
2024-05-08 15:51:17 +01:00
Kristof Provost
5311e73337 netinet tests: basic VRRP tests
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D44775
2024-05-08 13:19:04 +02:00
Gleb Smirnoff
0089d83b3a lagg: enable tests that stress the configuration changes
I wasn't able to reproduce a crash in several runs.  Might be that
48698ead6f or earlier changes have closed the races.  In case crashes
with just enabled tests are registered, I will either work on them or
disable tests again.
2024-05-06 15:27:32 -07:00
Gleb Smirnoff
570685971c lagg: propagate up/down to the children
Based on the old submission from asomers@.  With modern state of locking
in lagg(4), the patch got much simplier.  Enable the test that was
waiting for this change.

PR:			226144
Reviewed by:		asomers
Differential Revision:	https://reviews.freebsd.org/D44605
2024-05-06 15:27:32 -07:00
Gleb Smirnoff
e9b411d273 tests/fusefs: fix all tests that depend on kern.maxphys
The tests try to read kern.maxphys sysctl into int value, while
unsigned long is required.  Not sure when this was broken, seems like
since cd85379104.

Reviewed by:		asomers
Differential Revision:	https://reviews.freebsd.org/D45053
2024-05-06 12:03:20 -07:00
Gleb Smirnoff
0c0146c309 tests/sendfile: test operation on unix/stream socket
Although there are already multiple tests in the tests collection
that utilize sendfile(2) support over unix/stream socket, they all
don't exercise the asynchronous part of the operation.  This test
framework, however, uses a trick to toggle true async operation and
guarantee that pr_ready method of unix/stream is also tested.

Reviewed by:		chs
Differential Revision:	https://reviews.freebsd.org/D45055
2024-05-03 07:45:07 -07:00
Gleb Smirnoff
c368d3f20f tests/sendfile: factor out tcp_socketpair()
It creates a pair of connected TCP sockets for later testing.  No
functional change.

Reviewed by:		chs
Differential Revision:	https://reviews.freebsd.org/D45054
2024-05-03 07:45:06 -07:00
Kristof Provost
bf8988187f pf tests: fix REQUIRED_MODULES typo
This ensures we don't try to run the nat66 tests if pf is not loaded.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-05-03 09:51:37 +02:00
Gleb Smirnoff
19307b86d3 accept_filter: return different errors for non-listener and a busy socket
The fact that an accept filter needs to be cleared first before setting to
a different one isn't properly documented.  The requirement that the
socket needs already be listening, although trivial, isn't documented
either.  At least return a more meaningful error than EINVAL for an
existing filter.  Cover this with a test case.
2024-04-24 21:55:58 -07:00
Gleb Smirnoff
c68eed82a3 accf_tls: accept filter that waits for TLS handshake header 2024-04-24 17:53:10 -07:00
Mark Johnston
c0f1323241 wg tests: Add a simple regression test case for netmap support
MFC after:	1 month
Sponsored by:	Klara, Inc.
Sponsored by:	Zenarmor
2024-04-20 12:04:42 -04:00
Gleb Smirnoff
6655bec4e2 tests/unix_stream: test that send(2) of zero bytes is successful
Put this simple test into an existing file.  We don't have a designated
file for all unix/stream tests.  There is extensive unix_seqpacket_test,
but (at least right now) unix/seqpacket is not a superset of unix/stream,
but a different implementation.  We have one file that does one test for
unix/stream - unix_socketpair_test.  So rename it to unix_stream and start
collecting all unix/stream tests in it.
2024-04-14 10:19:20 -07:00
Jake Freeland
054a472059 tests: Add ktrace regression test for shm_open
Verify that a capability violation is recorded when shm_open(2) is called
with a non-anonymous path.

Approved by:	markj (mentor)
Reviewed by:	markj
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D44733
2024-04-09 21:19:03 -05:00
Gleb Smirnoff
0b49929762 tests/unix_seqpacket: remove workaround for a kernel bug that is no longer 2024-04-08 13:16:51 -07:00
Gleb Smirnoff
f992782124 tests/unix_seqpacket: test send(2) to a closed or aborted peer socket
In both cases the kernel returns EPIPE and delivers SIGPIPE, unless
blocked or disabled.  The test isn't specific to SOCK_SEQPACKET, it is the
same for SOCK_STREAM.  Put the test into this file, since it has all
primitives to write this test tersely.

Reviewed by:		tuexen
Differential Revision:	https://reviews.freebsd.org/D44146
2024-04-08 13:16:50 -07:00
Gleb Smirnoff
eb338e2370 tests/unix_seqpacket: provide random data pumping test with MSG_EOR
Allocate a big chunk of randomly initialized memory.  Send it to the peer
in random sized chunks, throwing MSG_EOR at randomly initialized offsets.
Receive into random sized chunks setting MSG_WAITALL randomly.  Check that
MSG_EORs where they should be, check that MSG_WAITALL is abode, but
overriden by MSG_EOR.  And finally memcmp() what we receive.

Reviewed by:		asomers, tuexen
Differential Revision:	https://reviews.freebsd.org/D43775
2024-04-08 13:16:50 -07:00
Jake Freeland
2f39a98664 tests: Add ktrace capability violation test cases
Introduce regression tests for ktrace(2) that target capability
violations.

These test cases ensure that ktrace(2) records these violations:
- CAPFAIL_NOTCAPABLE
- CAPFAIL_INCREASE
- CAPFAIL_SYSCALL
- CAPFAIL_SIGNAL
- CAPFAIL_PROTO
- CAPFAIL_SOCKADDR
- CAPFAIL_NAMEI
- CAPFAIL_CPUSET

A portion of these test cases create processes that do NOT enter
capability mode, but raise violations. This is intended behavior.
Users may run `ktrace -t p` on non-Capsicumized programs to detect
violations that would occur if the process were in capability mode.

Reviewed by:	markj
Approved by:	markj (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D40682
2024-04-07 18:52:51 -05:00
Dag-Erling Smørgrav
584e1c355a tarfs: Ignore global extended headers.
Previously, we would error out if we encountered a global extended
header, because we don't know what it means.  This doesn't really
matter though, and traditionally, tar implementations have either
ignored them or treated them as plain files, so just ignore them.
This allows tarfs to mount tar files created by `git archive`.

MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D44600
2024-04-03 11:55:06 +02:00
Dag-Erling Smørgrav
b1fd95c9e2 tarfs: Support paths that spill into exthdrs.
MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D44599
2024-04-03 11:55:01 +02:00
Mark Johnston
77c3e564b4 ptrace tests: Fix a signed/unsigned integer comparison
Reported by:	Jenkins
Fixes:	43b4da4411 ("ptrace tests: Add a test using PROC_REAP_KILL to kill a traced debuggee")
2024-04-01 19:12:50 -04:00
Mark Johnston
43b4da4411 ptrace tests: Add a test using PROC_REAP_KILL to kill a traced debuggee
This exercises the bug fix in commit 9241ebc796
("thread_single(9): decline external requests for traced or debugger-stopped procs").

Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D44564
2024-03-31 14:11:47 -04:00
Kristof Provost
a983cea4e9 pf: fix reply-to after rdr and dummynet
If we redirect a packet to localhost and it gets dummynet'd it may be
re-injected later (e.g. when delayed) which means it will be passed
through ip_input() again. ip_input() will then reject the packet because
it's directed to the loopback address, but did not arrive on a loopback
interface.

Fix this by having pf set the rcvif to V_iflo if we redirect to
loopback.

See also:	https://redmine.pfsense.org/issues/15363
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-03-28 17:06:01 +01:00
Gleb Smirnoff
75d15e893b netpfil tests: disable ICMPv6 rate limiting in the test jail
The dummynet test uses flood ping as source of traffic, so the rate
limiting of ICMP replies broke the test.

Fixes:	32aeee8ce7
2024-03-24 19:54:34 -07:00
Gleb Smirnoff
3f3d19d802 tests/netinet: fix UDP I/O test build
Fixes:	8d3d9ca8bd
2024-03-23 09:21:13 -07:00
Gleb Smirnoff
a8edc9f1e3 tests/netgraph: start ng_ksocket(4) tests
The ng_ksocket(4) functionality is very fragile as it interfaces with
kernel socket code in unusual way.  It definitely needs a test suite.
Start one with a test that tests UDP over IPv4.
2024-03-22 22:44:16 -07:00
Gleb Smirnoff
8d3d9ca8bd tests/netinet: add UDP socket I/O tests
Start a file that would collect tests for I/O functionality of a UDP
socket, targeted on how a socket interacts with userland rather than with
wire side of the protocol.

First version tests that MSG_TRUNC and MSG_PEEK are working correctly.
2024-03-22 22:44:16 -07:00
Gleb Smirnoff
fbbb50f570 tests/netgraph: mark all tests as required_user="root"
Any netgraph operation requires root priveleges.  Some tests in the
directory already mark themselves with 'atf_tc_set_md_var(conf,
"require.user", "root");' which creates a lot of pasted code.  Some tests
don't mark self.  For this particular directory a blanket metadata setting
in the Makefile is acceptable, imho.
2024-03-22 19:50:33 -07:00
Kristof Provost
e08b44339b if_ovpn tests: test large packets in IPv6 tunnel
There's a report of MTU issues over IPv6 DCO tunnels.
Extend the 4in6 test to send a series of pings with different sizes, as
well as transfer a large file.

No issues were found, but we may as well extend the test case.

PR:		276838
2024-03-22 09:00:05 +01:00
Kristof Provost
470a2b3346 pf: convert DIOCSETSTATUSIF to netlink
While here also add a basic test case for it.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D44368
2024-03-19 16:30:08 +01:00