89 Commits

Author SHA1 Message Date
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
Andrei Vagin f010ae01ac Fix a few typos 2025-01-29 21:16:51 -08:00
Jamie Liu cf5841ba66 mm: implement prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME)
PiperOrigin-RevId: 696727156
2024-11-14 19:06:07 -08:00
gVisor bot b1d7ceafb1 Merge pull request #10721 from p12tic:expose-fake-cpuinfo-cache
PiperOrigin-RevId: 660077238
2024-08-06 13:33:39 -07:00
Povilas Kanapickas a6196f3670 procfs: add cache size x86 cpuinfo field
Linux prints this field when cache information is available. This field
is conditional (see arch/x86/kernel/cpu/proc.c:x86_cache_size()). It a
different meaning and implementation on each vendor. For example, as of
Linux 6.1.0 it returns LLC size on Intel and L2 size on AMD CPUs.

Even though usefullness of this field in its current implementation
debatable, some relatively popular software such as PyPy (as of 7.3.11)
relies on it and prints a warning if it is not available.
2024-08-06 11:18:52 +03:00
gVisor bot 7a05c225f5 Merge pull request #10722 from p12tic:fix-cpuinfo-comment
PiperOrigin-RevId: 659596152
2024-08-05 10:24:36 -07:00
Povilas Kanapickas 2b57ea1692 test/syscalls/proc: Update comment about required_fields on x86
The previous comment has been no longer correct at least since
f84a013407, as conditional cpuinfo fields
are now checked too.
2024-08-04 17:17:19 +03:00
Jamie Liu f84a013407 procfs: add topology-related x86 cpuinfo fields
Linux prints these fields when the kernel is built with support for multiple
processors/cores (CONFIG_SMP), in
arch/x86/kernel/cpu/proc.c:show_cpuinfo_core().

Fixes #10205

PiperOrigin-RevId: 632621375
2024-05-10 15:46:45 -07:00
Jamie Liu a78cff7f8d kernfs: invalidate descendants of dentries failing revalidation
Adapted from cl/630063475.

This causes FUSE tests involving submounts to fail, because fuse.inode.Valid()
just returns false (fails revalidation) after the entry time expires, causing
all submounts to be unmounted; change it to perform revalidation instead, a la
Linux's fs/fuse/dir.c:fuse_dentry_revalidate(). This in turn requires that we
plumb the dentry's parent and name through kernfs.Inode.Valid().

PiperOrigin-RevId: 630476483
2024-05-03 13:13:36 -07:00
Jonathon Belotti 0c99e86f01 provide (read only) /proc/sys/kernel/overflowuid and overflowgid 2023-11-09 16:15:17 +00:00
Andrei Vagin 65e518c741 proc: limit a comm len to TASK_COMM_LEN
PiperOrigin-RevId: 580532321
2023-11-08 07:50:23 -08:00
gVisor bot 7594667507 Internal change.
PiperOrigin-RevId: 568695436
2023-09-26 17:35:33 -07:00
Andrei Vagin 62fae30016 proc: add /proc/sys/kernel/cap_last_cap
PiperOrigin-RevId: 559932636
2023-08-24 18:29:31 -07:00
Shambhavi Srivastava 3657484eee Adding /proc/[pid]/task/[tid]/children
PiperOrigin-RevId: 557888186
2023-08-17 11:41:48 -07:00
gVisor bot fdaf777344 Internal change.
PiperOrigin-RevId: 540338096
2023-06-14 11:56:16 -07:00
gVisor bot 2ca109d47c Internal change.
PiperOrigin-RevId: 540319250
2023-06-14 10:56:23 -07:00
Andrei Vagin 6e719b44ce Fix all c++ compile time warnings 2023-03-09 19:01:00 -08:00
gVisor bot d94ff26acc Fix /proc/*/stat parsing in GVisor
The code in GVisor relied on the process name not containing whitespace when
parsing /proc/*/stat. This CL fixes that by moving parsing to its own function,
implemented properly.

PiperOrigin-RevId: 511616209
2023-02-22 15:43:14 -08:00
Nicolas Lacasse 020832b2c6 Allow setting thread name by writing to /proc/pid/task/tid.
Test that thread can set its own thread, or peer thread in the same thread
group.

PiperOrigin-RevId: 510595880
2023-02-17 21:49:21 -08:00
Jamie Liu 543e8a2256 Fix flakes in tests that use munmap() to create deliberate MM holes.
PiperOrigin-RevId: 479623755
2022-10-07 11:09:09 -07:00
gVisor bot 8e0dc959b4 Merge pull request #7976 from cedriccchen:proc
PiperOrigin-RevId: 474861876
2022-09-16 11:32:03 -07:00
Chen Hui 479784577d procfs: support /proc/[pid]/root file
Signed-off-by: Chen Hui <cedriccchen@tencent.com>
2022-09-16 12:40:08 +08:00
Sergey Madaminov 60698ceed3 A procfs file for runtime heap usage information for sentry.
Added a mechanism to query runtime sentry heap usage using procfs from inside
the sandbox. This may help with providing insight regarding sandbox hitting the
memory limit on the host despite reporting a lower application memory usage.
And added a test to `proc.cc`.

PiperOrigin-RevId: 470061488
2022-08-25 12:58:43 -07:00
Ayush Ranjan 8011b8d6d2 Make anonfs return ENOTDIR for open(O_DIRECTORY) calls.
All anonfs dentries are non-directories. So all FilesystemImpl
methods that would require an anonDentry to be a directory should
return ENOTDIR.

PiperOrigin-RevId: 455271653
2022-06-15 19:07:24 -07:00
Ayush Ranjan 37ce125750 Remove VFS1 special handling in tests.
Also clean up usage of GVISOR_VFS environment variable.
Updates #1624

PiperOrigin-RevId: 429100450
2022-02-16 11:41:51 -08:00