have adverse impact. It is incompatible with EDNS0 usage and DNSSEC
validation by applications.
-* On Linux, the fsopen, fsmount, move_mount, fsconfig, fspick, and open_tree
- functions have been added. They are part of the new Linux kernel mount
- APIs that allow applications to more flexibly configure and operate on
- filesystem mounts. The new mount APIs are specifically designed to work
+* On Linux, the fsopen, fsmount, move_mount, fsconfig, fspick, open_tree,
+ and mount_setattr have been added. They are part of the new Linux kernel
+ mount APIs that allow applications to more flexibly configure and operate
+ on filesystem mounts. The new mount APIs are specifically designed to work
with namespaces.
* localedef now accepts locale definition files encoded in UTF-8.
fsopen;
fspick;
move_mount;
+ mount_setattr;
open_tree;
pidfd_open;
pidfd_getfd;
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
#include <fcntl.h>
#include <features.h>
+#include <stdint.h>
+#include <stddef.h>
#include <sys/ioctl.h>
#define BLOCK_SIZE 1024
#define MOUNT_ATTR_NOSYMFOLLOW 0x00200000 /* Do not follow symlinks. */
+/* For mount_setattr. */
+struct mount_attr
+{
+ uint64_t attr_set;
+ uint64_t attr_clr;
+ uint64_t propagation;
+ uint64_t userns_fd;
+};
+
+#define MOUNT_ATTR_SIZE_VER0 32 /* sizeof first published struct */
+
/* move_mount flags. */
#define MOVE_MOUNT_F_SYMLINKS 0x00000001 /* Follow symlinks on from path */
#define MOVE_MOUNT_F_AUTOMOUNTS 0x00000002 /* Follow automounts on from path */
extern int open_tree (int __dfd, const char *__filename, unsigned int __flags)
__THROW;
+/* Change the mount properties of the mount or an entire mount tree. If
+ PATH is a relative pathname, then it is interpreted relative to the
+ directory referred to by the file descriptor dirfd. Otherwise if DFD is
+ the special value AT_FDCWD then PATH is interpreted relative to the current
+ working directory of the calling process. */
+extern int mount_setattr (int __dfd, const char *__path, unsigned int __flags,
+ struct mount_attr *__uattr, size_t __usize)
+ __THROW;
+
__END_DECLS
#endif /* _SYS_MOUNT_H */
mlock - mlock i:bU mlock
mlockall - mlockall i:i mlockall
mount EXTRA mount i:sssUp __mount mount
+mount_setattr EXTRA mount_setattr i:isUpU mount_setattr
move_mount EXTRA move_mount i:isisU move_mount
munlock - munlock i:aU munlock
munlockall - munlockall i: munlockall
check('FSMOUNT_.*'),
# MOVE_MOUNT__MASK may vary depending of the kernel version.
check('MOVE_MOUNT_.*', 'MOVE_MOUNT__MASK'),
- check('OPEN_TREE_*'))
+ check('OPEN_TREE_*'),
+ # MOUNT_ATTR_SIZE_VER0 is used for mount_setattr.
+ check('MOUNT_ATTR_.*', 'MOUNT_ATTR_SIZE_VER0'))
sys.exit(status)
if __name__ == '__main__':
#include <sys/wait.h>
#include <sys/mount.h>
+_Static_assert (sizeof (struct mount_attr) == MOUNT_ATTR_SIZE_VER0,
+ "sizeof (struct mount_attr) != MOUNT_ATTR_SIZE_VER0");
+
static void
subprocess (void)
{
TEST_COMPARE (open_tree (AT_FDCWD, "", 0), -1);
TEST_COMPARE (errno, ENOENT);
+ int fd_tree = open_tree (AT_FDCWD, "/tmp",
+ OPEN_TREE_CLONE | OPEN_TREE_CLOEXEC);
+ TEST_VERIFY (fd_tree != -1);
+
{
- int fd_tree = open_tree (AT_FDCWD, "/tmp",
- OPEN_TREE_CLONE | OPEN_TREE_CLOEXEC);
- TEST_VERIFY (fd_tree != -1);
+ struct mount_attr attr =
+ {
+ .attr_set = MOUNT_ATTR_RDONLY,
+ };
+ mount_setattr (fd_tree, "", AT_EMPTY_PATH, &attr,
+ sizeof (attr));
+ int r = mount_setattr (fd_tree, "", AT_EMPTY_PATH, &attr,
+ sizeof (attr));
+ /* New mount API was added on 5.1, but mount_setattr on 5.12. */
+ if (r == -1)
+ TEST_COMPARE (errno, ENOSYS);
+ else
+ {
+ TEST_COMPARE (mount_setattr (-1, "", AT_EMPTY_PATH, &attr,
+ sizeof (attr)), -1);
+ TEST_COMPARE (errno, EBADF);
+ TEST_COMPARE (mount_setattr (fd_tree, "", AT_EMPTY_PATH, &attr,
+ sizeof (attr) - 8), -1);
+ TEST_COMPARE (errno, EINVAL);
+ }
}
_exit (0);
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F
GLIBC_2.36 fsmount F
GLIBC_2.36 fsopen F
GLIBC_2.36 fspick F
+GLIBC_2.36 mount_setattr F
GLIBC_2.36 move_mount F
GLIBC_2.36 open_tree F
GLIBC_2.36 pidfd_getfd F