linux/arch/arm/include/asm
Peter Collingbourne 23acdc76f1 signal: clear non-uapi flag bits when passing/returning sa_flags
Previously we were not clearing non-uapi flag bits in
sigaction.sa_flags when storing the userspace-provided sa_flags or
when returning them via oldact. Start doing so.

This allows userspace to detect missing support for flag bits and
allows the kernel to use non-uapi bits internally, as we are already
doing in arch/x86 for two flag bits. Now that this change is in
place, we no longer need the code in arch/x86 that was hiding these
bits from userspace, so remove it.

This is technically a userspace-visible behavior change for sigaction, as
the unknown bits returned via oldact.sa_flags are no longer set. However,
we are free to define the behavior for unknown bits exactly because
their behavior is currently undefined, so for now we can define the
meaning of each of them to be "clear the bit in oldact.sa_flags unless
the bit becomes known in the future". Furthermore, this behavior is
consistent with OpenBSD [1], illumos [2] and XNU [3] (FreeBSD [4] and
NetBSD [5] fail the syscall if unknown bits are set). So there is some
precedent for this behavior in other kernels, and in particular in XNU,
which is probably the most popular kernel among those that I looked at,
which means that this change is less likely to be a compatibility issue.

Link: [1] f634a6a4b5/sys/kern/kern_sig.c (L278)
Link: [2] 76f19f5fdc/usr/src/uts/common/syscall/sigaction.c (L86)
Link: [3] a449c6a3b8/bsd/kern/kern_sig.c (L480)
Link: [4] eded70c370/sys/kern/kern_sig.c (L699)
Link: [5] 3365779bec/sys/kern/sys_sig.c (L473)
Signed-off-by: Peter Collingbourne <pcc@google.com>
Reviewed-by: Dave Martin <Dave.Martin@arm.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Link: https://linux-review.googlesource.com/id/I35aab6f5be932505d90f3b3450c083b4db1eca86
Link: https://lkml.kernel.org/r/878dbcb5f47bc9b11881c81f745c0bef5c23f97f.1605235762.git.pcc@google.com
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
2020-11-23 10:31:05 -06:00
..
hardware
mach treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
vdso vdso/treewide: Add vdso_data pointer argument to __arch_get_hw_counter() 2020-08-06 10:57:30 +02:00
xen xen/arm: do not setup the runstate info page if kpti is enabled 2020-10-04 18:41:33 -05:00
arch_gicv3.h
arch_timer.h
arm-cci.h
asm-offsets.h
assembler.h
atomic.h
auxvec.h
barrier.h
bitops.h
bitrev.h
bL_switcher.h
bug.h
bugs.h
cache.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
cacheflush.h
cachetype.h
checksum.h arm: propagate the calling convention changes down to csum_partial_copy_from_user() 2020-08-20 15:45:16 -04:00
clocksource.h
cmpxchg.h
compiler.h
cp15.h
cpu.h
cpufeature.h
cpuidle.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
cputype.h
cti.h
dcc.h
delay.h
device.h
div64.h
dma-direct.h ARM/omap1: switch to use dma_direct_set_offset for lbus DMA offsets 2020-09-25 06:15:32 +02:00
dma-iommu.h dma-mapping: move dma-debug.h to kernel/dma/ 2020-10-06 07:07:05 +02:00
dma-mapping.h dma-mapping: move dma-debug.h to kernel/dma/ 2020-10-06 07:07:05 +02:00
dma.h
dmi.h
domain.h
ecard.h
edac.h
efi.h efi/libstub: arm32: Base FDT and initrd placement on image address 2020-09-16 18:53:42 +03:00
elf.h
entry-macro-multi.S
exception.h
fb.h
fiq.h
firmware.h
fixmap.h
floppy.h
fncpy.h
fpstate.h
ftrace.h
futex.h
glue-cache.h
glue-df.h
glue-pf.h
glue-proc.h
glue.h
gpio.h
hardirq.h ARM: Remove custom IRQ stat accounting 2020-09-17 16:37:28 +01:00
highmem.h
hugetlb-3level.h
hugetlb.h
hw_breakpoint.h
hw_irq.h
hwcap.h
hypervisor.h
ide.h
idmap.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
insn.h
io.h
irq.h
irq_work.h
irqflags.h
jump_label.h
Kbuild
kexec.h
kgdb.h
kmap_types.h
kprobes.h
krait-l2-accessors.h
linkage.h
mc146818rtc.h
mcpm.h
mcs_spinlock.h
memblock.h
memory.h
mmu.h
mmu_context.h
module.h
module.lds.h kbuild: preprocess module linker script 2020-09-25 00:36:41 +09:00
mpu.h
mtd-xip.h
neon.h
nwflash.h
opcodes-sec.h
opcodes-virt.h
opcodes.h
outercache.h
page-nommu.h
page.h
paravirt.h
patch.h
pci.h
percpu.h
perf_event.h
pgalloc.h asm-generic: pgalloc: provide generic pgd_free() 2020-08-07 11:33:26 -07:00
pgtable-2level-hwdef.h
pgtable-2level-types.h
pgtable-2level.h
pgtable-3level-hwdef.h
pgtable-3level-types.h
pgtable-3level.h
pgtable-hwdef.h
pgtable-nommu.h
pgtable.h
probes.h
proc-fns.h
processor.h
procinfo.h
prom.h
psci.h
ptdump.h
ptrace.h
sections.h
secure_cntvoff.h
set_memory.h
setup.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
shmparam.h
signal.h signal: clear non-uapi flag bits when passing/returning sa_flags 2020-11-23 10:31:05 -06:00
smp.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
smp_plat.h
smp_scu.h
smp_twd.h
sparsemem.h
spinlock.h
spinlock_types.h
stackprotector.h
stacktrace.h
string.h
suspend.h
swab.h
switch_to.h
sync_bitops.h
syscall.h
system_info.h
system_misc.h
tcm.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
therm.h
thread_info.h
thread_notify.h
timex.h
tlb.h mm: account PMD tables like PTE tables 2020-10-13 18:38:31 -07:00
tlbflush.h
tls.h
topology.h arm: disable frequency invariance for CONFIG_BL_SWITCHER 2020-10-08 17:17:27 +02:00
traps.h
uaccess-asm.h
uaccess.h uaccess: remove segment_eq 2020-08-12 10:57:58 -07:00
ucontext.h
unaligned.h
unified.h
unistd.h
unwind.h
uprobes.h
user.h
v7m.h
vdso.h
vdso_datapage.h
vermagic.h
vfp.h
vfpmacros.h
vga.h
virt.h
vmalloc.h
vmlinux.lds.h arm/build: Assert for unwanted sections 2020-09-01 10:03:18 +02:00
word-at-a-time.h
xor.h