public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Update from Linux 6.6
@ 2023-10-30 21:32 Adhemerval Zanella
  2023-10-30 21:32 ` [PATCH 1/6] Update syscall lists for " Adhemerval Zanella
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2023-10-30 21:32 UTC (permalink / raw)
  To: libc-alpha, Joseph Myers

It adds the new Linux 6.6 syscalls, constants, and fchmodat2
usage to fix 26401.

Adhemerval Zanella (6):
  Update syscall lists for Linux 6.6
  Update kernel version to 6.5 in header constant tests
  linux: Add FSCONFIG_CMD_CREATE_EXCL from Linux 6.6 to sys/mount.h
  linux: Add HWCAP2_HBC from Linux 6.6 to AArch64 bits/hwcap.h
  linux: Sync Linux 6.6 elf.h
  linux: Use fchmodat2 on fchmod for flags different than 0 (BZ 26401)

 elf/elf.h                                     |   6 +
 io/tst-lchmod.c                               |   4 +-
 .../unix/sysv/linux/aarch64/arch-syscall.h    |   1 +
 sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h  |   1 +
 sysdeps/unix/sysv/linux/alpha/arch-syscall.h  |   1 +
 sysdeps/unix/sysv/linux/arc/arch-syscall.h    |   1 +
 sysdeps/unix/sysv/linux/arm/arch-syscall.h    |   1 +
 sysdeps/unix/sysv/linux/csky/arch-syscall.h   |   1 +
 sysdeps/unix/sysv/linux/fchmodat.c            | 120 ++++++++++--------
 sysdeps/unix/sysv/linux/hppa/arch-syscall.h   |   1 +
 sysdeps/unix/sysv/linux/i386/arch-syscall.h   |   1 +
 sysdeps/unix/sysv/linux/ia64/arch-syscall.h   |   1 +
 sysdeps/unix/sysv/linux/kernel-features.h     |   8 ++
 .../unix/sysv/linux/loongarch/arch-syscall.h  |   1 +
 sysdeps/unix/sysv/linux/m68k/arch-syscall.h   |   1 +
 .../unix/sysv/linux/microblaze/arch-syscall.h |   1 +
 .../sysv/linux/mips/mips32/arch-syscall.h     |   1 +
 .../sysv/linux/mips/mips64/n32/arch-syscall.h |   1 +
 .../sysv/linux/mips/mips64/n64/arch-syscall.h |   1 +
 sysdeps/unix/sysv/linux/nios2/arch-syscall.h  |   1 +
 sysdeps/unix/sysv/linux/or1k/arch-syscall.h   |   1 +
 .../linux/powerpc/powerpc32/arch-syscall.h    |   1 +
 .../linux/powerpc/powerpc64/arch-syscall.h    |   1 +
 .../unix/sysv/linux/riscv/rv32/arch-syscall.h |   1 +
 .../unix/sysv/linux/riscv/rv64/arch-syscall.h |   1 +
 .../sysv/linux/s390/s390-32/arch-syscall.h    |   1 +
 .../sysv/linux/s390/s390-64/arch-syscall.h    |   1 +
 sysdeps/unix/sysv/linux/sh/arch-syscall.h     |   1 +
 .../sysv/linux/sparc/sparc32/arch-syscall.h   |   1 +
 .../sysv/linux/sparc/sparc64/arch-syscall.h   |   1 +
 sysdeps/unix/sysv/linux/sys/mount.h           |   2 +
 sysdeps/unix/sysv/linux/syscall-names.list    |   2 +
 sysdeps/unix/sysv/linux/tst-mman-consts.py    |   2 +-
 sysdeps/unix/sysv/linux/tst-mount-consts.py   |   4 +-
 sysdeps/unix/sysv/linux/tst-pidfd-consts.py   |   2 +-
 .../unix/sysv/linux/x86_64/64/arch-syscall.h  |   2 +
 .../unix/sysv/linux/x86_64/x32/arch-syscall.h |   1 +
 37 files changed, 120 insertions(+), 59 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 1/6] Update syscall lists for Linux 6.6
  2023-10-30 21:32 [PATCH 0/6] Update from Linux 6.6 Adhemerval Zanella
@ 2023-10-30 21:32 ` Adhemerval Zanella
  2023-10-30 21:39   ` Joseph Myers
  2023-10-30 21:32 ` [PATCH 2/6] Update kernel version to 6.5 in header constant tests Adhemerval Zanella
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 19+ messages in thread
From: Adhemerval Zanella @ 2023-10-30 21:32 UTC (permalink / raw)
  To: libc-alpha, Joseph Myers

Linux 6.5 has one new syscall for all architectures, fchmodat2, and
the map_shadow_stack on x86_64.
---
 sysdeps/unix/sysv/linux/aarch64/arch-syscall.h           | 1 +
 sysdeps/unix/sysv/linux/alpha/arch-syscall.h             | 1 +
 sysdeps/unix/sysv/linux/arc/arch-syscall.h               | 1 +
 sysdeps/unix/sysv/linux/arm/arch-syscall.h               | 1 +
 sysdeps/unix/sysv/linux/csky/arch-syscall.h              | 1 +
 sysdeps/unix/sysv/linux/hppa/arch-syscall.h              | 1 +
 sysdeps/unix/sysv/linux/i386/arch-syscall.h              | 1 +
 sysdeps/unix/sysv/linux/ia64/arch-syscall.h              | 1 +
 sysdeps/unix/sysv/linux/loongarch/arch-syscall.h         | 1 +
 sysdeps/unix/sysv/linux/m68k/arch-syscall.h              | 1 +
 sysdeps/unix/sysv/linux/microblaze/arch-syscall.h        | 1 +
 sysdeps/unix/sysv/linux/mips/mips32/arch-syscall.h       | 1 +
 sysdeps/unix/sysv/linux/mips/mips64/n32/arch-syscall.h   | 1 +
 sysdeps/unix/sysv/linux/mips/mips64/n64/arch-syscall.h   | 1 +
 sysdeps/unix/sysv/linux/nios2/arch-syscall.h             | 1 +
 sysdeps/unix/sysv/linux/or1k/arch-syscall.h              | 1 +
 sysdeps/unix/sysv/linux/powerpc/powerpc32/arch-syscall.h | 1 +
 sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-syscall.h | 1 +
 sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h        | 1 +
 sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h        | 1 +
 sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h      | 1 +
 sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h      | 1 +
 sysdeps/unix/sysv/linux/sh/arch-syscall.h                | 1 +
 sysdeps/unix/sysv/linux/sparc/sparc32/arch-syscall.h     | 1 +
 sysdeps/unix/sysv/linux/sparc/sparc64/arch-syscall.h     | 1 +
 sysdeps/unix/sysv/linux/syscall-names.list               | 2 ++
 sysdeps/unix/sysv/linux/x86_64/64/arch-syscall.h         | 2 ++
 sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h        | 1 +
 28 files changed, 30 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h b/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h
index 8f21ee66a0..746991aa2f 100644
--- a/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h
@@ -44,6 +44,7 @@
 #define __NR_fchdir 50
 #define __NR_fchmod 52
 #define __NR_fchmodat 53
+#define __NR_fchmodat2 452
 #define __NR_fchown 55
 #define __NR_fchownat 54
 #define __NR_fcntl 25
