842 Commits
Author SHA1 Message Date
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
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
Etienne PerotandgVisor bot d1fe5aeae0 Fix error formatting log for post-restore hook errors.
PiperOrigin-RevId: 726780521
2025-02-13 22:52:47 -08: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
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 0a288288bb Merge pull request #11323 from cweld510:cweld/skip-spec-validation-unsafe
PiperOrigin-RevId: 710762980
2024-12-30 11:48:14 -08:00
cweld510 17b2c1b18b Add option to skip restore spec validation 2024-12-30 16:32:55 +00:00
Fabricio VoznikaandgVisor bot fb730ff784 Remove checkpoint_count from runsc wait --checkpoint
This is done because external callers are not able to know
the snapshot generation number from the outside.

PiperOrigin-RevId: 707979556
2024-12-19 11:48:10 -08:00
Nayana BidariandgVisor bot 0f8216cd30 Do not validate resources during restore.
PiperOrigin-RevId: 706820039
2024-12-16 13:37:39 -08:00
Ayush RanjanandgVisor bot 188a756ff3 Add validateMap() to compare maps correctly during OCI spec validation.
reflect.Equal() considers nil and empty maps/slices different. But from spec
validation perspective, they should be considered the same. So added
validateMap() generic utility to do the comparison correctly.

Also fixed the validation of spec.Process.Rlimits, which was an array of
structs. Apart from suffering from the said reflect.Equal() issue, it also
suffered from ordering comparison. A list of shuffled-but-same rlimits should
be restorable. Fixed it to use validateArray().

There were only 2 users of `validateStructMap` remaining. So removed it
switched its users to call validateStruct() directly.

Fixes #11248

PiperOrigin-RevId: 703302621
2024-12-05 17:22:26 -08:00
Kevin KrakauerandgVisor bot a8e963b095 remove outdated bug references for PTYs
PiperOrigin-RevId: 702986132
2024-12-04 22:43:42 -08:00
Nayana BidariandgVisor bot f2abd31367 Minor changes in spec validation method.
PiperOrigin-RevId: 702787172
2024-12-04 11:04:20 -08:00
gVisor bot 395c0ac172 Internal change.
PiperOrigin-RevId: 702043346
2024-12-02 12:08:23 -08:00
Etienne PerotandgVisor bot 1af6da4bdc Propagate NVIDIA driver capabilities to nvproxy and seccomp filters.
Updates #10856

PiperOrigin-RevId: 700440037
2024-11-26 13:21:46 -08:00
Etienne PerotandgVisor bot 19f5519ecf dumpfilter: Resolve --nvproxy-caps=all to only supported capabilities.
Updates #10856

PiperOrigin-RevId: 700372553
2024-11-26 09:50:08 -08:00
Etienne PerotandgVisor bot 004ed53163 nvproxy: Do capability-based segmentation for seccomp filters.
Updates #10856

PiperOrigin-RevId: 698599198
2024-11-20 18:54:57 -08:00
Nayana BidariandgVisor bot 151f3fb3bf Make changes to validate the spec for unknown or potential new fields.
PiperOrigin-RevId: 698534409
2024-11-20 15:07:55 -08:00
Etienne PerotandgVisor bot 6953ca0ca3 Add NVIDIA driver capability segmentation support to nvproxy.
This wraps `nvproxy`'s `ioctl` handlers with wrappers that are
driver-capability-aware, and initially populates the ABI tree
with all functions marked as being available for capabilities
`compute` and `utility`.

It is not yet possible for the user to specify which capability
they want to enable. This should not cause a regression for users
because the hardcoded effective capability set is the one that is
currently specified for all current handlers.

Updates #9452.
Updates #10856.

PiperOrigin-RevId: 697824737
2024-11-18 18:15:21 -08:00
Nayana BidariandgVisor bot cbba387571 Fix mount source validation.
PiperOrigin-RevId: 694560314
2024-11-08 10:50:39 -08:00