]> git.ipfire.org Git - thirdparty/valgrind.git/commit
Wrap linux specific syscalls 457 (listmount) and 458 (statmount)
authorMartin Cermak <mcermak@redhat.com>
Fri, 27 Jun 2025 20:36:03 +0000 (22:36 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 27 Jun 2025 20:52:01 +0000 (22:52 +0200)
commit57152acfc6a82baa58f0d2fa0409290278bafde7
tree581c8ddfc0928a5528e24738aa67a24e3155de51
parent2942c04c485076d84a2df8ee6bb901bb0f014c51
Wrap linux specific syscalls 457 (listmount) and 458 (statmount)

The listmount syscall returns a list of mount IDs under the req.mnt_id.
This is meant to be used in conjunction with statmount(2) in order to
provide a way to iterate and discover mounted file systems.

The statmount syscall returns information about a mount, storing it in
the buffer pointed to by smbuf.  The returned buffer is a struct
statmount which is of size bufsize.

Declare a sys_{lis,sta}tmount wrapper in priv_syswrap-linux.h and hook it
for {amd64,arm,arm64,mips64,nanomips,ppc32,ppc64,riscv64,s390x,x86}-linux
using LINXY with PRE and POST handler in syswrap-linux.c

Both syscalls need CAP_SYS_ADMIN, to successfully test.

Resolves: https://bugs.kde.org/show_bug.cgi?id=502968
16 files changed:
NEWS
coregrind/m_syswrap/priv_syswrap-linux.h
coregrind/m_syswrap/syswrap-amd64-linux.c
coregrind/m_syswrap/syswrap-arm-linux.c
coregrind/m_syswrap/syswrap-arm64-linux.c
coregrind/m_syswrap/syswrap-linux.c
coregrind/m_syswrap/syswrap-mips32-linux.c
coregrind/m_syswrap/syswrap-mips64-linux.c
coregrind/m_syswrap/syswrap-nanomips-linux.c
coregrind/m_syswrap/syswrap-ppc32-linux.c
coregrind/m_syswrap/syswrap-ppc64-linux.c
coregrind/m_syswrap/syswrap-riscv64-linux.c
coregrind/m_syswrap/syswrap-s390x-linux.c
coregrind/m_syswrap/syswrap-x86-linux.c
include/vki/vki-linux.h
include/vki/vki-scnums-shared-linux.h