linux/arch/m68k/kernel
Christian Göttsche 6140be90ec fs/xattr: add *at family syscalls
Add the four syscalls setxattrat(), getxattrat(), listxattrat() and
removexattrat().  Those can be used to operate on extended attributes,
especially security related ones, either relative to a pinned directory
or on a file descriptor without read access, avoiding a
/proc/<pid>/fd/<fd> detour, requiring a mounted procfs.

One use case will be setfiles(8) setting SELinux file contexts
("security.selinux") without race conditions and without a file
descriptor opened with read access requiring SELinux read permission.

Use the do_{name}at() pattern from fs/open.c.

Pass the value of the extended attribute, its length, and for
setxattrat(2) the command (XATTR_CREATE or XATTR_REPLACE) via an added
struct xattr_args to not exceed six syscall arguments and not
merging the AT_* and XATTR_* flags.

[AV: fixes by Christian Brauner folded in, the entire thing rebased on
top of {filename,file}_...xattr() primitives, treatment of empty
pathnames regularized.  As the result, AT_EMPTY_PATH+NULL handling
is cheap, so f...(2) can use it]

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Link: https://lore.kernel.org/r/20240426162042.191916-1-cgoettsche@seltendoof.de
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Christian Brauner <brauner@kernel.org>
CC: x86@kernel.org
CC: linux-alpha@vger.kernel.org
CC: linux-kernel@vger.kernel.org
CC: linux-arm-kernel@lists.infradead.org
CC: linux-ia64@vger.kernel.org
CC: linux-m68k@lists.linux-m68k.org
CC: linux-mips@vger.kernel.org
CC: linux-parisc@vger.kernel.org
CC: linuxppc-dev@lists.ozlabs.org
CC: linux-s390@vger.kernel.org
CC: linux-sh@vger.kernel.org
CC: sparclinux@vger.kernel.org
CC: linux-fsdevel@vger.kernel.org
CC: audit@vger.kernel.org
CC: linux-arch@vger.kernel.org
CC: linux-api@vger.kernel.org
CC: linux-security-module@vger.kernel.org
CC: selinux@vger.kernel.org
[brauner: slight tweaks]
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2024-11-06 12:59:44 -05:00
..
syscalls fs/xattr: add *at family syscalls 2024-11-06 12:59:44 -05:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
asm-offsets.c m68k: Remove set_fs() 2021-09-24 13:35:07 +02:00
bootinfo_proc.c proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
dma.c m68k: remove unused includes from dma.c 2023-10-22 16:38:55 +02:00
early_printk.c m68k: mvme16x: Add and use "mvme16x.h" 2023-10-06 10:03:03 +02:00
entry.S m68k: Fix spinlock race in kernel thread creation 2024-05-08 17:43:22 +02:00
head.S m68k: Replace GPL 2.0+ README.legal boilerplate with SPDX 2023-10-06 10:03:04 +02:00
ints.c m68k: kernel: Add and use "ints.h" 2023-10-06 10:03:01 +02:00
ints.h m68k: kernel: Add and use "ints.h" 2023-10-06 10:03:01 +02:00
irq.c
machine_kexec.c m68k: kexec: Include <linux/reboot.h> 2023-04-21 09:53:54 +02:00
Makefile m68k, kexec: fix the incorrect ifdeffery and build dependency of CONFIG_KEXEC 2023-12-12 17:20:17 -08:00
module.c
pcibios.c m68k/pci: Drop useless pcibios_setup() 2023-08-21 08:45:36 +10:00
process.c m68k: Fix kernel_clone_args.flags in m68k_clone() 2024-08-26 10:24:34 +02:00
process.h m68k: kernel: Add and use "process.h" 2023-10-06 10:03:01 +02:00
ptrace.c m68k: kernel: Add and use "ptrace.h" 2023-10-06 10:03:01 +02:00
ptrace.h m68k: kernel: Add and use "ptrace.h" 2023-10-06 10:03:01 +02:00
relocate_kernel.S m68k: Fix invalid .section syntax 2023-07-24 14:50:02 +02:00
setup_mm.c m68k: mm: Move paging_init() to common <asm/pgtable.h> 2023-10-06 10:03:02 +02:00
setup_no.c m68k: remove trailing space after \n newline 2024-09-09 08:33:35 +10:00
setup.c m68k: pull mach_beep in setup.c 2017-11-06 08:25:21 +10:00
signal.c m68k: kernel: Add and use "signal.h" 2023-10-06 10:03:01 +02:00
signal.h m68k: kernel: Add and use "signal.h" 2023-10-06 10:03:01 +02:00
sun3-head.S m68k/sun3: Remove is_medusa and m68k_pgtable_cachemode 2018-08-31 09:30:42 +02:00
sys_m68k.c m68k: mm: Add and use "fault.h" 2023-10-06 10:03:02 +02:00
syscalltable.S m68k: syscalls: switch to generic syscalltbl.sh 2021-04-06 09:33:20 +02:00
time.c m68knommu: fix undefined reference to `mach_get_rtc_pll' 2022-05-25 00:03:58 +10:00
traps.c m68k: kernel: Fix indentation by 7 spaces in traps.c 2023-10-16 14:30:39 +02:00
traps.h m68k: kernel: Add and use "traps.h" 2023-10-06 10:03:01 +02:00
uboot.c m68k: coldfire: fix warnings in uboot argument processing 2023-10-23 08:22:22 +10:00
vectors.c m68k: kernel: Add and use "vectors.h" 2023-10-06 10:03:01 +02:00
vectors.h m68k: kernel: Add and use "vectors.h" 2023-10-06 10:03:01 +02:00
vmlinux-nommu.lds objtool/idle: Validate __cpuidle code as noinstr 2023-01-13 11:48:15 +01:00
vmlinux-std.lds objtool/idle: Validate __cpuidle code as noinstr 2023-01-13 11:48:15 +01:00
vmlinux-sun3.lds objtool/idle: Validate __cpuidle code as noinstr 2023-01-13 11:48:15 +01:00
vmlinux.lds.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00