14 Commits
Author SHA1 Message Date
Shailend ChandandgVisor bot d3cfc9f70e Fix SetAndGetBooleanSocketOptions on Linux 6.16+ hosts
Since Linux 6.16 (7d8d93fdde50), SO_PASSCRED is restricted to AF_UNIX,
AF_NETLINK, and AF_BLUETOOTH sockets; getsockopt on inet sockets fails
with EOPNOTSUPP. This surfaces natively on new kernels and through
hostinet passthrough, while netstack keeps the old semantics. Accept
either behavior.

PiperOrigin-RevId: 968655712
2026-08-21 13:26:59 -07:00
Jeff MartinandgVisor bot a06dd585f5 [tests] Remove direct dependency on linux_capability_util
Instead, rely on the indirection through "capability_util", which is platform
agnostic. This ensures tests can be run against Linux and Fuchsia.

PiperOrigin-RevId: 884457389
2026-03-16 08:47:31 -07:00
Shailend ChandandgVisor bot 4c77fa8b9a Fix creds checks for SO_RCVBUFFORCE and UCOUNT_RLIMIT_NPROC
PiperOrigin-RevId: 853451466
2026-01-07 16:16:29 -08:00
Andrei VaginandgVisor bot 28ee0fc3c6 test: don't check SO_REUSEPORT for non-inet sockets
AllSocketPairTest.SetAndGetBooleanSocketOptions fails on the upstream linux
kernel. The behaviour has been changed by 5b0af621c3f6 ("net: restrict
SO_REUSEPORT to inet sockets").

PiperOrigin-RevId: 722774180
2025-02-03 13:26:03 -08:00
Andrei Vagin 67266e9403 Fix a few typos 2025-01-29 21:16:51 -08:00
Nayana BidariandgVisor bot 9d0225aa69 Deflake socket_ip_tcp_loopback_test with S/R.
BasicSendmmsg test times out with S/R, disable the test.

PiperOrigin-RevId: 632377669
2024-05-09 22:30:52 -07:00
Nicolas LacasseandgVisor bot d2044eff24 Enable socket_ip_{udp,tcp}_loopback_test_runsc_ptrace_hostnet tests.
Fixes:
* Pass through some more recvmmsg flags.
* Pass through some more get/setsockopt flags.
* Allow IP_MULTICAST_LOOP/TTL to have variable size, since it can be 8 or 32
  bits.
* Convert IPPROTO_IP to IPPROTO_TCP/UDP so it can be returned properly by
  getsockopt(SO_PROTO).
* Disable one test that requires CAP_SYS_ADMIN on the host. Will have to come
  back to these.
PiperOrigin-RevId: 508938466
2023-02-11 16:17:52 -08:00
Nicolas LacasseandgVisor bot cceb6f7715 Fix socket_ip_tcp_generic_loopback_test_runsc_ptrace_hostnet
This was mostly a matter of allowing more get/setsockopts. Also had to support
getsockopt with a null option, because apparantly Linux allows that.

PiperOrigin-RevId: 508460614
2023-02-09 13:32:17 -08:00
Peter JohnstonandgVisor bot fc16cc1721 Increase SO_RCVTIMEO for RecvTimeoutWaitAll syscall test
The timeout is currently 200ms and causes occasionally flakes in Fuchsia infra
(https://fxbug.dev/112974). Increase it to 1s.

Fixes #8140

PiperOrigin-RevId: 486141423
2022-11-04 08:04:44 -07:00
Nayana BidariandgVisor bot b1efed29d0 Silence the error log message for SO_RCVLOWAT option.
Removed the unimplemented syscall message for SO_RCVLOWAT option and added a
test for {g,s}etsockopt.

PiperOrigin-RevId: 438145815
2022-03-29 15:48:33 -07:00
Nayana BidariandgVisor bot 844a74f8da Add a test for minimum receive buffer size used in setsockopt.
In Linux, the minimum buffer size used in setsockopt for SO_SNDBUF and
SO_RCVBUF option is the value defined in SOCK_MIN_RCVBUF and SOCK_MIN_SNDBUF.
(These values depend on the struct sk_buff size).

The minimum buffer size for SO_RCVBUF in gVisor is 4KiB. Since the value in
Linux is based on sk_buff size, it is not useful to have the same limits set
in gVisor. Added a syscall test to verify the minimum receive buffer size.

PiperOrigin-RevId: 421642931
2022-01-13 13:18:26 -08:00
Ghanan GowripalanandgVisor bot 129cc47c63 Move socket_test_util to //test/util
...and rename the library to socket_util.

PiperOrigin-RevId: 386348306
2021-07-22 16:37:15 -07:00
Kevin KrakauerandgVisor bot 2b42259663 netstack: support SO_RCVBUFFORCE
TCP is fully supported. As with SO_RCVBUF, other transport protocols perform
no-ops per DefaultSocketOptionsHandler.OnSetReceiveBufferSize.

PiperOrigin-RevId: 385023239
2021-07-15 15:34:34 -07:00
Andrei VaginandgVisor bot 0d828f36a6 unix: sendmmsg and recvmsg have to cap a number of message to UIO_MAXIOV
Reported-by: [email protected]
PiperOrigin-RevId: 358866218
2021-02-22 11:51:30 -08:00