diff --git a/sysdeps/unix/sysv/linux/alpha/arch-syscall.h b/sysdeps/unix/sysv/linux/alpha/arch-syscall.h
index c5802a5fec..32efe51267 100644
--- a/sysdeps/unix/sysv/linux/alpha/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/alpha/arch-syscall.h
@@ -56,6 +56,7 @@
 #define __NR_fchdir 13
 #define __NR_fchmod 124
 #define __NR_fchmodat 461
+#define __NR_fchmodat2 562
 #define __NR_fchown 123
 #define __NR_fchownat 453
 #define __NR_fcntl 92
diff --git a/sysdeps/unix/sysv/linux/arc/arch-syscall.h b/sysdeps/unix/sysv/linux/arc/arch-syscall.h
index f23f9e1154..1d2879e877 100644
--- a/sysdeps/unix/sysv/linux/arc/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/arc/arch-syscall.h
@@ -48,6 +48,7 @@
 #define __NR_fchdir 50
 #define __NR_fchmod 52
 #define __NR_fchmodat 53
+#define __NR_fchmodat2 452
 #define __NR_fchown 55
 #define __NR_fchownat 54
 #define __NR_fcntl64 25
diff --git a/sysdeps/unix/sysv/linux/arm/arch-syscall.h b/sysdeps/unix/sysv/linux/arm/arch-syscall.h
index 7edf574899..6711981e78 100644
--- a/sysdeps/unix/sysv/linux/arm/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/arm/arch-syscall.h
@@ -64,6 +64,7 @@
 #define __NR_fchdir 133
 #define __NR_fchmod 94
 #define __NR_fchmodat 333
+#define __NR_fchmodat2 452
 #define __NR_fchown 95
 #define __NR_fchown32 207
 #define __NR_fchownat 325
diff --git a/sysdeps/unix/sysv/linux/csky/arch-syscall.h b/sysdeps/unix/sysv/linux/csky/arch-syscall.h
index d74a06e063..92d9a703ea 100644
--- a/sysdeps/unix/sysv/linux/csky/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/csky/arch-syscall.h
@@ -50,6 +50,7 @@
 #define __NR_fchdir 50
 #define __NR_fchmod 52
 #define __NR_fchmodat 53
+#define __NR_fchmodat2 452
 #define __NR_fchown 55
 #define __NR_fchownat 54
 #define __NR_fcntl64 25
diff --git a/sysdeps/unix/sysv/linux/hppa/arch-syscall.h b/sysdeps/unix/sysv/linux/hppa/arch-syscall.h
index 5568b94cd3..fbac124b70 100644
--- a/sysdeps/unix/sysv/linux/hppa/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/hppa/arch-syscall.h
@@ -63,6 +63,7 @@
 #define __NR_fchdir 133
 #define __NR_fchmod 94
 #define __NR_fchmodat 286
+#define __NR_fchmodat2 452
 #define __NR_fchown 95
 #define __NR_fchownat 278
 #define __NR_fcntl 55
diff --git a/sysdeps/unix/sysv/linux/i386/arch-syscall.h b/sysdeps/unix/sysv/linux/i386/arch-syscall.h
index 3af21a15cb..8961788a96 100644
--- a/sysdeps/unix/sysv/linux/i386/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/i386/arch-syscall.h
@@ -67,6 +67,7 @@
 #define __NR_fchdir 133
 #define __NR_fchmod 94
 #define __NR_fchmodat 306
+#define __NR_fchmodat2 452
 #define __NR_fchown 95
 #define __NR_fchown32 207
 #define __NR_fchownat 298
diff --git a/sysdeps/unix/sysv/linux/ia64/arch-syscall.h b/sysdeps/unix/sysv/linux/ia64/arch-syscall.h
index 39b270e642..1ef762d693 100644
--- a/sysdeps/unix/sysv/linux/ia64/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/ia64/arch-syscall.h
@@ -55,6 +55,7 @@
 #define __NR_fchdir 1035
 #define __NR_fchmod 1099
 #define __NR_fchmodat 1292
+#define __NR_fchmodat2 1476
 #define __NR_fchown 1100
 #define __NR_fchownat 1284
 #define __NR_fcntl 1066
diff --git a/sysdeps/unix/sysv/linux/loongarch/arch-syscall.h b/sysdeps/unix/sysv/linux/loongarch/arch-syscall.h
index fdefe8bb6f..3664e6f7c8 100644
--- a/sysdeps/unix/sysv/linux/loongarch/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/loongarch/arch-syscall.h
@@ -44,6 +44,7 @@
 #define __NR_fchdir 50
 #define __NR_fchmod 52
 #define __NR_fchmodat 53
+#define __NR_fchmodat2 452
 #define __NR_fchown 55
 #define __NR_fchownat 54
 #define __NR_fcntl 25
diff --git a/sysdeps/unix/sysv/linux/m68k/arch-syscall.h b/sysdeps/unix/sysv/linux/m68k/arch-syscall.h
index 315e49cd33..2053d5d392 100644
--- a/sysdeps/unix/sysv/linux/m68k/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/m68k/arch-syscall.h
@@ -67,6 +67,7 @@
 #define __NR_fchdir 133
 #define __NR_fchmod 94
 #define __NR_fchmodat 299
+#define __NR_fchmodat2 452
 #define __NR_fchown 95
 #define __NR_fchown32 207
 #define __NR_fchownat 291
diff --git a/sysdeps/unix/sysv/linux/microblaze/arch-syscall.h b/sysdeps/unix/sysv/linux/microblaze/arch-syscall.h
index 54af12780c..6865b1693c 100644
--- a/sysdeps/unix/sysv/linux/microblaze/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/microblaze/arch-syscall.h
@@ -67,6 +67,7 @@
 #define __NR_fchdir 133
 #define __NR_fchmod 94
 #define __NR_fchmodat 306
+#define __NR_fchmodat2 452
 #define __NR_fchown 95
 #define __NR_fchown32 207
 #define __NR_fchownat 298
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/arch-syscall.h b/sysdeps/unix/sysv/linux/mips/mips32/arch-syscall.h
index a2aa1ffa1b..b13ace8e1c 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/mips/mips32/arch-syscall.h
@@ -67,6 +67,7 @@
 #define __NR_fchdir 4133
 #define __NR_fchmod 4094
 #define __NR_fchmodat 4299
+#define __NR_fchmodat2 4452
 #define __NR_fchown 4095
 #define __NR_fchownat 4291
 #define __NR_fcntl 4055
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/arch-syscall.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/arch-syscall.h
index 5bec858040..b7a7c0dfa7 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/arch-syscall.h
@@ -64,6 +64,7 @@
 #define __NR_fchdir 6079
 #define __NR_fchmod 6089
 #define __NR_fchmodat 6262
+#define __NR_fchmodat2 6452
 #define __NR_fchown 6091
 #define __NR_fchownat 6254
 #define __NR_fcntl 6070
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/arch-syscall.h b/sysdeps/unix/sysv/linux/mips/mips64/n64/arch-syscall.h
index 0166371ee2..e5d7f91f48 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/arch-syscall.h
@@ -59,6 +59,7 @@
 #define __NR_fchdir 5079
 #define __NR_fchmod 5089
 #define __NR_fchmodat 5258
