1677 Commits
Author SHA1 Message Date
Lucas ManningandgVisor bot 129d4b63a7 Add support for more TPU devices.
PiperOrigin-RevId: 737696637
2025-03-17 11:53:29 -07:00
Nayana BidariandgVisor bot e6b6f2aa11 Allow IPv6 addresses to be enabled/disabled in runsc based on the sysctl.
By default in runsc, we have both IPv4 and IPv6 addresses enabled on all the
interfaces. However, in runc this is based on the sysctl
net.ipv6.conf.all.disable_ipv6. This CL will make runsc behave similar to runc.
- If net.ipv6.conf.all.disable_ipv6 is > 0, then only IPv4 addresses will be
enabled on the interfaces including loopback when network mode is "sandbox".

PiperOrigin-RevId: 737656607
2025-03-17 10:10:46 -07:00
Ayush RanjanandgVisor bot 06f2254962 Deflake TestExecProcList.
There is a race in the test where the goroutine running Container.executeSync()
calls WaitPID() => IsSandboxRunning() which accesses Container.Sandbox.

This can race with the defer Container.Destroy which sets Sandbox = nil.

This race was introduced in 0968254ce7 ("Speed up container_test") which got
rid of the read on channel `ch`.

Fix the race by exec-ing asynchronously. This maintains the old behavior of not
checking if the exit status of sleep.

Fixes 0968254ce7 ("Speed up container_test")

PiperOrigin-RevId: 736572600
2025-03-13 11:18:16 -07:00
Ayush RanjanandgVisor bot 906fb319cc nvproxy: Add option to use the device gofer optionally.
We always use the device gofer in runsc, because the sandbox's filesystem
does not have the GPU devices mounted in it.

PiperOrigin-RevId: 736316547
2025-03-12 17:08:54 -07:00
Nayana BidariandgVisor bot c68fb31992 Save runsc version in the metadata during save to compare it during restore.
PiperOrigin-RevId: 736035156
2025-03-12 01:02:48 -07:00
Jamie LiuandgVisor bot 44b9737347 Increase GOMAXPROCS during aio.GoQueue usage
PiperOrigin-RevId: 735048540
2025-03-08 23:52:19 -08:00
Michael PrattandgVisor bot 46833fbeee Allow prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME) through syscall filters
As of https://go.dev/cl/646095, the Go runtime calls
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME) when mapping memory to annotate
mappings in /proc/self/maps. Since this is a system call made throughout the
application lifetime, it needs to be allowed through the system call filters.

PiperOrigin-RevId: 734182524
2025-03-06 09:54:22 -08:00
Ayush RanjanandgVisor bot 138e98fb7d nvproxy: Refactor DriverVersion out to nvconf package.
This allows for runsc to be able to use DriverVersion without having to depend
on the entirety of nvproxy.

PiperOrigin-RevId: 733912696
2025-03-05 16:43:03 -08:00
Nayana BidariandgVisor bot c050619971 Fix spec validation for entrypoint.
The OCI spec has entrypoint as the first argument in specs.Process.Args.
During testing, we observed inconsistencies in entrypoint resolution: it
was resolved during checkpoint but not during restore (or vice versa),
leading to spec validation failures. This CL corrects this by comparing the
absolute paths of entrypoints in spec validation.

PiperOrigin-RevId: 733200146
2025-03-03 23:31:15 -08:00
Fabricio VoznikaandgVisor bot 0c17600995 Fix restore with pending exec session
Exec'd processes cannot be stitched back to the original caller
and are killed after restore. So ignore failures
to restore host FDs (generally stdio) that belong
to them.

Fixes #11439

PiperOrigin-RevId: 732972054
2025-03-03 10:30:25 -08: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
Ayush RanjanandgVisor bot 84670a4fc6 gofer: Fix bug when casting auth.K{U/G}ID to int.
auth.K{U/G}ID has type uint32. When uid = auth.NoID = math.MaxUint32, which is
intended to represent -1, and it is casted to int, it becomes 4294967295 on
64-bit systems as int is 8 bytes in size. So the == -1 check fails.

Fixed the bug by explicitly setting syscall args to -1 when uid.Ok() == false.
Similarly, fix the bug in runsc/fsgofer.

