From: Martin Cermak Date: Sun, 21 Jun 2026 10:40:48 +0000 (+0200) Subject: Unhandled amd64-linux syscall: 467 (open_tree_attr) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca60092a2417a5a7071fcd574fb56084d0bb03b2;p=thirdparty%2Fvalgrind.git Unhandled amd64-linux syscall: 467 (open_tree_attr) __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 --- diff --git a/NEWS b/NEWS index 49bdec1dd..61e41393f 100644 --- 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) diff --git a/coregrind/m_syswrap/priv_syswrap-linux.h b/coregrind/m_syswrap/priv_syswrap-linux.h index 38755b60c..e6f05e3ae 100644 --- a/coregrind/m_syswrap/priv_syswrap-linux.h +++ b/coregrind/m_syswrap/priv_syswrap-linux.h @@ -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); diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c index 1c9b0d770..f8074c190 100644 --- a/coregrind/m_syswrap/syswrap-amd64-linux.c +++ b/coregrind/m_syswrap/syswrap-amd64-linux.c @@ -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 }; diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c index 4233ea921..9172adf0a 100644 --- a/coregrind/m_syswrap/syswrap-arm-linux.c +++ b/coregrind/m_syswrap/syswrap-arm-linux.c @@ -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 }; diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c index 4debcf8ab..071999cce 100644 --- a/coregrind/m_syswrap/syswrap-arm64-linux.c +++ b/coregrind/m_syswrap/syswrap-arm64-linux.c @@ -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 }; diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index f563e161b..d8a6b936f 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -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) */ diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c index fde0f614e..56783bf95 100644 --- a/coregrind/m_syswrap/syswrap-mips32-linux.c +++ b/coregrind/m_syswrap/syswrap-mips32-linux.c @@ -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 }; diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c index b08dc3b9b..bb49f8474 100644 --- a/coregrind/m_syswrap/syswrap-mips64-linux.c +++ b/coregrind/m_syswrap/syswrap-mips64-linux.c @@ -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), }; diff --git a/coregrind/m_syswrap/syswrap-nanomips-linux.c b/coregrind/m_syswrap/syswrap-nanomips-linux.c index 3e99320c7..6e9b2acef 100644 --- a/coregrind/m_syswrap/syswrap-nanomips-linux.c +++ b/coregrind/m_syswrap/syswrap-nanomips-linux.c @@ -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), }; diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c index f56a2de7d..7896bb907 100644 --- a/coregrind/m_syswrap/syswrap-ppc32-linux.c +++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c @@ -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 }; diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c index c8ba94da8..9484deb5f 100644 --- a/coregrind/m_syswrap/syswrap-ppc64-linux.c +++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c @@ -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 }; diff --git a/coregrind/m_syswrap/syswrap-riscv64-linux.c b/coregrind/m_syswrap/syswrap-riscv64-linux.c index d11948245..3e137fdac 100644 --- a/coregrind/m_syswrap/syswrap-riscv64-linux.c +++ b/coregrind/m_syswrap/syswrap-riscv64-linux.c @@ -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 */ }; diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c index bda61440b..106202a19 100644 --- a/coregrind/m_syswrap/syswrap-s390x-linux.c +++ b/coregrind/m_syswrap/syswrap-s390x-linux.c @@ -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 }; diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c index 6f727dc58..2eb075fb2 100644 --- a/coregrind/m_syswrap/syswrap-x86-linux.c +++ b/coregrind/m_syswrap/syswrap-x86-linux.c @@ -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 }; diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h index 20e4ecd0c..2010ffc12 100644 --- a/include/vki/vki-linux.h +++ b/include/vki/vki-linux.h @@ -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 //---------------------------------------------------------------------- diff --git a/include/vki/vki-scnums-shared-linux.h b/include/vki/vki-scnums-shared-linux.h index f022c1ff3..8c9c0eefd 100644 --- a/include/vki/vki-scnums-shared-linux.h +++ b/include/vki/vki-scnums-shared-linux.h @@ -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