509139 Update BadSize error messages
509258 FreeBSD: add jail_attach_jd and jail_remove_jd syscall wrappers
509517 s390x: Even/odd lane confusion in various vector insns
+509566 Wrap amd64-linux syscall: 442 (mount_setattr)
509590 Run the LTP tests with LTP_QUIET
509567 unhandled amd64-linux syscall: 443 (quotactl_fd)
509642 Add missing ppc64-linux syswraps
DECL_TEMPLATE(linux, sys_close_range);
DECL_TEMPLATE(linux, sys_openat2);
+// Linux-specific (new in Linux 5.12)
+DECL_TEMPLATE(linux, sys_mount_setattr)
+
// Linux-specific (new in Linux 5.13)
DECL_TEMPLATE(linux, sys_landlock_create_ruleset)
DECL_TEMPLATE(linux, sys_landlock_add_rule)
LINX_(__NR_faccessat2, sys_faccessat2), // 439
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
+ LINX_(__NR_mount_setattr, sys_mount_setattr), // 442
LINX_(__NR_quotactl_fd, sys_quotactl_fd), // 443
LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444
LINXY(__NR_pidfd_getfd, sys_pidfd_getfd), // 438
LINX_(__NR_faccessat2, sys_faccessat2), // 439
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
+ LINX_(__NR_mount_setattr, sys_mount_setattr), // 442
LINX_(__NR_quotactl_fd, sys_quotactl_fd), // 443
LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444
LINX_(__NR_faccessat2, sys_faccessat2), // 439
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
+ LINX_(__NR_mount_setattr, sys_mount_setattr), // 442
LINX_(__NR_quotactl_fd, sys_quotactl_fd), // 443
LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444
PRE_MEM_RASCIIZ( "mount(type)", ARG3);
}
+PRE(sys_mount_setattr)
+{
+ // int syscall(SYS_mount_setattr, int dirfd, const char *pathname,
+ // unsigned int flags, struct mount_attr *attr, size_t size);
+ *flags |= SfMayBlock;
+ PRINT("sys_mount_setattr ( %d, %#" FMT_REGWORD "x, %" FMT_REGWORD "u, %#"
+ FMT_REGWORD "x, %" FMT_REGWORD "u )", (Int)ARG1, ARG2,
+ ARG3, ARG4, ARG5);
+ PRE_MEM_READ("mount(attr)", ARG5, ARG6);
+ ML_(fd_at_check_allowed)(SARG1, (const HChar*)ARG2, "mount_setattr(dirfd)", tid, status);
+}
+
PRE(sys_oldumount)
{
PRINT("sys_oldumount( %#" FMT_REGWORD "x )", ARG1);
#else
# error Unexpected word size
#endif
- if ( !ML_(fd_allowed)(SARG1, "fanotify_mark[fanotify_fd]", tid, False) )
+ if ( !ML_(fd_allowed)(SARG1, "fanotify_mark(fanotify_fd)", tid, False) )
SET_STATUS_Failure( VKI_EBADF );
- ML_(fd_at_check_allowed)(SARG4, (const HChar*)ARG5, "mkdirat[firfd]", tid, status);
+ ML_(fd_at_check_allowed)(SARG4, (const HChar*)ARG5, "fanotify_mark(dirfd)", tid, status);
}
/* ---------------------------------------------------------------------
"%ld, %#" FMT_REGWORD "x(%s), %ld",
SARG1, ARG2, (HChar*)(Addr)ARG2,
SARG3, ARG4, (HChar*)(Addr)ARG4, SARG5);
- PRE_REG_READ5(long, "mount_move",
+ PRE_REG_READ5(long, "move_mount",
int, from_dfd, const char *, from_pathname,
int, to_dfd, const char*, to_pathname, int, flags);
- PRE_MEM_RASCIIZ( "mount_move(from_pathname)", ARG2);
+ PRE_MEM_RASCIIZ( "move_mount(from_pathname)", ARG2);
/* For absolute filenames, from_dfd is ignored. If from_dfd is AT_FDCWD,
from_pathname is relative to cwd. When comparing from_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, "mount_move", tid, False))
- SET_STATUS_Failure( VKI_EBADF );
- PRE_MEM_RASCIIZ( "mount_move(from_pathname)", ARG4);
+ ML_(fd_at_check_allowed)(SARG1, (const HChar*)ARG2, "move_mount(from_dfd)", tid, status);
+ PRE_MEM_RASCIIZ( "move_mount(to_pathname)", ARG4);
/* For absolute filenames, to_dfd is ignored. If to_dfd is AT_FDCWD,
to_pathname is relative to cwd. When comparing to_dfd against
AT_FDCWD, be sure only to compare the bottom 32 bits. */
- if (ML_(safe_to_deref)( (void*)(Addr)ARG4, 1 )
- && *(Char *)(Addr)ARG4 != '/'
- && ((Int)ARG4) != ((Int)VKI_AT_FDCWD)
- && !ML_(fd_allowed)(ARG3, "mount_move", tid, False))
- SET_STATUS_Failure( VKI_EBADF );
+ ML_(fd_at_check_allowed)(SARG3, (const HChar*)ARG4, "move_mount(to_dfd)", tid, status);
}
/* int fsopen (const char *fs_name, unsigned int flags) */
LINX_ (__NR_faccessat2, sys_faccessat2), // 439
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
+ LINX_(__NR_mount_setattr, sys_mount_setattr), // 442
LINX_(__NR_quotactl_fd, sys_quotactl_fd), // 443
LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444
GENX_ (__NR_acct, sys_acct),
GENX_ (__NR_settimeofday, sys_settimeofday),
LINX_ (__NR_mount, sys_mount),
+ LINX_ (__NR_mount_setattr, sys_mount_setattr),
LINX_ (__NR_umount2, sys_umount),
PLAX_ (__NR_swapon, sys_swapon),
PLAX_ (__NR_swapoff, sys_swapoff),
LINX_(__NR_faccessat2, sys_faccessat2), // 439
LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), // 441
+ LINX_ (__NR_mount_setattr, sys_mount_setattr), // 442
LINX_ (__NR_quotactl_fd, sys_quotactl_fd), // 443
LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444
LINX_(__NR_faccessat2, sys_faccessat2), // 439
LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), // 441
+ LINX_ (__NR_mount_setattr, sys_mount_setattr), // 442
LINX_ (__NR_quotactl_fd, sys_quotactl_fd), // 443
LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444
LINXY(__NR_pidfd_getfd, sys_pidfd_getfd), /* 438 */
LINX_(__NR_faccessat2, sys_faccessat2), /* 439 */
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), /* 441 */
+ LINX_(__NR_mount_setattr, sys_mount_setattr), /* 442 */
LINX_(__NR_quotactl_fd, sys_quotactl_fd), /* 443 */
LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), /* 444 */
LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), /* 445 */
LINX_(__NR_faccessat2, sys_faccessat2), // 439
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
+ LINX_(__NR_mount_setattr, sys_mount_setattr), // 442
LINX_(__NR_quotactl_fd, sys_quotactl_fd), // 443
LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444
LINX_(__NR_faccessat2, sys_faccessat2), // 439
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
+ LINX_(__NR_mount_setattr, sys_mount_setattr), // 442
LINX_(__NR_quotactl_fd, sys_quotactl_fd), // 443
LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444
#define __NR_epoll_pwait2 441
+#define __NR_mount_setattr 442
#define __NR_quotactl_fd 443
#define __NR_landlock_create_ruleset 444
#define __NR_landlock_add_rule 445