Skip to content

Add a new fchmodat2() syscall

Alexey Gladkov linux-alpha linux-api linux-arch linux-fsdevel linux-ia64 linux-m68k linux-mips linux-parisc linux-s390 linux-sh linuxppc-dev lkml sparclinux 2 versions Applied

Status from this message: Applied to the master branch of the vfs/vfs.git tree.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest5 patches 31 repliesApplied
  2. v35 patches 15 repliesSuperseded

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/5Non-functional cleanup of a "__user * filename"include/linux/syscalls.h+1 -10 replies
2/5fs: Add fchmodat2()fs/open.c include/linux/syscalls.h+16 -414 replies
3/5arch: Register fchmodat2, usually as syscall 452arch/alpha/kernel/syscalls/syscall.tbl arch/arm/tools/syscall.tbl arch/arm64/include/asm/unistd.h +16 more+23 -25 replies
4/5tools headers UAPI: Sync files changed by new fchmodat2 syscalltools/include/uapi/asm-generic/unistd.h tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl tools/perf/arch/powerpc/entry/syscalls/syscall.tbl +2 more+12 -12 replies
5/5selftests: Add fchmodat2 selftesttools/testing/selftests/Makefile tools/testing/selftests/fchmodat2/.gitignore tools/testing/selftests/fchmodat2/Makefile +1 more+171 -00 replies

Reviews trailers per patch

3 of 5 patches have a Reviewed-by or Acked-by.

PatchArnd BergmannGeert Uytterhoeven
1/5A-b
2/5A-b
3/5A-b A-b
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/5] Add a new fchmodat2() syscall

In glibc, the fchmodat(3) function has a flags argument according to the POSIX specification [1], but kernel syscalls has no such argument. Therefore, libc implementations do workarounds using /proc. However, this requires procfs to be mounted and accessible.

This patch set adds fchmodat2(), a new syscall. The syscall allows to pass the AT_SYMLINK_NOFOLLOW flag to disable LOOKUP_FOLLOW. In all other respects, this syscall is no different from fchmodat().

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/chmod.html

Changes since v3 [[email protected]]:

* Rebased to master because a new syscall has appeared in master.
* Increased __NR_compat_syscalls as pointed out by Arnd Bergmann.
* Syscall renamed fchmodat4 -> fchmodat2 as suggested by Christian Brauner.
* Returned do_fchmodat4() the original name. We don't need to version internal functions.
* Fixed warnings found by checkpatch.pl.

Changes since v2 [[email protected]]:

* Rebased to master.
* The lookup_flags passed to sys_fchmodat4 as suggested by Al Viro.
* Selftest added.

Changes since v1 [[email protected]]:

* All architectures are now supported, which support squashed into a single patch.
* The do_fchmodat() helper function has been removed, in favor of directly calling do_fchmodat4().
* The patches are based on 5.2 instead of 5.1.

---

Alexey Gladkov (2):
fs: Add fchmodat2()
selftests: Add fchmodat2 selftest

Palmer Dabbelt (3):
Non-functional cleanup of a "__user * filename"
arch: Register fchmodat2, usually as syscall 452 tools headers UAPI: Sync files changed by new fchmodat2 syscall

 arch/alpha/kernel/syscalls/syscall.tbl        |   1 +
 arch/arm/tools/syscall.tbl                    |   1 +
 arch/arm64/include/asm/unistd.h               |   2 +-
 arch/arm64/include/asm/unistd32.h             |   2 +
 arch/ia64/kernel/syscalls/syscall.tbl         |   1 +
 arch/m68k/kernel/syscalls/syscall.tbl         |   1 +
 arch/microblaze/kernel/syscalls/syscall.tbl   |   1 +
 arch/mips/kernel/syscalls/syscall_n32.tbl     |   1 +
 arch/mips/kernel/syscalls/syscall_n64.tbl     |   1 +
 arch/mips/kernel/syscalls/syscall_o32.tbl     |   1 +
 arch/parisc/kernel/syscalls/syscall.tbl       |   1 +
 arch/powerpc/kernel/syscalls/syscall.tbl      |   1 +
 arch/s390/kernel/syscalls/syscall.tbl         |   1 +
 arch/sh/kernel/syscalls/syscall.tbl           |   1 +
 arch/sparc/kernel/syscalls/syscall.tbl        |   1 +
 arch/x86/entry/syscalls/syscall_32.tbl        |   1 +
 arch/x86/entry/syscalls/syscall_64.tbl        |   1 +
 arch/xtensa/kernel/syscalls/syscall.tbl       |   1 +
 fs/open.c                                     |  18 +-
 include/linux/syscalls.h                      |   4 +-
 include/uapi/asm-generic/unistd.h             |   5 +-
 tools/include/uapi/asm-generic/unistd.h       |   5 +-
 .../arch/mips/entry/syscalls/syscall_n64.tbl  |   2 +
 .../arch/powerpc/entry/syscalls/syscall.tbl   |   2 +
 .../perf/arch/s390/entry/syscalls/syscall.tbl |   2 +
 .../arch/x86/entry/syscalls/syscall_64.tbl    |   2 +
 tools/testing/selftests/Makefile              |   1 +
 tools/testing/selftests/fchmodat2/.gitignore  |   2 +
 tools/testing/selftests/fchmodat2/Makefile    |   6 +
 .../selftests/fchmodat2/fchmodat2_test.c      | 162 ++++++++++++++++++
 30 files changed, 223 insertions(+), 8 deletions(-)
 create mode 100644 tools/testing/selftests/fchmodat2/.gitignore
 create mode 100644 tools/testing/selftests/fchmodat2/Makefile
 create mode 100644 tools/testing/selftests/fchmodat2/fchmodat2_test.c
Signature · 1 line
2.33.8