From e87c2551e8b5d4e77b43669085b7917fd4620634 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Sun, 29 Dec 2024 16:28:08 +1300 Subject: [PATCH] Support `mount_setattr` syscall --- src/syscalls.py | 2 +- src/test/fsmount.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/syscalls.py b/src/syscalls.py index e07ff36c42d..0c31c183678 100644 --- a/src/syscalls.py +++ b/src/syscalls.py @@ -1734,7 +1734,7 @@ def __init__(self, **kwargs): pidfd_getfd = EmulatedSyscall(all=438) process_madvise = UnsupportedSyscall(all=440) epoll_pwait2 = IrregularEmulatedSyscall(all=441) -mount_setattr = UnsupportedSyscall(all=442) +mount_setattr = EmulatedSyscall(all=442) quotactl_fd = UnsupportedSyscall(all=443) landlock_create_ruleset = EmulatedSyscall(all=444) landlock_add_rule = EmulatedSyscall(all=445) diff --git a/src/test/fsmount.c b/src/test/fsmount.c index 7f9c244bbed..5d481da16ac 100644 --- a/src/test/fsmount.c +++ b/src/test/fsmount.c @@ -3,6 +3,8 @@ #include "nsutils.h" #include "util.h" +#include + int main(void) { if (try_setup_ns(CLONE_NEWNS) < 0) { atomic_puts("EXIT-SUCCESS"); @@ -21,6 +23,11 @@ int main(void) { ret = syscall(RR_move_mount, mnt_fd, "", AT_FDCWD, "/tmp", MOVE_MOUNT_F_EMPTY_PATH); test_assert(ret == 0); + struct mount_attr attr; + memset(&attr, 0, sizeof(attr)); + ret = syscall(RR_mount_setattr, mnt_fd, "", AT_EMPTY_PATH, &attr, sizeof(attr)); + test_assert(ret == 0); + atomic_puts("EXIT-SUCCESS"); return 0; }