From: Matthias S. <zz...@ge...> - 2025-06-28 14:22:12
|
I have one observation to that change. see below. Am 27.06.25 um 23:20 schrieb Mark Wielaard: > https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=57152acfc6a82baa58f0d2fa0409290278bafde7 > > commit 57152acfc6a82baa58f0d2fa0409290278bafde7 > Author: Martin Cermak <mc...@re...> > Date: Fri Jun 27 22:36:03 2025 +0200 > > 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 > > Diff: > --- > NEWS | 1 + > coregrind/m_syswrap/priv_syswrap-linux.h | 4 +++ > coregrind/m_syswrap/syswrap-amd64-linux.c | 2 ++ > coregrind/m_syswrap/syswrap-arm-linux.c | 2 ++ > coregrind/m_syswrap/syswrap-arm64-linux.c | 2 ++ > coregrind/m_syswrap/syswrap-linux.c | 53 ++++++++++++++++++++++++++++ > coregrind/m_syswrap/syswrap-mips32-linux.c | 2 ++ > coregrind/m_syswrap/syswrap-mips64-linux.c | 2 ++ > coregrind/m_syswrap/syswrap-nanomips-linux.c | 2 ++ > coregrind/m_syswrap/syswrap-ppc32-linux.c | 2 ++ > coregrind/m_syswrap/syswrap-ppc64-linux.c | 2 ++ > coregrind/m_syswrap/syswrap-riscv64-linux.c | 2 ++ > coregrind/m_syswrap/syswrap-s390x-linux.c | 2 ++ > coregrind/m_syswrap/syswrap-x86-linux.c | 2 ++ > include/vki/vki-linux.h | 37 +++++++++++++++++++ > include/vki/vki-scnums-shared-linux.h | 2 ++ > 16 files changed, 119 insertions(+) > > diff --git a/NEWS b/NEWS > index 0d9cc798ec..c1940b56ce 100644 > --- a/NEWS > +++ b/NEWS > @@ -44,6 +44,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. > 504936 Add FreeBSD amd64 sysarch subcommands AMD64_SET_TLSBASE and > AMD64_GET_TLSBASE > 505228 Wrap linux specific mseal syscall > +502968 Wrap linux specific syscalls 457 (listmount) and 458 (statmount) > > To see details of a given bug, visit > https://bugs.kde.org/show_bug.cgi?id=XXXXXX > diff --git a/coregrind/m_syswrap/priv_syswrap-linux.h b/coregrind/m_syswrap/priv_syswrap-linux.h > index ed8cb4ed50..9e6cb89811 100644 > --- a/coregrind/m_syswrap/priv_syswrap-linux.h > +++ b/coregrind/m_syswrap/priv_syswrap-linux.h > @@ -355,6 +355,10 @@ DECL_TEMPLATE(linux, sys_pidfd_getfd); > // Since Linux 6.6 > DECL_TEMPLATE(linux, sys_fchmodat2); > > +// Since Linux 6.8 > +DECL_TEMPLATE(linux, sys_listmount); > +DECL_TEMPLATE(linux, sys_statmount); > + > // Since Linux 6.10 > DECL_TEMPLATE(linux, sys_mseal); > > diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c > index 292e969fc1..22989f9fa5 100644 > --- a/coregrind/m_syswrap/syswrap-amd64-linux.c > +++ b/coregrind/m_syswrap/syswrap-amd64-linux.c > @@ -904,6 +904,8 @@ static SyscallTableEntry syscall_table[] = { > > LINXY(__NR_cachestat, sys_cachestat), // 451 > LINX_(__NR_fchmodat2, sys_fchmodat2), // 452 > + LINXY(__NR_statmount, sys_statmount), // 457 > + LINXY(__NR_listmount, sys_listmount), // 458 > LINX_(__NR_mseal, sys_mseal), // 462 > }; > > diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c > index 6d7db0425b..7bd69b6817 100644 > --- a/coregrind/m_syswrap/syswrap-arm-linux.c > +++ b/coregrind/m_syswrap/syswrap-arm-linux.c > @@ -1075,6 +1075,8 @@ static SyscallTableEntry syscall_main_table[] = { > > LINXY(__NR_cachestat, sys_cachestat), // 451 > LINX_(__NR_fchmodat2, sys_fchmodat2), // 452 > + LINXY(__NR_statmount, sys_statmount), // 457 > + LINXY(__NR_listmount, sys_listmount), // 458 > LINX_(__NR_mseal, sys_mseal), // 462 > }; > > diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c > index 2d6b45f916..40eb654324 100644 > --- a/coregrind/m_syswrap/syswrap-arm64-linux.c > +++ b/coregrind/m_syswrap/syswrap-arm64-linux.c > @@ -855,6 +855,8 @@ static SyscallTableEntry syscall_main_table[] = { > > LINXY(__NR_cachestat, sys_cachestat), // 451 > LINX_(__NR_fchmodat2, sys_fchmodat2), // 452 > + LINXY(__NR_statmount, sys_statmount), // 457 > + LINXY(__NR_listmount, sys_listmount), // 458 > LINX_(__NR_mseal, sys_mseal), // 462 > }; > [...]> diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c > index 5edae82c31..734f129c87 100644 > --- a/coregrind/m_syswrap/syswrap-mips32-linux.c > +++ b/coregrind/m_syswrap/syswrap-mips32-linux.c > @@ -1182,6 +1182,8 @@ static SyscallTableEntry syscall_main_table[] = { > > LINXY(__NR_cachestat, sys_cachestat), // 451 > LINX_(__NR_fchmodat2, sys_fchmodat2), // 452 > + LINX_(__NR_statmount, sys_statmount), // 457 > + LINX_(__NR_listmount, sys_listmount), // 458 > LINX_(__NR_mseal, sys_mseal), // 462 > }; > This hunk adds LINX_-entries for mips32. In contrast all other archs use the macro LINXY. Regards Matthias |