510864 Add SSE4.1 PMAXSD and PMINSD instructions support for 32-bit x86
413369 unhandled amd64-darwin syscall: unix:151 (getpgid)
487055 memcheck/tests/x86-linux/scalar fails running in Docker
+510416 Missing syswraps for file_getattr and file_setattr
511329 Darwin and FreeBSD: Move setting of carry flag out of
ML_(do_syscall_for_client_WRK)
511713 Refactor syscall argument handling
// 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;
+ 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);
+ ML_(fd_at_check_allowed)(SARG1, (const HChar*)ARG2, "file_getattr", tid, status);
+ PRE_MEM_WRITE("file_getattr(ufattr)", ARG3, ARG4);
+}
+
+POST(sys_file_getattr)
+{
+ POST_MEM_WRITE(ARG3, ARG4);
+}
+
+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;
+ PRINT("sys_file_setattr ( %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);
+ ML_(fd_at_check_allowed)(SARG1, (const HChar*)ARG2, "sys_file_setattr", tid, status);
+ PRE_MEM_READ("file_setattr(ufattr)", ARG3, ARG4);
+}
+
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