]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Unhandled amd64-linux syscall: 467 (open_tree_attr) master
authorMartin Cermak <mcermak@redhat.com>
Sun, 21 Jun 2026 10:40:48 +0000 (12:40 +0200)
committerMartin Cermak <mcermak@redhat.com>
Sun, 21 Jun 2026 10:40:48 +0000 (12:40 +0200)
__NR_open_tree_attr is a generic syscall number for linux defined in
vki-scnums-shared-linux.h Hooked in all syswrap-{x86,s390x,riscv64,\
ppc64,ppc32,nanomips,mips64,mips32,arm64,arm,amd64}-linux.c with LINXY
to sys_open_tree_attr.  With sys_open_tree_attr being defined in
priv_syswrap-linux.h with DECL_TEMPLATE linux.  PRE and POST in
syswrap-linux.c.

https://bugs.kde.org/show_bug.cgi?id=521054

16 files changed:
NEWS
coregrind/m_syswrap/priv_syswrap-linux.h
coregrind/m_syswrap/syswrap-amd64-linux.c
coregrind/m_syswrap/syswrap-arm-linux.c
coregrind/m_syswrap/syswrap-arm64-linux.c
coregrind/m_syswrap/syswrap-linux.c
coregrind/m_syswrap/syswrap-mips32-linux.c
coregrind/m_syswrap/syswrap-mips64-linux.c
coregrind/m_syswrap/syswrap-nanomips-linux.c
coregrind/m_syswrap/syswrap-ppc32-linux.c
coregrind/m_syswrap/syswrap-ppc64-linux.c
coregrind/m_syswrap/syswrap-riscv64-linux.c
coregrind/m_syswrap/syswrap-s390x-linux.c
coregrind/m_syswrap/syswrap-x86-linux.c
include/vki/vki-linux.h
include/vki/vki-scnums-shared-linux.h

diff --git a/NEWS b/NEWS
index 49bdec1dd2f470ea6bc9d19977b58bd70a1dc423..61e41393f8899a02a270c130cd69ce72b29bdd75 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -47,6 +47,7 @@ are not entered into bugzilla tend to get forgotten about or ignored.
 520856  unhandled instruction bytes: 0x2E 0xFF 0x14 0x85
 520861  Update FAQ for C++ standard library
 521027  Advertise LZCNT on amd64 via CPUID
+521054  Unhandled amd64-linux syscall: 467 (open_tree_attr)
 521259  Improve check_makefile_consistency
 521332  vex x86->IR: unhandled instruction bytes: 66 0F 38 37 (PCMPGTQ)
 
index 38755b60c8da952f19c99746a96f4e262a2e06f3..e6f05e3ae1925105a4661809a56dc11ad01a8213 100644 (file)
@@ -375,6 +375,9 @@ DECL_TEMPLATE(linux, sys_lsm_get_self_attr);
 DECL_TEMPLATE(linux, sys_lsm_set_self_attr);
 DECL_TEMPLATE(linux, sys_lsm_list_modules);
 
+// Since Linux 6.14
+DECL_TEMPLATE(linux, sys_open_tree_attr);
+
 // Since Linux 6.17-rc1
 DECL_TEMPLATE(linux, sys_file_getattr);
 DECL_TEMPLATE(linux, sys_file_setattr);
index 1c9b0d77047641ac21df72bcf20341b65817ab28..f8074c190cd9794aaae49fc338c74f343be3216b 100644 (file)
@@ -913,6 +913,7 @@ static SyscallTableEntry syscall_table[] = {
    LINX_(__NR_lsm_set_self_attr, sys_lsm_set_self_attr), // 460
    LINXY(__NR_lsm_list_modules,  sys_lsm_list_modules),  // 461
    LINX_(__NR_mseal,             sys_mseal),             // 462
+   LINXY(__NR_open_tree_attr,    sys_open_tree_attr),    // 467
    LINXY(__NR_file_getattr,      sys_file_getattr),      // 468
    LINX_(__NR_file_setattr,      sys_file_setattr),      // 469
 };
index 4233ea92148fd707d4670ea762197aff3ca0a809..9172adf0a17cd127f6865fbe62cc5eaf9bd0fedf 100644 (file)
@@ -1082,6 +1082,7 @@ static SyscallTableEntry syscall_main_table[] = {
    LINX_(__NR_lsm_set_self_attr, sys_lsm_set_self_attr), // 460
    LINXY(__NR_lsm_list_modules,  sys_lsm_list_modules),  // 461
    LINX_(__NR_mseal,             sys_mseal),             // 462
+   LINXY(__NR_open_tree_attr,    sys_open_tree_attr),    // 467
    LINXY(__NR_file_getattr,      sys_file_getattr),      // 468
    LINX_(__NR_file_setattr,      sys_file_setattr),      // 469
 };