+#define __NR_fchmodat2 5452
 #define __NR_fchown 5091
 #define __NR_fchownat 5250
 #define __NR_fcntl 5070
diff --git a/sysdeps/unix/sysv/linux/nios2/arch-syscall.h b/sysdeps/unix/sysv/linux/nios2/arch-syscall.h
index 29a4cfa988..89950cc33a 100644
--- a/sysdeps/unix/sysv/linux/nios2/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/nios2/arch-syscall.h
@@ -49,6 +49,7 @@
 #define __NR_fchdir 50
 #define __NR_fchmod 52
 #define __NR_fchmodat 53
+#define __NR_fchmodat2 452
 #define __NR_fchown 55
 #define __NR_fchownat 54
 #define __NR_fcntl64 25
diff --git a/sysdeps/unix/sysv/linux/or1k/arch-syscall.h b/sysdeps/unix/sysv/linux/or1k/arch-syscall.h
index f5a3729663..4c07d9c204 100644
--- a/sysdeps/unix/sysv/linux/or1k/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/or1k/arch-syscall.h
@@ -49,6 +49,7 @@
 #define __NR_fchdir 50
 #define __NR_fchmod 52
 #define __NR_fchmodat 53
+#define __NR_fchmodat2 452
 #define __NR_fchown 55
 #define __NR_fchownat 54
 #define __NR_fcntl64 25
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/arch-syscall.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/arch-syscall.h
index 3a212a0269..64683bcb76 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/arch-syscall.h
@@ -66,6 +66,7 @@
 #define __NR_fchdir 133
 #define __NR_fchmod 94
 #define __NR_fchmodat 297
+#define __NR_fchmodat2 452
 #define __NR_fchown 95
 #define __NR_fchownat 289
 #define __NR_fcntl 55
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-syscall.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-syscall.h
index 1038ead227..af1bbf32e8 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-syscall.h
@@ -60,6 +60,7 @@
 #define __NR_fchdir 133
 #define __NR_fchmod 94
 #define __NR_fchmodat 297
+#define __NR_fchmodat2 452
 #define __NR_fchown 95
 #define __NR_fchownat 289
 #define __NR_fcntl 55
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h b/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
index 57b043ffb5..56e3088cbf 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
@@ -43,6 +43,7 @@
 #define __NR_fchdir 50
 #define __NR_fchmod 52
 #define __NR_fchmodat 53
+#define __NR_fchmodat2 452
 #define __NR_fchown 55
 #define __NR_fchownat 54
 #define __NR_fcntl64 25
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
index 1041a0f8c9..508161b47a 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
@@ -44,6 +44,7 @@
 #define __NR_fchdir 50
 #define __NR_fchmod 52
 #define __NR_fchmodat 53
+#define __NR_fchmodat2 452
 #define __NR_fchown 55
 #define __NR_fchownat 54
 #define __NR_fcntl 25
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h b/sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h
index 70d4c6782e..1498ebf42e 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h
@@ -65,6 +65,7 @@
 #define __NR_fchdir 133
 #define __NR_fchmod 94
 #define __NR_fchmodat 299
+#define __NR_fchmodat2 452
 #define __NR_fchown 95
 #define __NR_fchown32 207
 #define __NR_fchownat 291
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h b/sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h
index 65a8a9e316..624d71b56d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h
@@ -56,6 +56,7 @@
 #define __NR_fchdir 133
 #define __NR_fchmod 94
 #define __NR_fchmodat 299
+#define __NR_fchmodat2 452
 #define __NR_fchown 207
 #define __NR_fchownat 291
 #define __NR_fcntl 55
diff --git a/sysdeps/unix/sysv/linux/sh/arch-syscall.h b/sysdeps/unix/sysv/linux/sh/arch-syscall.h
index 94aad0f119..37211f5f8c 100644
--- a/sysdeps/unix/sysv/linux/sh/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/sh/arch-syscall.h
@@ -64,6 +64,7 @@
 #define __NR_fchdir 133
 #define __NR_fchmod 94
 #define __NR_fchmodat 306
+#define __NR_fchmodat2 452
 #define __NR_fchown 95
 #define __NR_fchown32 207
 #define __NR_fchownat 298
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/arch-syscall.h b/sysdeps/unix/sysv/linux/sparc/sparc32/arch-syscall.h
index d630306c75..8093abcc9c 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/arch-syscall.h
@@ -66,6 +66,7 @@
 #define __NR_fchdir 176
 #define __NR_fchmod 124
 #define __NR_fchmodat 295
+#define __NR_fchmodat2 452
 #define __NR_fchown 123
 #define __NR_fchown32 32
 #define __NR_fchownat 287
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/arch-syscall.h b/sysdeps/unix/sysv/linux/sparc/sparc64/arch-syscall.h
index 930f29b4d2..d25ccfb571 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/arch-syscall.h
@@ -60,6 +60,7 @@
 #define __NR_fchdir 176
 #define __NR_fchmod 124
 #define __NR_fchmodat 295
+#define __NR_fchmodat2 452
 #define __NR_fchown 123
 #define __NR_fchownat 287
 #define __NR_fcntl 92
diff --git a/sysdeps/unix/sysv/linux/syscall-names.list b/sysdeps/unix/sysv/linux/syscall-names.list
index cf6f70ecd9..52d5948d84 100644
--- a/sysdeps/unix/sysv/linux/syscall-names.list
+++ b/sysdeps/unix/sysv/linux/syscall-names.list
@@ -117,6 +117,7 @@ fanotify_mark
 fchdir
 fchmod
 fchmodat
+fchmodat2
 fchown
 fchown32
 fchownat
@@ -246,6 +247,7 @@ lsetxattr
 lstat
 lstat64
 madvise
+map_shadow_stack
 mbind
 membarrier
 memfd_create
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/arch-syscall.h b/sysdeps/unix/sysv/linux/x86_64/64/arch-syscall.h
index 58646cf0bd..5e4c9e901c 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/x86_64/64/arch-syscall.h
@@ -59,6 +59,7 @@
 #define __NR_fchdir 81
 #define __NR_fchmod 91
 #define __NR_fchmodat 268
+#define __NR_fchmodat2 452
 #define __NR_fchown 93
 #define __NR_fchownat 260
 #define __NR_fcntl 72
@@ -153,6 +154,7 @@
 #define __NR_lsetxattr 189
 #define __NR_lstat 6
 #define __NR_madvise 28
+#define __NR_map_shadow_stack 453
 #define __NR_mbind 237
 #define __NR_membarrier 324
 #define __NR_memfd_create 319
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h b/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h
index 604bcdfa5b..dd5e196272 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h
@@ -55,6 +55,7 @@
 #define __NR_fchdir 1073741905
 #define __NR_fchmod 1073741915
 #define __NR_fchmodat 1073742092
+#define __NR_fchmodat2 1073742276
 #define __NR_fchown 1073741917
 #define __NR_fchownat 1073742084
 #define __NR_fcntl 1073741896
