]> git.ipfire.org Git - thirdparty/valgrind.git/commit
Filter Valgrind FDs from getdents syscalls
authorAlexandra Hájková <ahajkova@redhat.com>
Tue, 12 Aug 2025 16:17:54 +0000 (12:17 -0400)
committerAlexandra Hájková <ahajkova@redhat.com>
Wed, 24 Sep 2025 17:00:09 +0000 (19:00 +0200)
commite8e4066c3a0160f03d9dfffaa360b65eb79745d1
treebe6c628c6c410f666c96f66c41d1591a1bb7168e
parentd8cf0a84b26ff1ed1b5a9560bfbe5bf476f10c3a
Filter Valgrind FDs from getdents syscalls

This change prevents client programs from seeing Valgrind's internal file
descriptors when scanning /proc/self/fd or /proc/<pid>/fd.

This patch modifies the getdents and getdents64 syscall wrappers to
selectively filter out Valgrind's internal file descriptors only when
listing /proc/*/fd directories for the current process.

Add none/tests/getdents_filter.vgtest test that tests that the
Valgrind's file descriptors are hidden from the client program
and verifies both /proc/self/fd filtering and that regular
directory listings remain unfiltered.

https://bugs.kde.org/show_bug.cgi?id=331311
.gitignore
NEWS
coregrind/m_syswrap/syswrap-generic.c
none/tests/Makefile.am
none/tests/getdents_filter.c [new file with mode: 0644]
none/tests/getdents_filter.stderr.exp [new file with mode: 0644]
none/tests/getdents_filter.stdout.exp [new file with mode: 0644]
none/tests/getdents_filter.vgtest [new file with mode: 0644]