index 4debcf8ab2b385c2044f082e8b4f1b27e63c23c6..071999cce7a8022b3eab091824fd896ca6359a6a 100644 (file)
@@ -864,6 +864,7 @@ static SyscallTableEntry syscall_main_table[] = {
    LINX_(__NR_lsm_set_self_attr, sys_lsm_set_self_attr), // 460
    LINXY(__NR_lsm_list_modules,  sys_lsm_list_modules),  // 461
    LINX_(__NR_mseal,             sys_mseal),             // 462
+   LINXY(__NR_open_tree_attr,    sys_open_tree_attr),    // 467
    LINXY(__NR_file_getattr,      sys_file_getattr),      // 468
    LINX_(__NR_file_setattr,      sys_file_setattr),      // 469
 };
index f563e161bf5f4a97e1af290d2b5a38d86bd22512..d8a6b936f1929246e4fa4a8f3f576b26ee3f3624 100644 (file)
@@ -14753,6 +14753,39 @@ POST(sys_open_tree)
    }
 }
 
+/* int open_tree_attr (int dfd, const char *filename, unsigned int flags,
+                       struct mount_attr __user * uattr, size_t usize)  */
+PRE(sys_open_tree_attr)
+{
+   PRINT("sys_open_tree_attr ( %ld, %#" FMT_REGWORD "x(%s), %ld, %#" FMT_REGWORD "x, %" FMT_REGWORD "u ",
+         SARG1, ARG2, (HChar*)(Addr)ARG2, SARG3, ARG4, ARG5);
+   PRE_REG_READ5(long, "open_tree_attr",
+                 int, dfd, const char *, filename, int, flags,
+                 struct vki_mount_attr *, uattr, vki_size_t, usize);
+   PRE_MEM_RASCIIZ( "open_tree_attr(filename)", ARG2);
+   /* For absolute filenames, dfd is ignored.  If dfd is AT_FDCWD,
+      filename is relative to cwd.  When comparing dfd against AT_FDCWD,
+      be sure only to compare the bottom 32 bits. */
+   if (ML_(safe_to_deref)( (void*)(Addr)ARG2, 1 )
+       && *(Char *)(Addr)ARG2 != '/'
+       && ((Int)ARG1) != ((Int)VKI_AT_FDCWD)
+       && !ML_(fd_allowed)(ARG1, "open_tree_attr", tid, False))
+      SET_STATUS_Failure( VKI_EBADF );
+   PRE_MEM_READ("open_tree_attr(uattr)", ARG4, ARG5);
+}
+
+POST(sys_open_tree_attr)
+{
+   POST_newFd_RES;
+   if (!ML_(fd_allowed)(RES, "open_tree_attr", tid, True)) {
+      VG_(close)(RES);
+      SET_STATUS_Failure( VKI_EMFILE );
+   } else {
+      if (VG_(clo_track_fds))
+         ML_(record_fd_open_with_given_name)(tid, RES, (HChar*)(Addr)ARG2);
+   }
+}
+
 /* int move_mount (int from_dfd, const char *from_pathname,
                    int to_dfd, const char *to_pathname,
                    unsigned int flags)  */
index fde0f614e4c177fa0ed6e97517032f0ef0c61dd4..56783bf95757ae53afa6bee10abaae317eba7dbf 100644 (file)
@@ -1192,6 +1192,7 @@ static SyscallTableEntry syscall_main_table[] = {
    LINX_(__NR_lsm_set_self_attr,       sys_lsm_set_self_attr),       // 460
    LINXY(__NR_lsm_list_modules,        sys_lsm_list_modules),        // 461
    LINX_(__NR_mseal,                   sys_mseal),                   // 462
+   LINXY(__NR_open_tree_attr,          sys_open_tree_attr),          // 467
    LINXY(__NR_file_getattr,            sys_file_getattr),            // 468
    LINX_(__NR_file_setattr,            sys_file_setattr),            // 469
 };
index b08dc3b9bd404ef0e7477a2aacb63da18c191cd1..bb49f8474c8b911b218270a7ea0b0d154710967f 100644 (file)
@@ -803,6 +803,7 @@ static SyscallTableEntry syscall_main_table[] = {
    LINX_ (__NR_mseal, sys_mseal),
    LINX_ (__NR_futex_waitv, sys_futex_waitv),
    LINXY (__NR_quotactl_fd, sys_quotactl_fd),
+   LINXY (__NR_open_tree_attr, sys_open_tree_attr),
    LINXY (__NR_file_getattr, sys_file_getattr),
    LINX_ (__NR_file_setattr, sys_file_setattr),
 };
index 3e99320c7622256e3ae8095c76136418178338ae..6e9b2acef520c0a799595c8525a241f1128b23b8 100644 (file)
@@ -828,6 +828,7 @@ static SyscallTableEntry syscall_main_table[] = {
    LINXY (__NR_lsm_list_modules,       sys_lsm_list_modules),
    LINX_ (__NR_mseal,                  sys_mseal),
    LINX_ (__NR_futex_waitv,            sys_futex_waitv),
+   LINXY (__NR_open_tree_attr,         sys_open_tree_attr),
    LINXY (__NR_file_getattr,           sys_file_getattr),
    LINX_ (__NR_file_setattr,           sys_file_setattr),
 };