-- 
2.34.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 2/6] Update kernel version to 6.5 in header constant tests
  2023-10-30 21:32 [PATCH 0/6] Update from Linux 6.6 Adhemerval Zanella
  2023-10-30 21:32 ` [PATCH 1/6] Update syscall lists for " Adhemerval Zanella
@ 2023-10-30 21:32 ` Adhemerval Zanella
  2023-10-30 21:45   ` Joseph Myers
  2023-10-30 21:32 ` [PATCH 3/6] linux: Add FSCONFIG_CMD_CREATE_EXCL from Linux 6.6 to sys/mount.h Adhemerval Zanella
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 19+ messages in thread
From: Adhemerval Zanella @ 2023-10-30 21:32 UTC (permalink / raw)
  To: libc-alpha, Joseph Myers

---
 sysdeps/unix/sysv/linux/tst-mman-consts.py  | 2 +-
 sysdeps/unix/sysv/linux/tst-mount-consts.py | 4 ++--
 sysdeps/unix/sysv/linux/tst-pidfd-consts.py | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/tst-mman-consts.py b/sysdeps/unix/sysv/linux/tst-mman-consts.py
index e85ea41ee4..8186d7e178 100644
--- a/sysdeps/unix/sysv/linux/tst-mman-consts.py
+++ b/sysdeps/unix/sysv/linux/tst-mman-consts.py
@@ -33,7 +33,7 @@ def main():
                         help='C compiler (including options) to use')
     args = parser.parse_args()
     linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
