2601 Commits

Author SHA1 Message Date
gVisor bot 225a7bc0d2 Internal change.
PiperOrigin-RevId: 739263572
2025-03-21 12:32:21 -07:00
gVisor bot 25d30ccc2c Merge pull request #11529 from tianyuzhou95:albert/mmap-test
PiperOrigin-RevId: 738050948
2025-03-18 10:13:53 -07:00
Nicolas Lacasse 6b0a0af862 Implement basic packet mode support for ptys.
From man TIOCPKT:
"""
In packet mode, each subsequent read(2) will return a packet that either
contains a single nonzero control byte, or has a single byte containing zero
('\0') followed by data written on the slave side of the pseudoterminal."
"""

This CL implements only the data portion of packet mode, not the control bytes,
but that seems to be enough to get xfce4-terminal to work.

PiperOrigin-RevId: 737175092
2025-03-15 09:26:56 -07:00
Tianyu Zhou 970259d162 test/syscalls: fix the duplicate test case
Currently, the NoSigBusOnPagesBeforeEOF and NoSigBusOnPageContainingEOF
test cases are identical. This patch corrects the addr accessed in the
former test to match the corresponding comment.

Signed-off-by: Tianyu Zhou <albert.zty@antgroup.com>
2025-03-07 17:43:07 +08:00
Zach Koopmans 4ce00d28f6 Fix broken cuda tests
PiperOrigin-RevId: 734342887
2025-03-06 17:11:19 -08:00
Ayush Ranjan e699298d58 Add Container.RestoreInTest() to handle known Docker bugs.
This can be used by all test users. Avoids duplicated code. We can handle all
known issues in one place.

There is a Docker bug which causes restore to fail sporadically. See
https://github.com/moby/moby/issues/42900. This has been broken at least since
Docker v19.03.12 (when the issue was reported) and was fixed in v25.0.4. Added
the handling for this issue.

Also got rid of the testutil.Poll() around restore. That can hide gVisor
restore flakiness issues. That was added in 0990ef7517 ("Make
checkpoint/restore e2e test less flaky"). The original sleep has been restored.

PiperOrigin-RevId: 734303878
2025-03-06 15:13:16 -08:00
Fabricio Voznika c041d9bd58 Add missing binary_sha256 field
Fixes #11466

PiperOrigin-RevId: 734209881
2025-03-06 11:01:58 -08:00
gVisor bot 7d4b4bd634 Merge pull request #11495 from zkoopmans:cuda
PiperOrigin-RevId: 733445831
2025-03-04 13:35:08 -08:00
Ayush Ranjan f06d4e7ebe goferfs: Add S/R support for open FDs to deleted files.
This support is only needed when the gofer mount in question is writable.
By default, the rootfs has an overlayfs applied, so the gofer lower layer is
not writabled. But if you are using --overlay2=none, then this change should
allow you to save sandbox with open FDs to deleted files in rootfs.

Updates #11425

PiperOrigin-RevId: 733021267
2025-03-03 12:38:10 -08:00
Jamie Liu b4cc9c572d test/runner: ignore warnings about rlimits being lower than recommended
PiperOrigin-RevId: 732302179
2025-02-28 16:59:42 -08:00
Jamie Liu 4a157b8e90 test/runner: do not emit --gtest_filter=main.test
PiperOrigin-RevId: 732286578
2025-02-28 16:00:05 -08:00
Jamie Liu 3885a281f2 test: add syscall_test() perf argument
PiperOrigin-RevId: 732194076
2025-02-28 11:05:10 -08:00
zkoopmans 725669a152 Update cuda-tests for ARM workloads
Add image for ARM workloads for cuda-tests and mark tests that work on ARM.

Most tests don't work due to cross-compiling between sbma and aarch64.
However, a few do. Add an image to support them.
2025-02-27 21:55:38 +00:00
gVisor bot 86abc85f37 Merge pull request #11473 from Champ-Goblem:shim-add-cgroup-v2-metrics-support
PiperOrigin-RevId: 730560110
2025-02-25 14:52:09 -08:00
Jimmy Tran 17563a8af9 Return EACCES when calling setpgid() after execve()
From setpgid manpage,

EACCES - An attempt was made to change the process group ID of one
of the children of the calling process and the child had
already performed an execve(2) (setpgid(), setpgrp()).

This CL makes gVisor implement this rule and updates the exec test
suite accordingly.

TESTED: http://sponge2/7f364e8a-4f82-463e-ba62-79234c4d054d
PiperOrigin-RevId: 727095560
2025-02-14 16:14:14 -08:00
Lucas Manning 8555758760 Add a test for tcpdump.
PiperOrigin-RevId: 726094500
2025-02-12 09:59:11 -08:00
Lucas Manning faac8f36cd Add support for PACKET_STATISTICS.
PiperOrigin-RevId: 725271073
2025-02-10 10:46:54 -08:00
Lucas Manning 9c490f813d Implement GetSockOpt PACKET_HDRLEN and add a test for tcpdump.
PiperOrigin-RevId: 724445536
2025-02-07 13:06:14 -08:00
Jimmy Tran de6637c27c Recompute max variable after setting FD in the bitmap.
`fdBitmap.FirstZero()` could return `max` value; if it does, then
recompute the max value to avoid reusing the old max value twice.

The default bitmap size for file descriptors in gVisor is 65535.

Add a pipe test that attempts to create more than 65535 FDs to hit the edge
case where fdBitmap.FirstZero() returns the default bitmap max value of 65535.

TESTED:
http://sponge2/4c12ce75-3763-4773-ad62-87c6b8fe0446
http://sponge2/9c9d6ea0-b69c-432c-a16b-9446214109ba
PiperOrigin-RevId: 724410846
2025-02-07 11:22:54 -08:00
Lucas Manning 213917f3ea Don't switch to using the packet mmap endpoint for zero length requests.
This matches linux's behavior.

Reported-by: syzbot+31f4b63198c23c53c6e2@syzkaller.appspotmail.com
Reported-by: syzbot+e19f276e27cccbbecd0e@syzkaller.appspotmail.com
PiperOrigin-RevId: 724032784
2025-02-06 12:34:46 -08:00
Lucas Manning 6194338723 Add support for setting PACKET_VERSION for PACKET_MMAP.
tcpdump requires TPACKET_V2 to work properly.

PiperOrigin-RevId: 723670574
2025-02-05 15:19:34 -08:00
Lucas Manning 83a4caf2a7 Implement MappablePacketEndpoint for PACKET_MMAP and add tests.
PiperOrigin-RevId: 723590936
2025-02-05 11:39:27 -08:00
Nayana Bidari f6b843d9a6 Add tests with netstack s/r enabled.
PiperOrigin-RevId: 722790574
2025-02-03 14:12:03 -08:00
Andrei Vagin 3754522ab7 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
Jing Chen 4a09ec772e Allow crypto/tls in go runtime tests.
Fix #11338

PiperOrigin-RevId: 722699441
2025-02-03 10:06:02 -08:00