linux/arch/sparc/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
adi_64.c sparc64: Fix prototype warnings in adi_64.c 2024-04-22 15:33:06 +02:00
apc.c sparc: Explicitly include correct DT includes 2023-08-28 13:30:57 -05:00
asm-offsets.c arch: fix asm-offsets.c building with -Wmissing-prototypes 2023-11-23 11:32:31 +01:00
audit.c
auxio_32.c sparc: Explicitly include correct DT includes 2023-08-28 13:30:57 -05:00
auxio_64.c sparc: Explicitly include correct DT includes 2023-08-28 13:30:57 -05:00
btext.c sparc: Use shared font data 2024-02-16 16:49:58 +01:00
central.c sparc: Explicitly include correct DT includes 2023-08-28 13:30:57 -05:00
cherrs.S
chmc.c sparc: chmc: Convert to platform remove callback returning void 2024-04-22 16:51:57 +02:00
compat_audit.c
cpu.c
cpumap.c sparc: Annotate struct cpuinfo_tree with __counted_by 2023-10-06 13:25:17 -07:00
cpumap.h
devices.c
ds.c Normalise "name (ad@dr)" MODULE_AUTHORs to "name <ad@dr>" 2024-03-06 13:07:39 -08:00
dtlb_miss.S
dtlb_prot.S
ebus.c
entry.h
entry.S sparc: replace #include <asm/export.h> with #include <linux/export.h> 2023-08-22 18:12:25 +09:00
etrap_32.S
etrap_64.S
fpu_traps.S
ftrace.c
getsetcc.S
head_32.S sparc32: Fix truncated relocation errors when linking large kernels 2024-07-11 15:58:18 +02:00
head_64.S sparc: replace #include <asm/export.h> with #include <linux/export.h> 2023-08-22 18:12:25 +09:00
helpers.S
hvapi.c
hvcalls.S
hvtramp.S
idprom.c
iommu_common.h
iommu-common.c
iommu.c
ioport.c sparc: Explicitly include correct DT includes 2023-08-28 13:30:57 -05:00
irq_32.c sparc32: Fix build with trapbase 2024-03-08 21:20:23 +01:00
irq_64.c sparc/irq: Remove on-stack cpumask var 2024-05-08 19:42:15 +02:00
irq.h
itlb_miss.S
ivec.S
jump_label.c
kernel.h sparc64: Fix prototype warning for uprobe_trap 2024-04-22 15:33:06 +02:00
kgdb_32.c sparc32: Fix build with trapbase 2024-03-08 21:20:23 +01:00
kgdb_64.c
kprobes.c sparc: Fix typos 2024-02-16 16:50:25 +01:00
kstack.h
ktlb.S
ldc.c sparc: Fix typos 2024-02-16 16:50:25 +01:00
led.c
leon_kernel.c sparc/leon: Remove on-stack cpumask var 2024-05-08 19:42:16 +02:00
leon_pci_grpci1.c sparc32: Fix section mismatch in leon_pci_grpci 2024-03-08 21:21:00 +01:00
leon_pci_grpci2.c sparc32: Fix section mismatch in leon_pci_grpci 2024-03-08 21:21:00 +01:00
leon_pci.c sparc: Explicitly include correct DT includes 2023-08-28 13:30:57 -05:00
leon_pmc.c arch/idle: Change arch_cpu_idle() behavior: always exit with IRQs disabled 2023-01-13 11:48:15 +01:00
leon_smp.c sparc32: Fix build with trapbase 2024-03-08 21:20:23 +01:00
Makefile arch: turn off -Werror for architectures with known warnings 2023-12-10 17:21:33 -08:00
mdesc.c
misctrap.S
module.c arch: make execmem setup available regardless of CONFIG_MODULES 2024-05-14 00:31:44 -07:00
nmi.c sparc64: NMI watchdog: fix return value of __setup handler 2024-02-16 16:50:25 +01:00
of_device_32.c sparc: Explicitly include correct DT includes 2023-08-28 13:30:57 -05:00
of_device_64.c sparc/of: Remove on-stack cpumask var 2024-05-08 19:42:15 +02:00
of_device_common.c sparc: Explicitly include correct DT includes 2023-08-28 13:30:57 -05:00
of_device_common.h
pci_common.c sparc: Explicitly include correct DT includes 2023-08-28 13:30:57 -05:00
pci_fire.c sparc: Explicitly include correct DT includes 2023-08-28 13:30:57 -05:00
pci_impl.h sparc: Fix typos 2024-02-16 16:50:25 +01:00
pci_msi.c sparc/pci_msi: Remove on-stack cpumask var 2024-05-08 19:42:15 +02:00
pci_psycho.c sparc: Explicitly include correct DT includes 2023-08-28 13:30:57 -05:00
pci_sabre.c sparc: Use device_get_match_data() 2024-01-19 08:08:53 -06:00
pci_schizo.c sparc: Fix typos 2024-02-16 16:50:25 +01:00
pci_sun4v_asm.S
pci_sun4v.c sparc64: Fix prototype warning for dma_4v_iotsb_bind 2024-04-22 15:33:06 +02:00
pci_sun4v.h
pci.c sparc: Fix typos 2024-02-16 16:50:25 +01:00
pcic.c PCI: Introduce pci_dev_for_each_resource() 2023-04-04 10:43:52 -05:00
pcr.c
perf_event.c sparc: Fix typos 2024-02-16 16:50:25 +01:00
pmc.c sparc: Explicitly include correct DT includes 2023-08-28 13:30:57 -05:00
power.c sparc: Explicitly include correct DT includes 2023-08-28 13:30:57 -05:00
process_32.c arch/idle: Change arch_cpu_idle() behavior: always exit with IRQs disabled 2023-01-13 11:48:15 +01:00
process_64.c TTY/Serial driver changes for 6.6-rc1 2023-09-01 09:38:00 -07:00
process.c
prom_32.c
prom_64.c sparc64: Fix number of online CPUs 2024-04-22 15:33:07 +02:00
prom_common.c
prom_irqtrans.c sparc: Fix typos 2024-02-16 16:50:25 +01:00
prom.h
psycho_common.c sparc: Fix typos 2024-02-16 16:50:25 +01:00
psycho_common.h
ptrace_32.c sparc: ptrace: user_regset_copyin_ignore() always returns 0 2022-11-15 14:30:41 -08:00
ptrace_64.c sparc: ptrace: user_regset_copyin_ignore() always returns 0 2022-11-15 14:30:41 -08:00
reboot.c
rtrap_32.S
rtrap_64.S
sbus.c sparc: Explicitly include correct DT includes 2023-08-28 13:30:57 -05:00
setup_32.c sparc32: Fix build with trapbase 2024-03-08 21:20:23 +01:00
setup_64.c sparc64: Fix number of online CPUs 2024-04-22 15:33:07 +02:00
signal32.c x86/shstk: Add user control-protection fault handler 2023-08-02 15:01:50 -07:00
signal_32.c sparc: Fix typos 2024-02-16 16:50:25 +01:00
signal_64.c sparc: Fix typos 2024-02-16 16:50:25 +01:00
sigutil_32.c
sigutil_64.c
sigutil.h
smp_32.c treewide: Trace IPIs sent via smp_send_reschedule() 2023-03-24 11:01:28 +01:00
smp_64.c sparc64: Fix number of online CPUs 2024-04-22 15:33:07 +02:00
sparc_ksyms.c
spiterrs.S
sstate.c
stacktrace.c
starfire.c
sun4d_irq.c
sun4d_smp.c
sun4m_irq.c
sun4m_smp.c
sun4v_ivec.S
sun4v_mcd.S
sun4v_tlb_miss.S
sys32.S sparc: fix compat recv/recvfrom syscalls 2024-06-25 15:57:25 +02:00
sys_sparc32.c
sys_sparc_32.c mm: make arch_get_unmapped_area() take vm_flags by default 2024-09-09 16:39:13 -07:00
sys_sparc_64.c mm: make arch_get_unmapped_area() take vm_flags by default 2024-09-09 16:39:13 -07:00
syscalls.S
sysfs.c
systbls_32.S
systbls_64.S
systbls.h
termios.c
time_32.c sparc: Explicitly include correct DT includes 2023-08-28 13:30:57 -05:00
time_64.c sparc64: Fix prototype warning for sched_clock 2024-04-22 15:33:06 +02:00
trampoline_32.S
trampoline_64.S
traps_32.c arch: include linux/cpu.h for trap_init() prototype 2023-11-23 11:32:31 +01:00
traps_64.c sparc64: Fix prototype warnings in traps_64.c 2024-04-22 15:33:06 +02:00
tsb.S
ttable_32.S
ttable_64.S
una_asm_32.S
una_asm_64.S
unaligned_32.c
unaligned_64.c
uprobes.c sparc64: Fix prototype warning for uprobe_trap 2024-04-22 15:33:06 +02:00
urtt_fill.S
utrap.S
vdso.c
vio.c driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
viohs.c
visemul.c
vmlinux.lds.S objtool/idle: Validate __cpuidle code as noinstr 2023-01-13 11:48:15 +01:00
windows.c
winfixup.S
wof.S
wuf.S