-    linux_version_glibc = (6, 5)
+    linux_version_glibc = (6, 6)
     sys.exit(glibcextract.compare_macro_consts(
         '#define _GNU_SOURCE 1\n'
         '#include <sys/mman.h>\n',
diff --git a/sysdeps/unix/sysv/linux/tst-mount-consts.py b/sysdeps/unix/sysv/linux/tst-mount-consts.py
index b5c52a4bb2..ba1c373fc4 100755
--- a/sysdeps/unix/sysv/linux/tst-mount-consts.py
+++ b/sysdeps/unix/sysv/linux/tst-mount-consts.py
@@ -39,10 +39,10 @@ def main():
         sys.exit (77)
 
     linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
-    # Constants in glibc were updated to match Linux v6.5.  When glibc
+    # Constants in glibc were updated to match Linux v6.6.  When glibc
     # constants are updated this value should be updated to match the
     # released kernel version from which the constants were taken.
-    linux_version_glibc = (6, 5)
+    linux_version_glibc = (6, 6)
     def check(cte, exclude=None):
         return glibcextract.compare_macro_consts(
                 '#include <sys/mount.h>\n',
diff --git a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
index 1ef14889a8..4a0f757a21 100644
--- a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
+++ b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
@@ -39,7 +39,7 @@ def main():
         sys.exit (77)
 
     linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
-    linux_version_glibc = (6, 5)
+    linux_version_glibc = (6, 6)
     sys.exit(glibcextract.compare_macro_consts(
                 '#include <sys/pidfd.h>\n',
                 '#include <asm/fcntl.h>\n'
-- 
2.34.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 3/6] linux: Add FSCONFIG_CMD_CREATE_EXCL from Linux 6.6 to sys/mount.h
  2023-10-30 21:32 [PATCH 0/6] Update from Linux 6.6 Adhemerval Zanella
  2023-10-30 21:32 ` [PATCH 1/6] Update syscall lists for " Adhemerval Zanella
  2023-10-30 21:32 ` [PATCH 2/6] Update kernel version to 6.5 in header constant tests Adhemerval Zanella
@ 2023-10-30 21:32 ` Adhemerval Zanella
  2023-10-30 21:32 ` [PATCH 4/6] linux: Add HWCAP2_HBC from Linux 6.6 to AArch64 bits/hwcap.h Adhemerval Zanella
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2023-10-30 21:32 UTC (permalink / raw)
  To: libc-alpha, Joseph Myers

The tst-mount-consts.py does not need to be updated because kernel
exports it as an enum (compare_macro_consts can not parse it).
---
 sysdeps/unix/sysv/linux/sys/mount.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
index a692c0e092..db0ac7a8a4 100644
--- a/sysdeps/unix/sysv/linux/sys/mount.h
+++ b/sysdeps/unix/sysv/linux/sys/mount.h
@@ -256,6 +256,8 @@ enum fsconfig_command
 # define FSCONFIG_CMD_CREATE FSCONFIG_CMD_CREATE
   FSCONFIG_CMD_RECONFIGURE = 7,   /* Invoke superblock reconfiguration */
 # define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE
+  FSCONFIG_CMD_CREATE_EXCL = 8,    /* Create new superblock, fail if reusing existing superblock */
+# define FSCONFIG_CMD_CREATE_EXCL FSCONFIG_CMD_CREATE_EXCL
 };
 #endif
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 4/6] linux: Add HWCAP2_HBC from Linux 6.6 to AArch64 bits/hwcap.h
  2023-10-30 21:32 [PATCH 0/6] Update from Linux 6.6 Adhemerval Zanella
                   ` (2 preceding siblings ...)
  2023-10-30 21:32 ` [PATCH 3/6] linux: Add FSCONFIG_CMD_CREATE_EXCL from Linux 6.6 to sys/mount.h Adhemerval Zanella
@ 2023-10-30 21:32 ` Adhemerval Zanella
  2023-10-30 21:32 ` [PATCH 5/6] linux: Sync Linux 6.6 elf.h Adhemerval Zanella
  2023-10-30 21:32 ` [PATCH 6/6] linux: Use fchmodat2 on fchmod for flags different than 0 (BZ 26401) Adhemerval Zanella
  5 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2023-10-30 21:32 UTC (permalink / raw)
  To: libc-alpha, Joseph Myers

---
 sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
index b251c2d417..8cfac79749 100644
--- a/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
+++ b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
@@ -99,3 +99,4 @@
 #define HWCAP2_SME_B16B16	(1UL << 41)
 #define HWCAP2_SME_F16F16	(1UL << 42)
 #define HWCAP2_MOPS		(1UL << 43)
+#define HWCAP2_HBC		(1UL << 44)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 5/6] linux: Sync Linux 6.6 elf.h
  2023-10-30 21:32 [PATCH 0/6] Update from Linux 6.6 Adhemerval Zanella
                   ` (3 preceding siblings ...)
  2023-10-30 21:32 ` [PATCH 4/6] linux: Add HWCAP2_HBC from Linux 6.6 to AArch64 bits/hwcap.h Adhemerval Zanella
@ 2023-10-30 21:32 ` Adhemerval Zanella
  2023-10-31  8:29   ` Florian Weimer
  2023-10-30 21:32 ` [PATCH 6/6] linux: Use fchmodat2 on fchmod for flags different than 0 (BZ 26401) Adhemerval Zanella
  5 siblings, 1 reply; 19+ messages in thread
From: Adhemerval Zanella @ 2023-10-30 21:32 UTC (permalink / raw)
  To: libc-alpha, Joseph Myers

It adds NT_X86_SHST (2fab02b25ae7cf5), NT_RISCV_CSR/NT_RISCV_VECTOR
(9300f00439743c4), and NT_LOONGARCH_HW_BREAK/NT_LOONGARCH_HW_WATCH
(1a69f7a161a78ae).
---
 elf/elf.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/elf/elf.h b/elf/elf.h
index 73a64baa79..50b73fa329 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -796,6 +796,8 @@ typedef struct
 #define NT_386_TLS	0x200		/* i386 TLS slots (struct user_desc) */
 #define NT_386_IOPERM	0x201		/* x86 io permission bitmap (1=deny) */
 #define NT_X86_XSTATE	0x202		/* x86 extended state using xsave */
+/* Old binutils treats 0x203 as a CET state */
+#define NT_X86_SHST	0x204		/* x86 SHSTK state */
 #define NT_S390_HIGH_GPRS	0x300	/* s390 upper register halves */
 #define NT_S390_TIMER	0x301		/* s390 timer register */
 #define NT_S390_TODCMP	0x302		/* s390 TOD clock comparator register */
@@ -834,6 +836,8 @@ typedef struct
 #define NT_MIPS_DSP	0x800		/* MIPS DSP ASE registers.  */
 #define NT_MIPS_FP_MODE	0x801		/* MIPS floating-point mode.  */
 #define NT_MIPS_MSA	0x802		/* MIPS SIMD registers.  */
+#define NT_RISCV_CSR	0x900		/* RISC-V Control and Status Registers */
+#define NT_RISCV_VECTOR	0x901		/* RISC-V vector registers */
 #define NT_LOONGARCH_CPUCFG	0xa00	/* LoongArch CPU config registers.  */
 #define NT_LOONGARCH_CSR	0xa01	/* LoongArch control and
 					   status registers.  */
@@ -843,6 +847,8 @@ typedef struct
 					   SIMD Extension registers.  */
 #define NT_LOONGARCH_LBT	0xa04	/* LoongArch Loongson Binary
 					   Translation registers.  */
+#define NT_LOONGARCH_HW_BREAK	0xa05   /* LoongArch hardware breakpoint registers */
+#define NT_LOONGARCH_HW_WATCH	0xa06   /* LoongArch hardware watchpoint registers */
 
 /* Legal values for the note segment descriptor types for object files.  */
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 6/6] linux: Use fchmodat2 on fchmod for flags different than 0 (BZ 26401)
  2023-10-30 21:32 [PATCH 0/6] Update from Linux 6.6 Adhemerval Zanella
                   ` (4 preceding siblings ...)
  2023-10-30 21:32 ` [PATCH 5/6] linux: Sync Linux 6.6 elf.h Adhemerval Zanella
@ 2023-10-30 21:32 ` Adhemerval Zanella
  2023-10-31  8:28   ` Florian Weimer
  2023-10-31  8:30   ` Florian Weimer
  5 siblings, 2 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2023-10-30 21:32 UTC (permalink / raw)
  To: libc-alpha, Joseph Myers

Linux 6.6 (09da082b07bbae1c) added support for fchmodat2, which is
has similar semantic of fchmodat with an extra flag argument.  This
allow fchmodat to implement AT_SYMLINK_NOFOLLOW and AT_EMPTY_PATH
without the need to procfs.

The syscall is registered on all architectures (with value of 452
except on alpha which is 562, commit 78252deb023cf087).

Checked on x86_64-linux-gnu on a 6.6 kernel.

PS: setting it as RFC because there is no Linux 6.6 release yet.
---
 io/tst-lchmod.c                           |   4 +-
 sysdeps/unix/sysv/linux/fchmodat.c        | 120 ++++++++++++----------
 sysdeps/unix/sysv/linux/kernel-features.h |   8 ++
 3 files changed, 77 insertions(+), 55 deletions(-)

diff --git a/io/tst-lchmod.c b/io/tst-lchmod.c
index 2bf4835b05..6496dc61e0 100644
--- a/io/tst-lchmod.c
+++ b/io/tst-lchmod.c
@@ -219,9 +219,9 @@ test_1 (bool do_relative_path, int (*chmod_func) (int fd, const char *, mode_t,
          /* The error code from the openat fallback leaks out.  */
          if (errno != ENFILE && errno != EMFILE)
            TEST_COMPARE (errno, EOPNOTSUPP);
+	 xstat (path_file, &st);
+	 TEST_COMPARE (st.st_mode & 0777, 3);
        }
-     xstat (path_file, &st);
-     TEST_COMPARE (st.st_mode & 0777, 3);
 
      /* Close the descriptors.  */
      for (int *pfd = fd_list_begin (&fd_list); pfd < fd_list_end (&fd_list);
diff --git a/sysdeps/unix/sysv/linux/fchmodat.c b/sysdeps/unix/sysv/linux/fchmodat.c
index 99527a3727..99d3df6440 100644
--- a/sysdeps/unix/sysv/linux/fchmodat.c
+++ b/sysdeps/unix/sysv/linux/fchmodat.c
@@ -26,66 +26,80 @@
 #include <sysdep.h>
 #include <unistd.h>
 
-int
-fchmodat (int fd, const char *file, mode_t mode, int flag)
+#if !__ASSUME_FCHMODAT2
+static int
+fchmodat_fallback (int fd, const char *file, mode_t mode, int flag)
 {
-  if (flag == 0)
-    return INLINE_SYSCALL (fchmodat, 3, fd, file, mode);
-  else if (flag != AT_SYMLINK_NOFOLLOW)
+  if (flag != AT_SYMLINK_NOFOLLOW)
     return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
-  else
-    {
-      /* The kernel system call does not have a mode argument.
-	 However, we can create an O_PATH descriptor and change that
-	 via /proc (which does not resolve symbolic links).  */
 
-      int pathfd = __openat_nocancel (fd, file,
-				      O_PATH | O_NOFOLLOW | O_CLOEXEC);
-      if (pathfd < 0)
-	/* This may report errors such as ENFILE and EMFILE.  The
-	   caller can treat them as temporary if necessary.  */
-	return pathfd;
+  /* The kernel system call does not have a mode argument.
+     However, we can create an O_PATH descriptor and change that
+     via /proc (which does not resolve symbolic links).  */
 
-      /* Use fstatat because fstat does not work on O_PATH descriptors
-	 before Linux 3.6.  */
-      struct __stat64_t64 st;
-      if (__fstatat64_time64 (pathfd, "", &st, AT_EMPTY_PATH) != 0)
-	{
-	  __close_nocancel (pathfd);
-	  return -1;
-	}
+  int pathfd = __openat_nocancel (fd, file,
+				  O_PATH | O_NOFOLLOW | O_CLOEXEC);
+  if (pathfd < 0)
+    /* This may report errors such as ENFILE and EMFILE.  The
+       caller can treat them as temporary if necessary.  */
+    return pathfd;
 
-      /* Some Linux versions with some file systems can actually
-	 change symbolic link permissions via /proc, but this is not
-	 intentional, and it gives inconsistent results (e.g., error
-	 return despite mode change).  The expected behavior is that
-	 symbolic link modes cannot be changed at all, and this check
-	 enforces that.  */
-      if (S_ISLNK (st.st_mode))
-	{
-	  __close_nocancel (pathfd);
-	  __set_errno (EOPNOTSUPP);
-	  return -1;
-	}
+  /* Use fstatat because fstat does not work on O_PATH descriptors
+     before Linux 3.6.  */
+  struct __stat64_t64 st;
+  if (__fstatat64_time64 (pathfd, "", &st, AT_EMPTY_PATH) != 0)
+    {
+      __close_nocancel (pathfd);
+      return -1;
+    }
 
-      /* For most file systems, fchmod does not operate on O_PATH
-	 descriptors, so go through /proc.  */
-      struct fd_to_filename filename;
-      int ret = __chmod (__fd_to_filename (pathfd, &filename), mode);
-      if (ret != 0)
-	{
-	  if (errno == ENOENT)
-	    /* /proc has not been mounted.  Without /proc, there is no
-	       way to upgrade the O_PATH descriptor to a full
-	       descriptor.  It is also not possible to re-open the
-	       file without O_PATH because the file name may refer to
-	       another file, and opening that without O_PATH may have
-	       side effects (such as blocking, device rewinding, or
-	       releasing POSIX locks).  */
-	    __set_errno (EOPNOTSUPP);
-	}
+  /* Some Linux versions with some file systems can actually
+     change symbolic link permissions via /proc, but this is not
+     intentional, and it gives inconsistent results (e.g., error
+     return despite mode change).  The expected behavior is that
+     symbolic link modes cannot be changed at all, and this check
+     enforces that.  */
+  if (S_ISLNK (st.st_mode))
+    {
       __close_nocancel (pathfd);
-      return ret;
+      __set_errno (EOPNOTSUPP);
+      return -1;
+    }
+
+  /* For most file systems, fchmod does not operate on O_PATH
+     descriptors, so go through /proc.  */
+  struct fd_to_filename filename;
+  int ret = __chmod (__fd_to_filename (pathfd, &filename), mode);
+  if (ret != 0)
+    {
+      if (errno == ENOENT)
+	/* /proc has not been mounted.  Without /proc, there is no
+	   way to upgrade the O_PATH descriptor to a full
+	   descriptor.  It is also not possible to re-open the
+	   file without O_PATH because the file name may refer to
+	   another file, and opening that without O_PATH may have
+	   side effects (such as blocking, device rewinding, or
+	   releasing POSIX locks).  */
+	__set_errno (EOPNOTSUPP);
     }
+  __close_nocancel (pathfd);
+  return ret;
+}
+#endif
+
+int
+fchmodat (int fd, const char *file, mode_t mode, int flag)
+{
+#if __ASSUME_FCHMODAT2
+  return INLINE_SYSCALL_CALL (fchmodat2, fd, file, mode, flag);
+#else
+  if (flag == 0)
+    return INLINE_SYSCALL_CALL (fchmodat, fd, file, mode);
+
+  int r = INLINE_SYSCALL_CALL (fchmodat2, fd, file, mode, flag);
+  if (r != 0 && errno == ENOSYS)
+    return fchmodat_fallback (fd, file, mode, flag);
+  return r;
+#endif
 }
 libc_hidden_def (fchmodat)
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index 07b440f4ee..670d2604d2 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -252,4 +252,12 @@
 # define __ASSUME_CLONE3 0
 #endif
 
+/* The fchmodat2 system call was introduced across all architectures
+   in Linux 6.6.  */
+#if __LINUX_KERNEL_VERSION >= 0x060600
+# define __ASSUME_FCHMODAT2 1
+#else
+# define __ASSUME_FCHMODAT2 0
+#endif
+
 #endif /* kernel-features.h */
-- 
2.34.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/6] Update syscall lists for Linux 6.6
  2023-10-30 21:32 ` [PATCH 1/6] Update syscall lists for " Adhemerval Zanella
@ 2023-10-30 21:39   ` Joseph Myers
  2023-10-31 11:54     ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 19+ messages in thread
From: Joseph Myers @ 2023-10-30 21:39 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

On Mon, 30 Oct 2023, Adhemerval Zanella wrote:

> Linux 6.5 has one new syscall for all architectures, fchmodat2, and
> the map_shadow_stack on x86_64.

6.6, not 6.5, and this is missing an update to the

# The list of system calls is current as of Linux 6.5.
kernel 6.5

at the start of syscall-names.list.  OK with those fixes.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 2/6] Update kernel version to 6.5 in header constant tests
  2023-10-30 21:32 ` [PATCH 2/6] Update kernel version to 6.5 in header constant tests Adhemerval Zanella
@ 2023-10-30 21:45   ` Joseph Myers
  2023-10-31 12:01     ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 19+ messages in thread
From: Joseph Myers @ 2023-10-30 21:45 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

6.6 not 6.5 in the commit summary.

How was this tested?  I note that in Linux 6.6, 
arch/x86/include/uapi/asm/mman.h adds a definition of MAP_ABOVE4G, but 
this patch series doesn't seem to add a corresponding definition to glibc; 
if that doesn't cause a failure of tst-mman-consts.py, why not?

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 6/6] linux: Use fchmodat2 on fchmod for flags different than 0 (BZ 26401)
  2023-10-30 21:32 ` [PATCH 6/6] linux: Use fchmodat2 on fchmod for flags different than 0 (BZ 26401) Adhemerval Zanella
@ 2023-10-31  8:28   ` Florian Weimer
  2023-10-31 10:27     ` Gabriel Ravier
  2023-10-31  8:30   ` Florian Weimer
  1 sibling, 1 reply; 19+ messages in thread
From: Florian Weimer @ 2023-10-31  8:28 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Joseph Myers

* Adhemerval Zanella:

> diff --git a/io/tst-lchmod.c b/io/tst-lchmod.c
> index 2bf4835b05..6496dc61e0 100644
> --- a/io/tst-lchmod.c
> +++ b/io/tst-lchmod.c
> @@ -219,9 +219,9 @@ test_1 (bool do_relative_path, int (*chmod_func) (int fd, const char *, mode_t,
>           /* The error code from the openat fallback leaks out.  */
>           if (errno != ENFILE && errno != EMFILE)
>             TEST_COMPARE (errno, EOPNOTSUPP);
> +	 xstat (path_file, &st);
> +	 TEST_COMPARE (st.st_mode & 0777, 3);
>         }
> -     xstat (path_file, &st);
> -     TEST_COMPARE (st.st_mode & 0777, 3);
>  
>       /* Close the descriptors.  */
>       for (int *pfd = fd_list_begin (&fd_list); pfd < fd_list_end (&fd_list);

Why this test change?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 5/6] linux: Sync Linux 6.6 elf.h
  2023-10-30 21:32 ` [PATCH 5/6] linux: Sync Linux 6.6 elf.h Adhemerval Zanella
@ 2023-10-31  8:29   ` Florian Weimer
  2023-10-31 10:21     ` Gabriel Ravier
  0 siblings, 1 reply; 19+ messages in thread
From: Florian Weimer @ 2023-10-31  8:29 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Joseph Myers

* Adhemerval Zanella:

> It adds NT_X86_SHST (2fab02b25ae7cf5), NT_RISCV_CSR/NT_RISCV_VECTOR
> (9300f00439743c4), and NT_LOONGARCH_HW_BREAK/NT_LOONGARCH_HW_WATCH
> (1a69f7a161a78ae).
> ---
>  elf/elf.h | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/elf/elf.h b/elf/elf.h
> index 73a64baa79..50b73fa329 100644
> --- a/elf/elf.h
> +++ b/elf/elf.h
> @@ -796,6 +796,8 @@ typedef struct
>  #define NT_386_TLS	0x200		/* i386 TLS slots (struct user_desc) */
>  #define NT_386_IOPERM	0x201		/* x86 io permission bitmap (1=deny) */
>  #define NT_X86_XSTATE	0x202		/* x86 extended state using xsave */
> +/* Old binutils treats 0x203 as a CET state */
> +#define NT_X86_SHST	0x204		/* x86 SHSTK state */
>  #define NT_S390_HIGH_GPRS	0x300	/* s390 upper register halves */
>  #define NT_S390_TIMER	0x301		/* s390 timer register */
>  #define NT_S390_TODCMP	0x302		/* s390 TOD clock comparator reg

That comment will be outdated soon.  I'm not sure it's helpful.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 6/6] linux: Use fchmodat2 on fchmod for flags different than 0 (BZ 26401)
  2023-10-30 21:32 ` [PATCH 6/6] linux: Use fchmodat2 on fchmod for flags different than 0 (BZ 26401) Adhemerval Zanella
  2023-10-31  8:28   ` Florian Weimer
