509642 Add missing ppc64-linux syswraps
509643 Add missing s390x-linux syswraps
510169 Update the LTP version in valgrind testsuite to 20250930
+510416 Missing syswraps for file_getattr and file_setattr
To see details of a given bug, visit
https://bugs.kde.org/show_bug.cgi?id=XXXXXX
// Since Linux 6.10
DECL_TEMPLATE(linux, sys_mseal);
+// Since Linux 6.17-rc1
+DECL_TEMPLATE(linux, sys_file_getattr);
+DECL_TEMPLATE(linux, sys_file_setattr);
+
/* ---------------------------------------------------------------------
Wrappers for sockets and ipc-ery. These are split into standalone
procedures because x86-linux hides them inside multiplexors
LINXY(__NR_statmount, sys_statmount), // 457
LINXY(__NR_listmount, sys_listmount), // 458
LINX_(__NR_mseal, sys_mseal), // 462
+ LINXY(__NR_file_getattr, sys_file_getattr), // 468
+ LINX_(__NR_file_setattr, sys_file_setattr), // 469
};
SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
LINXY(__NR_statmount, sys_statmount), // 457
LINXY(__NR_listmount, sys_listmount), // 458
LINX_(__NR_mseal, sys_mseal), // 462
+ LINXY(__NR_file_getattr, sys_file_getattr), // 468
+ LINX_(__NR_file_setattr, sys_file_setattr), // 469
};
LINXY(__NR_statmount, sys_statmount), // 457
LINXY(__NR_listmount, sys_listmount), // 458
LINX_(__NR_mseal, sys_mseal), // 462
+ LINXY(__NR_file_getattr, sys_file_getattr), // 468
+ LINX_(__NR_file_setattr, sys_file_setattr), // 469
};
}
}
+PRE(sys_file_getattr)
+{
+ // SYSCALL_DEFINE5(file_getattr, int, dfd, const char __user *, filename,
+ // struct file_attr __user *, ufattr, size_t, usize,
+ // unsigned int, at_flags)
+ // in: dfd, filename, at_flags
+ // out: ufattr, usize
+ *flags |= SfMayBlock;
+ Int arg_1 = (Int) ARG1;
+ PRINT("sys_file_getattr ( %ld, %#" FMT_REGWORD "x(%s), %#" FMT_REGWORD "x, %" FMT_REGWORD "u, %#" FMT_REGWORD "x )" ,
+ SARG1, ARG2, (HChar*)(Addr)ARG2, ARG3, ARG4, ARG5);
+ PRE_REG_READ5(int, "file_getattr", int, dfd, const char*, filename,
+ struct vki_file_attr *, ufattr, vki_size_t, usize, int, at_flags);
+ // Per https://lwn.net/Articles/1020992/ :
+ // >> The syscalls take fd and path. If path is absolute, fd is not used. If path
+ // is empty, fd can be AT_FDCWD or any valid fd which will be used to get/set
+ // attributes on. << That said, we can't use ML_(fd_at_check_allowed)() here,
+ // because there is nothing special about relative path.
+ if (ARG1 == 0)
+ {
+ if (arg_1 != VKI_AT_FDCWD && !ML_(fd_allowed)(arg_1, "file_getattr", tid, False))
+ {
+ SET_STATUS_Failure( VKI_EBADF );
+ }
+ }
+ else
+ {
+ PRE_MEM_RASCIIZ("file_getattr(filename)", ARG2);
+ }
+ PRE_MEM_WRITE("file_getattr(ufattr)", ARG3, sizeof(struct vki_file_attr));
+ PRE_MEM_WRITE("file_getattr(usize)", ARG4, sizeof(vki_size_t));
+}
+
+POST(sys_file_getattr)
+{
+ // POST_MEM_WRITE(ARG3, sizeof(struct vki_file_attr));
+ // POST_MEM_WRITE(ARG4, sizeof(vki_size_t));
+}
+
+PRE(sys_file_setattr)
+{
+ // SYSCALL_DEFINE5(file_setattr, int, dfd, const char __user *, filename,
+ // struct file_attr __user *, ufattr, size_t, usize,
+ // unsigned int, at_flags)
+ // in: dfd, filename, ufattr, usize, at_flags
+ *flags |= SfMayBlock;
+ Int arg_1 = (Int) ARG1;
+ PRINT("sys_file_getattr ( %ld, %#" FMT_REGWORD "x(%s), %#" FMT_REGWORD "x, %" FMT_REGWORD "u, %#" FMT_REGWORD "x )" ,
+ SARG1, ARG2, (HChar*)(Addr)ARG2, ARG3, ARG4, ARG5);
+ PRE_REG_READ5(int, "file_setattr", int, dfd, const char*, filename,
+ struct vki_file_attr *, ufattr, vki_size_t, usize, int, at_flags);
+ // Per https://lwn.net/Articles/1020992/ :
+ // >> The syscalls take fd and path. If path is absolute, fd is not used. If path
+ // is empty, fd can be AT_FDCWD or any valid fd which will be used to get/set
+ // attributes on. << That said, we can't use ML_(fd_at_check_allowed)() here,
+ // because there is nothing special about relative path.
+ if (ARG1 == 0)
+ {
+ if (arg_1 != VKI_AT_FDCWD && !ML_(fd_allowed)(arg_1, "file_setattr", tid, False))
+ {
+ SET_STATUS_Failure( VKI_EBADF );
+ }
+ }
+ else
+ {
+ PRE_MEM_RASCIIZ("file_setattr(filename)", ARG2);
+ }
+ PRE_MEM_READ("file_setattr(ufattr)", ARG3, sizeof(struct vki_file_attr));
+}
+
PRE(sys_syncfs)
{
*flags |= SfMayBlock;
LINXY(__NR_statmount, sys_statmount), // 457
LINXY(__NR_listmount, sys_listmount), // 458
LINX_(__NR_mseal, sys_mseal), // 462
+ LINXY(__NR_file_getattr, sys_file_getattr), // 468
+ LINX_(__NR_file_setattr, sys_file_setattr), // 469
};
SyscallTableEntry* ML_(get_linux_syscall_entry) (UInt sysno)
LINX_ (__NR_mseal, sys_mseal),
LINX_ (__NR_futex_waitv, sys_futex_waitv),
LINX_ (__NR_quotactl_fd, sys_quotactl_fd),
+ LINXY(__NR_file_getattr, sys_file_getattr),
+ LINX_(__NR_file_setattr, sys_file_setattr),
};
SyscallTableEntry * ML_(get_linux_syscall_entry) ( UInt sysno )
LINXY (__NR_listmount, sys_listmount),
LINX_ (__NR_mseal, sys_mseal),
LINX_ (__NR_futex_waitv, sys_futex_waitv),
+ LINXY (__NR_file_getattr, sys_file_getattr),
+ LINX_ (__NR_file_setattr, sys_file_setattr),
};
SyscallTableEntry* ML_(get_linux_syscall_entry) (UInt sysno)
LINXY (__NR_statmount, sys_statmount), // 457
LINXY (__NR_listmount, sys_listmount), // 458
LINX_ (__NR_mseal, sys_mseal), // 462
+ LINXY (__NR_file_getattr, sys_file_getattr), // 468
+ LINX_ (__NR_file_setattr, sys_file_setattr), // 469
};
SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
LINXY (__NR_statmount, sys_statmount), // 457
LINXY (__NR_listmount, sys_listmount), // 458
LINX_ (__NR_mseal, sys_mseal), // 462
+ LINXY (__NR_file_getattr, sys_file_getattr), // 468
+ LINX_ (__NR_file_setattr, sys_file_setattr), // 469
};
SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
LINXY(__NR_statmount, sys_statmount), /* 457 */
LINXY(__NR_listmount, sys_listmount), /* 458 */
LINX_(__NR_mseal, sys_mseal), /* 462 */
+ LINXY(__NR_file_getattr, sys_file_getattr), /* 468 */
+ LINX_(__NR_file_setattr, sys_file_setattr), /* 469 */
};
SyscallTableEntry* ML_(get_linux_syscall_entry)(UInt sysno)
LINXY (__NR_statmount, sys_statmount), // 457
LINXY (__NR_listmount, sys_listmount), // 458
LINX_ (__NR_mseal, sys_mseal), // 462
+ LINXY (__NR_file_getattr, sys_file_getattr), // 468
+ LINX_ (__NR_file_setattr, sys_file_setattr), // 469
};
SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
LINXY(__NR_statmount, sys_statmount), // 457
LINXY(__NR_listmount, sys_listmount), // 458
LINX_(__NR_mseal, sys_mseal), // 462
+ LINXY(__NR_file_getattr, sys_file_getattr), // 468
+ LINX_(__NR_file_setattr, sys_file_setattr), // 469
};
SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
char str[]; /* Variable size part containing strings */
};
+//----------------------------------------------------------------------
+// From uapi/linux/fs.h
+//----------------------------------------------------------------------
+
+struct vki_file_attr {
+ __vki_u64 fa_xflags; /* xflags field value (get/set) */
+ __vki_u32 fa_extsize; /* extsize field value (get/set)*/
+ __vki_u32 fa_nextents; /* nextents field value (get) */
+ __vki_u32 fa_projid; /* project identifier (get/set) */
+ __vki_u32 fa_cowextsize; /* CoW extsize field value (get/set) */
+};
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
#define __NR_statmount 457
#define __NR_listmount 458
#define __NR_mseal 462
+#define __NR_file_getattr 468
+#define __NR_file_setattr 469
#endif