index f56a2de7dbe203ae5465d83852dd8ec65572b06d..7896bb907edd326ff6d85f5cafd43e0f0ca0763b 100644 (file)
@@ -1096,6 +1096,7 @@ static SyscallTableEntry syscall_table[] = {
    LINX_ (__NR_lsm_set_self_attr,sys_lsm_set_self_attr), // 460
    LINXY (__NR_lsm_list_modules, sys_lsm_list_modules),  // 461
    LINX_ (__NR_mseal,            sys_mseal),             // 462
+   LINXY (__NR_open_tree_attr,   sys_open_tree_attr),    // 467
    LINXY (__NR_file_getattr,     sys_file_getattr),      // 468
    LINX_ (__NR_file_setattr,     sys_file_setattr),      // 469
 };
index c8ba94da8e0d11e5d60d4d08936ed6bb3a4a2a30..9484deb5f9409073666a0c88c56560aa59c7f778 100644 (file)
@@ -1069,6 +1069,7 @@ static SyscallTableEntry syscall_table[] = {
    LINX_ (__NR_lsm_set_self_attr,sys_lsm_set_self_attr), // 460
    LINXY (__NR_lsm_list_modules, sys_lsm_list_modules),  // 461
    LINX_ (__NR_mseal,            sys_mseal),             // 462
+   LINXY (__NR_open_tree_attr,   sys_open_tree_attr),    // 467
    LINXY (__NR_file_getattr,     sys_file_getattr),      // 468
    LINX_ (__NR_file_setattr,     sys_file_setattr),      // 469
 };
index d119482453f68a220489722b9a46ed52893e115a..3e137fdac0277740fcccdf5de12b3f27d71b90e3 100644 (file)
@@ -612,6 +612,7 @@ static SyscallTableEntry syscall_main_table[] = {
    LINX_(__NR_lsm_set_self_attr, sys_lsm_set_self_attr),           /* 460 */
    LINXY(__NR_lsm_list_modules, sys_lsm_list_modules),             /* 461 */
    LINX_(__NR_mseal, sys_mseal),                                   /* 462 */
+   LINXY(__NR_open_tree_attr, sys_open_tree_attr),                 /* 467 */
    LINXY(__NR_file_getattr, sys_file_getattr),                     /* 468 */
    LINX_(__NR_file_setattr, sys_file_setattr),                     /* 469 */
 };
index bda61440b7e96972810cf69f6d6ce7c687a97c9b..106202a195f9b5d4af44c6546cce4ace9bd739dc 100644 (file)
@@ -904,6 +904,7 @@ static SyscallTableEntry syscall_table[] = {
    LINX_ (__NR_lsm_set_self_attr, sys_lsm_set_self_attr),             // 460
    LINXY (__NR_lsm_list_modules, sys_lsm_list_modules),               // 461
    LINX_ (__NR_mseal, sys_mseal),                                     // 462
+   LINXY (__NR_open_tree_attr, sys_open_tree_attr),                   // 467
    LINXY (__NR_file_getattr, sys_file_getattr),                       // 468
    LINX_ (__NR_file_setattr, sys_file_setattr),                       // 469
 };
index 6f727dc58c8194bd5cb310fea4a1af5327062397..2eb075fb2843df5b27afc3fb14e0ed0534aac16d 100644 (file)
@@ -1694,6 +1694,7 @@ static SyscallTableEntry syscall_table[] = {
    LINX_(__NR_lsm_set_self_attr, sys_lsm_set_self_attr), // 460
    LINXY(__NR_lsm_list_modules,  sys_lsm_list_modules),  // 461
    LINX_(__NR_mseal,             sys_mseal),             // 462
+   LINXY(__NR_open_tree_attr,    sys_open_tree_attr),    // 467
    LINXY(__NR_file_getattr,      sys_file_getattr),      // 468
    LINX_(__NR_file_setattr,      sys_file_setattr),      // 469
 };
index 20e4ecd0c47d0d249e1a156edf7f20a8f4141aa0..2010ffc12b0a5cc7b985799b4003a674870af223 100644 (file)
@@ -5605,6 +5605,13 @@ struct vki_statmount {
        char str[];             /* Variable size part containing strings */
 };
 
+struct vki_mount_attr {
+       __vki_u64 attr_set;
+       __vki_u64 attr_clr;
+       __vki_u64 propagation;
+       __vki_u64 userns_fd;
+};
+
 //----------------------------------------------------------------------
 // From uapi/linux/fs.h
 //----------------------------------------------------------------------
index f022c1ff3ef1c60f3db9a377d3e06c28511787a1..8c9c0eefdeaf033a7f44988d62206f7379c0d943 100644 (file)
@@ -64,6 +64,7 @@
 #define __NR_lsm_set_self_attr 460
 #define __NR_lsm_list_modules   461
 #define __NR_mseal             462
+#define __NR_open_tree_attr    467
 #define __NR_file_getattr      468
 #define __NR_file_setattr      469