@ 2023-10-31  8:30   ` Florian Weimer
  1 sibling, 0 replies; 19+ messages in thread
From: Florian Weimer @ 2023-10-31  8:30 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Joseph Myers

* Adhemerval Zanella:

> PS: setting it as RFC because there is no Linux 6.6 release yet.

Please remove this from the commit message.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 5/6] linux: Sync Linux 6.6 elf.h
  2023-10-31  8:29   ` Florian Weimer
@ 2023-10-31 10:21     ` Gabriel Ravier
  2023-10-31 10:37       ` Florian Weimer
  0 siblings, 1 reply; 19+ messages in thread
From: Gabriel Ravier @ 2023-10-31 10:21 UTC (permalink / raw)
  To: Florian Weimer, Adhemerval Zanella; +Cc: libc-alpha, Joseph Myers

On 10/31/23 08:29, Florian Weimer wrote:
> * Adhemerval Zanella:
>
>> It adds NT_X86_SHST (2fab02b25ae7cf5), NT_RISCV_CSR/NT_RISCV_VECTOR
>> (9300f00439743c4), and NT_LOONGARCH_HW_BREAK/NT_LOONGARCH_HW_WATCH
>> (1a69f7a161a78ae).
>> ---
>>   elf/elf.h | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/elf/elf.h b/elf/elf.h
>> index 73a64baa79..50b73fa329 100644
>> --- a/elf/elf.h
>> +++ b/elf/elf.h
>> @@ -796,6 +796,8 @@ typedef struct
>>   #define NT_386_TLS	0x200		/* i386 TLS slots (struct user_desc) */
>>   #define NT_386_IOPERM	0x201		/* x86 io permission bitmap (1=deny) */
>>   #define NT_X86_XSTATE	0x202		/* x86 extended state using xsave */
>> +/* Old binutils treats 0x203 as a CET state */
>> +#define NT_X86_SHST	0x204		/* x86 SHSTK state */
>>   #define NT_S390_HIGH_GPRS	0x300	/* s390 upper register halves */
>>   #define NT_S390_TIMER	0x301		/* s390 timer register */
>>   #define NT_S390_TODCMP	0x302		/* s390 TOD clock comparator reg
> That comment will be outdated soon.  I'm not sure it's helpful.