PiperOrigin-RevId: 728258705
2025-02-18 10:16:08 -08:00
Nayana BidariandgVisor bot d05a277ca3 Add checkpoint restore metrics.
- SandboxCheckpointedMetric and SandboxRestoredMetric are added for sandbox
metadata metric which indicate whether sandbox is checkpointed or restored.
- NumCheckpointedSandboxesMetric and NumRestoredSandboxesMetric are added at
the process level which will get the count of number of sandboxes being
checkpointed and restored.

PiperOrigin-RevId: 726797010
2025-02-14 00:00:09 -08:00
Etienne PerotandgVisor bot d1fe5aeae0 Fix error formatting log for post-restore hook errors.
PiperOrigin-RevId: 726780521
2025-02-13 22:52:47 -08:00
gVisor bot c8d5afe1d2 Merge pull request #11457 from stepancheg:state-file
PiperOrigin-RevId: 726147631
2025-02-12 12:15:52 -08:00
Stepan Koltsov 522d089494 [runsc] When mount files, add arguments to error message 2025-02-10 17:57:29 +00:00
Stepan Koltsov f0ac6d5c9f [runsc] Print file name when cannot load state file 2025-02-10 17:52:55 +00:00
Andrei Vagin f010ae01ac Fix a few typos 2025-01-29 21:16:51 -08:00
Nayana BidariandgVisor bot 1c38b6cbed Add levels for handling spec validation via flag.
Replaces the flag "unsafe-skip-restore-spec-validation" with
"restore-spec-validation" which allows the user to set the level of restore
spec validation such as ignore, warning or enforce. This allows user to skip
validation if required. By default, the flag will be set to "enforce" which
will perform spec validation.

This is a breaking change for users who have enabled
--unsafe-skip-restore-spec-validation flag. We advise these users to use the
new flag introduced in this change: --restore-spec-validation and set it to
"warning" or "ignore". This setting (--restore-spec-validation=warning) gives
the same behavior as when the old flag was enabled.

PiperOrigin-RevId: 719045616
2025-01-23 16:00:25 -08:00
Evan PhoenixandGitHub 9b66d5b49b Clarify -cgroupfs
This flag's behavior was removed back in 29234bc44b.
2025-01-18 17:13:16 -08:00
Nicolas LacasseandgVisor bot d22dedf3d5 Check all 3 stdio FDs to determine if terminal is connected to a pty.
Previously we were only looking at stdin, which could be a pty but other stdio
fds might be redirected. In that case, we can incorrectly end up using the
stdin fd as *the* console fd, and sending all stdout/stderr to that FD,
ignoring the redirect.

Note that the behavior was actually flaky because the mechanism for choosing
which stdio fd to treat as *the* pty fd is non-deterministic (due to the map
iteration in fdimport/fdimport.go:Import) and so sometimes we would choose
the correct one.

This CL also cleans up `argsFromProcess` and `argsFromCLI`, which were setting
their `FilePayload` unnecessarily, since it is always set in `Execute`.

Fixes #11350
Fixes #11349

PiperOrigin-RevId: 716733446
2025-01-17 11:15:59 -08:00
Andrei VaginandgVisor bot ca3c23db50 tests: Deflake socket_inet_loopback_isolated_test
This test case creates one connection, then it closes one end of it. After that
it waits for a linger timeout and tries to create the second connection with
the same client source port. The test is flaky if the second half of the fist
connection isn't closed before creating the second connection.

PiperOrigin-RevId: 715924851
2025-01-15 13:38:00 -08:00
gVisor bot b94ab73815 Merge pull request #11333 from benhurdelhey:ben-hurdelhey_data/fix-mount-setup-initial-userns-fallback
PiperOrigin-RevId: 713006567
2025-01-07 12:43:03 -08:00
gVisor bot 7aa4c49b0d Merge pull request #11291 from xianzhe-databricks:fix-uds-auth
PiperOrigin-RevId: 712981221
2025-01-07 11:25:40 -08:00
xianzhe-databricks c4f686f4e1 Add a new RPC ConnectWithCreds to allow gofer to connect to a unix domain socket with application's credentials 2025-01-03 17:50:06 +01:00