linux/arch/s390/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
vdso32 more s390 updates for 6.10 merge window 2024-05-21 12:09:36 -07:00
vdso64 s390/vdso: Use one large alternative instead of an alternative branch 2024-09-23 17:57:04 +02:00
.gitignore
abs_lowcore.c s390: Add infrastructure to patch lowcore accesses 2024-07-23 16:02:32 +02:00
alternative.c s390: Add infrastructure to patch lowcore accesses 2024-07-23 16:02:32 +02:00
asm-offsets.c s390/entry: Unify save_area_sync and save_area_async 2024-08-29 22:56:34 +02:00
audit.c
audit.h
cache.c s390/cache: prevent rebuild of shared_cpu_list 2024-03-07 14:41:15 +01:00
cert_store.c fix missing vmalloc.h includes 2024-04-25 20:55:49 -07:00
compat_audit.c
compat_linux.c
compat_linux.h
compat_ptrace.h
compat_signal.c s390/vdso: Move vdso symbol handling to separate header file 2024-09-13 17:28:36 +02:00
cpacf.c s390/crypto: Display Query and Query Authentication Information in sysfs 2024-09-12 14:13:27 +02:00
cpcmd.c s390: include linux/io.h instead of asm/io.h 2023-07-03 11:19:40 +02:00
cpufeature.c
crash_dump.c s390/crash: Do not use VM info if os_info does not have it 2024-06-05 17:03:24 +02:00
ctlreg.c s390/ctlreg: add system_ctl_load() 2023-09-19 13:26:57 +02:00
debug.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
diag.c s390/wti: Introduce infrastructure for warning track interrupt 2024-08-29 22:56:34 +02:00
dis.c s390/disassembler: Remove duplicate instruction format RSY_RDRU 2024-09-12 14:13:27 +02:00
dumpstack.c s390: Replace S390_lowcore by get_lowcore() 2024-06-18 17:01:33 +02:00
early_printk.c s390/early: Dump register contents and call trace for early crashes 2024-08-22 19:28:11 +02:00
early.c s390/setup: Recognize sequential instruction fetching facility 2024-08-29 22:56:34 +02:00
ebcdic.c s390/ebcdic: fix typo in comment 2023-07-27 13:11:35 +02:00
entry.h s390/switch_to: use generic header file 2024-02-12 15:03:33 +01:00
entry.S s390 updates for 6.12 merge window 2024-09-21 09:02:54 -07:00
facility.c KVM: s390: vsie: Fix length of facility list shadowed 2023-12-23 10:41:09 +01:00
fpu.c s390/fpu: Re-add exception handling in load_fpu_state() 2024-07-31 16:30:20 +02:00
ftrace.c s390/ftrace: Avoid extra serialization for graph caller patching 2024-08-29 22:56:34 +02:00
ftrace.h s390/ftrace: Remove unused ftrace_plt_template* 2024-08-27 20:16:48 +02:00
guarded_storage.c s390: use control register bit defines 2023-09-19 13:26:57 +02:00
head64.S s390/head64: Make startup code ready for lowcore relocation 2024-07-23 16:02:32 +02:00
hiperdispatch.c s390/hiperdispatch: Add hiperdispatch debug counters 2024-08-29 22:56:35 +02:00
idle.c s390/idle: Remove duplicate get_lowcore() calls 2024-06-18 17:01:33 +02:00
ima_arch.c
ipl_vmparm.c
ipl.c s390/smp: Handle restart interrupt on ipl cpu 2024-07-23 16:02:31 +02:00
irq.c s390/wti: Introduce infrastructure for warning track interrupt 2024-08-29 22:56:34 +02:00
jump_label.c
kdebugfs.c
kexec_elf.c s390, crash: wrap crash dumping code into crash related ifdefs 2024-02-23 17:48:23 -08:00
kexec_image.c s390, crash: wrap crash dumping code into crash related ifdefs 2024-02-23 17:48:23 -08:00
kprobes.c s390/kprobes: Avoid stop machine if possible 2024-08-29 22:56:34 +02:00
lgr.c
machine_kexec_file.c s390, crash: wrap crash dumping code into crash related ifdefs 2024-02-23 17:48:23 -08:00
machine_kexec_reloc.c
machine_kexec.c s390/kdump: Make kdump ready for lowcore relocation 2024-07-23 16:02:32 +02:00
Makefile s390/crypto: Display Query and Query Authentication Information in sysfs 2024-09-12 14:13:27 +02:00
mcount.S s390: Use MARCH_HAS_*_FEATURES defines 2024-09-07 17:12:42 +02:00
module.c arch: make execmem setup available regardless of CONFIG_MODULES 2024-05-14 00:31:44 -07:00
nmi.c s390/nmi: Remove duplicate get_lowcore() calls 2024-06-18 17:01:33 +02:00
nospec-branch.c s390/nospec: Push down alternative handling 2024-07-23 16:02:31 +02:00
nospec-sysfs.c s390/nospec: Push down alternative handling 2024-07-23 16:02:31 +02:00
numa.c arch, mm: move definition of node_data to generic code 2024-09-03 21:15:28 -07:00
os_info.c s390/os_info: Fix array size in struct os_info 2024-04-29 17:33:29 +02:00
perf_cpum_cf_events.c s390/cpum_cf: make crypto counters upward compatible across machine types 2024-04-09 17:29:56 +02:00
perf_cpum_cf.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
perf_cpum_sf.c s390/cpum_sf: Remove WARN_ON_ONCE statements 2024-08-22 19:28:11 +02:00
perf_event.c s390/stacktrace: Merge perf_callchain_user() and arch_stack_walk_user() 2024-05-14 13:37:06 +02:00
perf_pai_crypto.c s390/pai_crypto: Add support for MSA 10 and 11 pai counters 2024-09-05 15:17:23 +02:00
perf_pai_ext.c s390/pai_ext: Update PAI extension 1 counters 2024-09-05 15:17:23 +02:00
perf_regs.c s390/fpu: remove anonymous union from struct fpu 2024-02-16 14:30:16 +01:00
process.c s390: Replace S390_lowcore by get_lowcore() 2024-06-18 17:01:33 +02:00
processor.c s390/alternatives: Move text sync functions 2024-07-23 16:02:31 +02:00
ptrace.c s390/fpu: remove anonymous union from struct fpu 2024-02-16 14:30:16 +01:00
reipl.S s390/kdump: Make kdump ready for lowcore relocation 2024-07-23 16:02:32 +02:00
relocate_kernel.S s390/relocate_kernel: adjust indentation 2023-04-19 17:24:18 +02:00
rethook.c s390/rethook: add local rethook header file 2023-02-06 11:13:53 +01:00
rethook.h s390/rethook: add local rethook header file 2023-02-06 11:13:53 +01:00
runtime_instr.c
setup.c s390/mm: Prevent lowcore vs identity mapping overlap 2024-08-21 16:14:45 +02:00
signal.c s390/vdso: Move vdso symbol handling to separate header file 2024-09-13 17:28:36 +02:00
smp.c s390/smp: Add cpu capacities 2024-08-29 22:56:35 +02:00
stacktrace.c s390/ftrace: Avoid calling unwinder in ftrace_return_address() 2024-08-27 20:16:48 +02:00
sthyi.c s390/sthyi: Use cached data when diag is busy 2024-07-10 19:50:45 +02:00
syscall.c s390 updates for 6.11 merge window 2024-07-18 15:41:45 -07:00
sysinfo.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
text_amode31.S s390/hypfs_diag0c: fix virtual vs physical address confusion 2024-02-09 13:58:13 +01:00
time.c s390: Replace S390_lowcore by get_lowcore() 2024-06-18 17:01:33 +02:00
topology.c s390/hiperdispatch: Introduce hiperdispatch 2024-08-29 22:56:35 +02:00
trace.c
traps.c - 875fa64577da ("mm/hugetlb_vmemmap: fix race with speculative PFN 2024-07-21 17:15:46 -07:00
unwind_bc.c s390/unwind: disable KMSAN checks 2024-07-03 19:30:25 -07:00
uprobes.c s390/switch_to: use generic header file 2024-02-12 15:03:33 +01:00
uv.c s390/uv: convert gmap_destroy_page() from follow_page() to folio_walk 2024-09-01 20:26:01 -07:00
vdso.c s390/vdso: Wire up getrandom() vdso implementation 2024-09-13 20:57:31 +02:00
vmcore_info.c s390/vmcoreinfo: Store virtual memory layout 2024-04-17 13:38:01 +02:00
vmlinux.lds.S asm-generic updates for 6.12 2024-09-26 11:54:40 -07:00
vtime.c s390/vtime: Remove duplicate get_lowcore() calls 2024-06-18 17:01:33 +02:00
wti.c s390/wti: Add debugfs file to display missed grace periods per cpu 2024-08-29 22:56:35 +02:00