For what reason will it find itself outdated ?


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 6/6] linux: Use fchmodat2 on fchmod for flags different than 0 (BZ 26401)
  2023-10-31  8:28   ` Florian Weimer
@ 2023-10-31 10:27     ` Gabriel Ravier
  2023-10-31 14:14       ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 19+ messages in thread
From: Gabriel Ravier @ 2023-10-31 10:27 UTC (permalink / raw)
  To: Florian Weimer, Adhemerval Zanella; +Cc: libc-alpha, Joseph Myers

On 10/31/23 08:28, Florian Weimer wrote:
> * Adhemerval Zanella:
>
>> diff --git a/io/tst-lchmod.c b/io/tst-lchmod.c
>> index 2bf4835b05..6496dc61e0 100644
>> --- a/io/tst-lchmod.c
>> +++ b/io/tst-lchmod.c
>> @@ -219,9 +219,9 @@ test_1 (bool do_relative_path, int (*chmod_func) (int fd, const char *, mode_t,
>>            /* The error code from the openat fallback leaks out.  */
>>            if (errno != ENFILE && errno != EMFILE)
>>              TEST_COMPARE (errno, EOPNOTSUPP);
>> +	 xstat (path_file, &st);
>> +	 TEST_COMPARE (st.st_mode & 0777, 3);
>>          }
>> -     xstat (path_file, &st);
>> -     TEST_COMPARE (st.st_mode & 0777, 3);
>>   
>>        /* Close the descriptors.  */
>>        for (int *pfd = fd_list_begin (&fd_list); pfd < fd_list_end (&fd_list);
> Why this test change?

Unless I'm misreading the original, it seems like the test would always 
fail if the call to `chmod_func` right before this occurs succeeds - any 
success is followed by two contradictory assertions that `(st.st_mode & 
0777) == 2` and `(st.st_mode & 0777) == 3` (and that last test seems 
like its testing that the value of `st.st_mode & 0777` does not change 
when `chmod_func` fails.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 5/6] linux: Sync Linux 6.6 elf.h
  2023-10-31 10:21     ` Gabriel Ravier
@ 2023-10-31 10:37       ` Florian Weimer
  2023-10-31 14:14         ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 19+ messages in thread
From: Florian Weimer @ 2023-10-31 10:37 UTC (permalink / raw)
  To: Gabriel Ravier; +Cc: Adhemerval Zanella, libc-alpha, Joseph Myers

* Gabriel Ravier:

> On 10/31/23 08:29, Florian Weimer wrote:
>> * Adhemerval Zanella:
>>
>>> It adds NT_X86_SHST (2fab02b25ae7cf5), NT_RISCV_CSR/NT_RISCV_VECTOR
>>> (9300f00439743c4), and NT_LOONGARCH_HW_BREAK/NT_LOONGARCH_HW_WATCH
>>> (1a69f7a161a78ae).
>>> ---
>>>   elf/elf.h | 6 ++++++
>>>   1 file changed, 6 insertions(+)
>>>
>>> diff --git a/elf/elf.h b/elf/elf.h
>>> index 73a64baa79..50b73fa329 100644
>>> --- a/elf/elf.h
>>> +++ b/elf/elf.h
>>> @@ -796,6 +796,8 @@ typedef struct
>>>   #define NT_386_TLS	0x200		/* i386 TLS slots (struct user_desc) */
>>>   #define NT_386_IOPERM	0x201		/* x86 io permission bitmap (1=deny) */
>>>   #define NT_X86_XSTATE	0x202		/* x86 extended state using xsave */
>>> +/* Old binutils treats 0x203 as a CET state */
>>> +#define NT_X86_SHST	0x204		/* x86 SHSTK state */
>>>   #define NT_S390_HIGH_GPRS	0x300	/* s390 upper register halves */
>>>   #define NT_S390_TIMER	0x301		/* s390 timer register */
>>>   #define NT_S390_TODCMP	0x302		/* s390 TOD clock comparator reg
>> That comment will be outdated soon.  I'm not sure it's helpful.
>
> For what reason will it find itself outdated ?

The binutils versions that treat this as the CET flag will age out
fairly quickly, I think.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/6] Update syscall lists for Linux 6.6
  2023-10-30 21:39   ` Joseph Myers
@ 2023-10-31 11:54     ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella Netto @ 2023-10-31 11:54 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha



On 30/10/23 18:39, Joseph Myers wrote:
> On Mon, 30 Oct 2023, Adhemerval Zanella wrote:
> 
>> Linux 6.5 has one new syscall for all architectures, fchmodat2, and
>> the map_shadow_stack on x86_64.
> 
> 6.6, not 6.5, and this is missing an update to the
> 
> # The list of system calls is current as of Linux 6.5.
> kernel 6.5
> 
> at the start of syscall-names.list.  OK with those fixes.
> 

Hum, the update-syscall-lists rule did not update it.  Ok I will fix them.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 2/6] Update kernel version to 6.5 in header constant tests
  2023-10-30 21:45   ` Joseph Myers
@ 2023-10-31 12:01     ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella Netto @ 2023-10-31 12:01 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha



On 30/10/23 18:45, Joseph Myers wrote:
> 6.6 not 6.5 in the commit summary.
> 
> How was this tested?  I note that in Linux 6.6, 
> arch/x86/include/uapi/asm/mman.h adds a definition of MAP_ABOVE4G, but 
> this patch series doesn't seem to add a corresponding definition to glibc; 
> if that doesn't cause a failure of tst-mman-consts.py, why not?
> 

I see now that x86_64 showed a tst-mman-consts.py failure that I has not
caught for some reason.  I will update the patch.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 5/6] linux: Sync Linux 6.6 elf.h
  2023-10-31 10:37       ` Florian Weimer
@ 2023-10-31 14:14         ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella Netto @ 2023-10-31 14:14 UTC (permalink / raw)
  To: Florian Weimer, Gabriel Ravier; +Cc: libc-alpha, Joseph Myers



On 31/10/23 07:37, Florian Weimer wrote:
> * Gabriel Ravier:
> 
>> On 10/31/23 08:29, Florian Weimer wrote:
>>> * Adhemerval Zanella:
>>>
>>>> It adds NT_X86_SHST (2fab02b25ae7cf5), NT_RISCV_CSR/NT_RISCV_VECTOR
>>>> (9300f00439743c4), and NT_LOONGARCH_HW_BREAK/NT_LOONGARCH_HW_WATCH
>>>> (1a69f7a161a78ae).
>>>> ---
>>>>   elf/elf.h | 6 ++++++
>>>>   1 file changed, 6 insertions(+)
>>>>
>>>> diff --git a/elf/elf.h b/elf/elf.h
>>>> index 73a64baa79..50b73fa329 100644
>>>> --- a/elf/elf.h
>>>> +++ b/elf/elf.h
>>>> @@ -796,6 +796,8 @@ typedef struct
>>>>   #define NT_386_TLS	0x200		/* i386 TLS slots (struct user_desc) */
>>>>   #define NT_386_IOPERM	0x201		/* x86 io permission bitmap (1=deny) */
>>>>   #define NT_X86_XSTATE	0x202		/* x86 extended state using xsave */
>>>> +/* Old binutils treats 0x203 as a CET state */
>>>> +#define NT_X86_SHST	0x204		/* x86 SHSTK state */
>>>>   #define NT_S390_HIGH_GPRS	0x300	/* s390 upper register halves */
>>>>   #define NT_S390_TIMER	0x301		/* s390 timer register */
>>>>   #define NT_S390_TODCMP	0x302		/* s390 TOD clock comparator reg
>>> That comment will be outdated soon.  I'm not sure it's helpful.
>>
>> For what reason will it find itself outdated ?
> 
> The binutils versions that treat this as the CET flag will age out
> fairly quickly, I think.

I don't have a strong preference, I will remove it.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 6/6] linux: Use fchmodat2 on fchmod for flags different than 0 (BZ 26401)
  2023-10-31 10:27     ` Gabriel Ravier
