summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-06-24 16:59:19 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-07-05 10:08:48 -0300
commitaf1aa36c617d72e80ff6b268bf927b6642d90823 (patch)
tree9da46e918d6c910ce7cada5547a571b38defd673
parentc3b02b6567e5709614eb24c85c3c0b69ae5c58a6 (diff)
downloadglibc-af1aa36c617d72e80ff6b268bf927b6642d90823.tar.gz
linux: Add mount_setattr
It was added on Linux 5.12 (2a1867219c7b27f928e2545782b86daaf9ad50bd) to allow change the properties of a mount or a mount tree using file descriptors which the new mount api is based on. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
-rw-r--r--NEWS8
-rw-r--r--sysdeps/unix/sysv/linux/Versions1
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/arc/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/arm/be/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/arm/le/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/csky/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/i386/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/be/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/le/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/or1k/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sh/be/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sh/le/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sys/mount.h22
-rw-r--r--sysdeps/unix/sysv/linux/syscalls.list1
-rwxr-xr-xsysdeps/unix/sysv/linux/tst-mount-consts.py4
-rw-r--r--sysdeps/unix/sysv/linux/tst-mount.c30
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist1
39 files changed, 91 insertions, 8 deletions
diff --git a/NEWS b/NEWS
index 3d14c659cc..dbf351b895 100644
--- a/NEWS
+++ b/NEWS
@@ -41,10 +41,10 @@ Major new features:
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.
diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
index b70530ef40..65d2ceda2c 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -305,6 +305,7 @@ libc {
fsopen;
fspick;
move_mount;
+ mount_setattr;
open_tree;
pidfd_open;
pidfd_getfd;
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 2a666d8135..16d34b55c6 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2620,6 +2620,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index 41bd7c1959..3f794bea0f 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2717,6 +2717,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 198fdab2f7..072627810c 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -2381,6 +2381,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index 6fd4e75df2..dbd5f07e6e 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -500,6 +500,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 3ec572b50f..0f02d79faa 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -497,6 +497,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index 94f3deb3e5..11d3b36a78 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2656,6 +2656,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index a7deaf3e26..5caa1321b1 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2605,6 +2605,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 5f1a1bc4d0..276d7d5619 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2789,6 +2789,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index 1af8a55836..5e2249518e 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2555,6 +2555,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index ad3a4b4008..802469a5b9 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -501,6 +501,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 87e76f33a0..2f949397df 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2732,6 +2732,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 73df42c7aa..f63cc9cd4c 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2705,6 +2705,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index 5c2e936547..88d2b707f9 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2702,6 +2702,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 45919d27d6..6c2bc0ee78 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2697,6 +2697,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index 8321b0efac..09c9980d95 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2695,6 +2695,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index c7198646d2..763920ea8f 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2703,6 +2703,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index 8b3cca2a54..36d30558c1 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2606,6 +2606,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index 2f1595bb35..e4383fe464 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2744,6 +2744,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/or1k/libc.abilist b/sysdeps/unix/sysv/linux/or1k/libc.abilist
index d1d4e12d12..735a8eea7e 100644
--- a/sysdeps/unix/sysv/linux/or1k/libc.abilist
+++ b/sysdeps/unix/sysv/linux/or1k/libc.abilist
@@ -2127,6 +2127,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 50c9fadaf0..715dd31afe 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2759,6 +2759,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 8998a560cd..ac4b69e5fc 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2792,6 +2792,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index bca46bdbe5..fd42f1bc11 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2514,6 +2514,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index 97f6d96cd6..24688916dd 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2816,6 +2816,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index f588745b28..536eddf9f1 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2383,6 +2383,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 1acf8a4c54..214b4f1c87 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2583,6 +2583,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index 7c8b410f1a..bd738a4eb8 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2757,6 +2757,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index ba9317ee01..170361236a 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2551,6 +2551,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index 75fa8834f1..88fcd03300 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2612,6 +2612,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index 4a4f8ff33f..f1115ef46d 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2609,6 +2609,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index d26671dba8..6063da1acf 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2752,6 +2752,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 16c2a98ab5..780d2c0987 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2578,6 +2578,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
index 534d05b3f5..f965986ba8 100644
--- a/sysdeps/unix/sysv/linux/sys/mount.h
+++ b/sysdeps/unix/sysv/linux/sys/mount.h
@@ -23,6 +23,8 @@
#include <fcntl.h>
#include <features.h>
+#include <stdint.h>
+#include <stddef.h>
#include <sys/ioctl.h>
#define BLOCK_SIZE 1024
@@ -155,6 +157,17 @@ enum
#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 */
@@ -240,6 +253,15 @@ extern int fspick (int __dfd, const char *__path, unsigned int __flags)
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 */
diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
index 493e68b834..6420049e8b 100644
--- a/sysdeps/unix/sysv/linux/syscalls.list
+++ b/sysdeps/unix/sysv/linux/syscalls.list
@@ -39,6 +39,7 @@ mincore - mincore i:aUV mincore
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
diff --git a/sysdeps/unix/sysv/linux/tst-mount-consts.py b/sysdeps/unix/sysv/linux/tst-mount-consts.py
index 82ab18d963..a62f803123 100755
--- a/sysdeps/unix/sysv/linux/tst-mount-consts.py
+++ b/sysdeps/unix/sysv/linux/tst-mount-consts.py
@@ -56,7 +56,9 @@ def main():
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__':
diff --git a/sysdeps/unix/sysv/linux/tst-mount.c b/sysdeps/unix/sysv/linux/tst-mount.c
index 12a665f950..502d7e3433 100644
--- a/sysdeps/unix/sysv/linux/tst-mount.c
+++ b/sysdeps/unix/sysv/linux/tst-mount.c
@@ -23,6 +23,9 @@
#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)
{
@@ -67,10 +70,31 @@ 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);
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index bd7c4ef801..56cad609fe 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2529,6 +2529,7 @@ GLIBC_2.36 fsconfig 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
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index 1c7f60b41a..2ed242a62d 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2635,6 +2635,7 @@ GLIBC_2.36 fsconfig 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