LTP testcase kernel/syscalls/quotactl/quotactl09 --444783-- WARNING: unhandled amd64-linux syscall: 443 --444783-- You may be able to write your own handler. --444783-- Read the file README_MISSING_SYSCALL_OR_IOCTL. --444783-- Nevertheless we consider this a bug. Please report --444783-- it at http://valgrind.org/support/bug_reports.html. Note, needs root.
Created attachment 185009 [details] proposed patch
(In reply to mcermak from comment #1) > Created attachment 185009 [details] > proposed patch It looks like the new syscall number is 443 for all linux arches, so maybe it can be defined once in include/vki/vki-scnums-shared-linux.h ? > +PRE(sys_quotactl_fd) > +{ > + PRINT("sys_quotactl (0x%" FMT_REGWORD "x, 0x%#" FMT_REGWORD "x, 0x%" > + FMT_REGWORD "x, 0x%" FMT_REGWORD "x )", ARG1, ARG2, ARG3, ARG4); > + PRE_REG_READ4(long, "quotactl_fd", > + unsigned int, cmd, unsigned int, cmd, vki_qid_t, id, > + void *, addr); > +} The first argument is a file descriptor which we normally check specially so no valgrind internal file descriptor are used and to track file descriptors with --track-fds. Something like: if (!ML_(fd_allowed)(ARG1, "quotactl_fd", tid, False)) SET_STATUS_Failure( VKI_EBADF ); Checking of the addr argument is a little tricky. Depending on the cmd it can point to various things of different sizes (or be totally ignored). It might require a POST handler if some datastructure is set by the syscall. It looks like the quotactl wrapper also doesn't handle the addr pointer. They should be handled similarly so. You could do this as a followup bug/patch. If you decide not to handle it now then please file a bug report so we won't forget.
Created attachment 185042 [details] updated patch Thank you for the review. I've filed https://bugs.kde.org/show_bug.cgi?id=509634 and attached updated patch. Please check.
Created attachment 185059 [details] updated patch Forgot to squash the previous partial patch to its predecesor. Please check this updated patch.
(In reply to mcermak from comment #4) > Created attachment 185059 [details] > updated patch > > Forgot to squash the previous partial patch to its predecesor. Please check > this updated patch. Looks good. Pushed as: commit 553ada14844625f43a1ec445addfa1ab88ee0e26 Author: Martin Cermak <mcermak@redhat.com> Date: Wed Sep 17 16:08:05 2025 +0200 Wrap the quotactl_fd syscall SYSCALL_DEFINE4(quotactl_fd, unsigned int, fd, unsigned int, cmd, qid_t, id, void __user *, addr) The quotactl_fd works in a similar way to quotactl. They both manipulate disk quotas. They differ in how the target file system is specified. While quotactl takes path, quotactl_fd takes a file descriptor. Declare a quotactl_fd wrapper in priv_syswrap-linux.h and hook it for {amd64,arm,arm64,mips64,ppc32,ppc64,riscv64,s390x,x86}-linux using LINX_ with PRE handler in syswrap-linux.c https://bugs.kde.org/show_bug.cgi?id=509567