@ 2023-10-31 14:14       ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella Netto @ 2023-10-31 14:14 UTC (permalink / raw)
  To: Gabriel Ravier, Florian Weimer; +Cc: libc-alpha, Joseph Myers



On 31/10/23 07:27, Gabriel Ravier wrote:
> On 10/31/23 08:28, Florian Weimer wrote:
>> * Adhemerval Zanella:
>>
>>> diff --git a/io/tst-lchmod.c b/io/tst-lchmod.c
>>> index 2bf4835b05..6496dc61e0 100644
>>> --- a/io/tst-lchmod.c
>>> +++ b/io/tst-lchmod.c
>>> @@ -219,9 +219,9 @@ test_1 (bool do_relative_path, int (*chmod_func) (int fd, const char *, mode_t,
>>>            /* The error code from the openat fallback leaks out.  */
>>>            if (errno != ENFILE && errno != EMFILE)
>>>              TEST_COMPARE (errno, EOPNOTSUPP);
>>> +     xstat (path_file, &st);
>>> +     TEST_COMPARE (st.st_mode & 0777, 3);
>>>          }
>>> -     xstat (path_file, &st);
>>> -     TEST_COMPARE (st.st_mode & 0777, 3);
>>>          /* Close the descriptors.  */
>>>        for (int *pfd = fd_list_begin (&fd_list); pfd < fd_list_end (&fd_list);
>> Why this test change?
> 
> Unless I'm misreading the original, it seems like the test would always fail if the call to `chmod_func` right before this occurs succeeds - any success is followed by two contradictory assertions that `(st.st_mode & 0777) == 2` and `(st.st_mode & 0777) == 3` (and that last test seems like its testing that the value of `st.st_mode & 0777` does not change when `chmod_func` fails.
> 

Yes, I found it when testing on a 6.6 kernel with fchmodat2.

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2023-10-31 14:14 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-30 21:32 [PATCH 0/6] Update from Linux 6.6 Adhemerval Zanella
2023-10-30 21:32 ` [PATCH 1/6] Update syscall lists for " Adhemerval Zanella
2023-10-30 21:39   ` Joseph Myers
2023-10-31 11:54     ` Adhemerval Zanella Netto
2023-10-30 21:32 ` [PATCH 2/6] Update kernel version to 6.5 in header constant tests Adhemerval Zanella
2023-10-30 21:45   ` Joseph Myers
2023-10-31 12:01     ` Adhemerval Zanella Netto
2023-10-30 21:32 ` [PATCH 3/6] linux: Add FSCONFIG_CMD_CREATE_EXCL from Linux 6.6 to sys/mount.h Adhemerval Zanella
2023-10-30 21:32 ` [PATCH 4/6] linux: Add HWCAP2_HBC from Linux 6.6 to AArch64 bits/hwcap.h Adhemerval Zanella
2023-10-30 21:32 ` [PATCH 5/6] linux: Sync Linux 6.6 elf.h Adhemerval Zanella
2023-10-31  8:29   ` Florian Weimer
2023-10-31 10:21     ` Gabriel Ravier
2023-10-31 10:37       ` Florian Weimer
2023-10-31 14:14         ` Adhemerval Zanella Netto
2023-10-30 21:32 ` [PATCH 6/6] linux: Use fchmodat2 on fchmod for flags different than 0 (BZ 26401) Adhemerval Zanella
2023-10-31  8:28   ` Florian Weimer
2023-10-31 10:27     ` Gabriel Ravier
2023-10-31 14:14       ` Adhemerval Zanella Netto
2023-10-31  8:30   ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).