linux-loongson/arch/parisc/include/asm
John David Anglin 89f686a0fb parisc: Revise __get_user() to probe user read access
Because of the way read access support is implemented, read access
interruptions are only triggered at privilege levels 2 and 3. The
kernel executes at privilege level 0, so __get_user() never triggers
a read access interruption (code 26). Thus, it is currently possible
for user code to access a read protected address via a system call.

Fix this by probing read access rights at privilege level 3 (PRIV_USER)
and setting __gu_err to -EFAULT (-14) if access isn't allowed.

Note the cmpiclr instruction does a 32-bit compare because COND macro
doesn't work inside asm.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org # v5.12+
2025-07-25 22:45:24 +02:00
..
alternative.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
asm-offsets.h
asmregs.h
assembly.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
atomic.h locking/atomic: parisc: add preprocessor symbols 2023-06-05 09:57:16 +02:00
barrier.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
bitops.h Revert "parisc: Show error if wrong 32/64-bit compiler is being used" 2022-08-22 11:09:17 +02:00
bug.h parisc: Fix asm operand number out of range build error in bug table 2023-11-27 11:01:38 +01:00
cache.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
cacheflush.h parisc: Try to fix random segmentation faults in package builds 2024-06-12 01:57:05 +02:00
cachetype.h Introduce cpu_dcache_is_aliasing() across all architectures 2024-02-22 15:27:19 -08:00
checksum.h parisc: Strip upper 32 bit of sum in csum_ipv6_magic for 64-bit builds 2024-02-27 22:51:45 +01:00
cmpxchg.h parisc: add u16 support to cmpxchg() 2024-04-09 22:06:00 -07:00
compat_ucontext.h
compat.h asm-generic: compat: Cleanup duplicate definitions 2022-04-26 13:35:54 -07:00
current.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
delay.h
dma-mapping.h dma-mapping: no need to pass a bus_type into get_arch_dma_ops() 2023-02-15 12:35:20 +01:00
dma.h parisc: dma: Add prototype for pcxl_dma_start 2023-08-10 19:12:16 +02:00
dwarf.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
eisa_bus.h
eisa_eeprom.h
elf.h parisc: fix mmap_base calculation when stack grows upwards 2023-11-15 15:30:09 -08:00
extable.h parisc: Fix random data corruption from exception handler 2024-01-30 17:18:58 +01:00
fixmap.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
floppy.h arch/*/: remove CONFIG_VIRT_TO_BUS 2022-06-28 13:20:21 +02:00
ftrace.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
futex.h uaccess: remove CONFIG_SET_FS 2022-02-25 09:36:06 +01:00
grfioctl.h parisc: Drop HP-UX constants and structs from grfioctl.h 2023-05-03 17:43:26 +02:00
hardirq.h
hardware.h parisc: Avoid printing the hardware path twice 2022-10-31 15:37:14 +01:00
hash.h
hugetlb.h mm: hugetlb: Add huge page size param to huge_ptep_get_and_clear() 2025-02-27 17:40:57 +00:00
io.h - The 6 patch series "Enable strict percpu address space checks" from 2025-04-01 09:29:18 -07:00
irq.h
irqflags.h parisc: Check if IRQs are disabled when calling arch_local_irq_restore() 2023-06-30 17:14:13 +02:00
jump_label.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
kbdleds.h
Kbuild char/agp: introduce asm-generic/agp.h 2023-02-13 22:13:29 +01:00
kexec.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
kfence.h parisc: Add KFENCE support 2021-10-30 23:11:00 +02:00
kgdb.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
kprobes.h parisc/kprobes: always include asm-generic/kprobes.h 2024-02-16 20:18:03 +01:00
ldcw.h parisc: Mark lock_aligned variables 16-byte aligned on SMP 2023-11-25 09:43:17 +01:00
led.h parisc: led: Rewrite LED/LCD driver to utilizize Linux LED subsystem 2023-08-28 17:58:14 +02:00
linkage.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
mman.h mm: refactor arch_calc_vm_flag_bits() and arm64 MTE handling 2024-11-05 16:49:55 -08:00
mmu_context.h parisc: Use constants to encode the space registers like SR_KERNEL 2022-03-11 19:49:31 +01:00
mmu.h parisc: Add vDSO support 2022-03-11 19:49:30 +01:00
mmzone.h
module.h
page.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
parisc-device.h driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
parport.h
pci.h PCI: Remove pci_get_legacy_ide_irq() and asm-generic/pci.h 2022-07-22 17:23:45 -05:00
pdc_chassis.h
pdc.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
pdcpat.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
perf_event.h
perf.h
pgalloc.h mm: pass mm down to pagetable_{pte,pmd}_ctor 2025-05-11 17:48:21 -07:00
pgtable.h parisc: Define and use set_pte_at() 2025-07-25 22:45:23 +02:00
prefetch.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
processor.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
psw.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
ptrace.h parisc: Use PRIV_USER and PRIV_KERNEL in ptrace.h 2021-11-01 07:36:00 +01:00
ropes.h parisc: sba-iommu: Fix sparse warnigs 2023-08-31 21:42:42 +02:00
rt_sigframe.h parisc: Add vDSO support 2022-03-11 19:49:30 +01:00
runway.h parisc: ccio-dma: Create private runway procfs root entry 2023-08-28 18:00:27 +02:00
seccomp.h
sections.h asm-generic: Refactor dereference_[kernel]_function_descriptor() 2022-02-16 23:25:11 +11:00
serial.h
shmparam.h parisc: shmparam.h: Document aliasing requirements of PA-RISC 2023-09-07 08:00:32 +02:00
signal.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
smp.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
socket.h
sparsemem.h
special_insns.h parisc: Check region is readable by user in raw_copy_from_user() 2025-07-25 22:45:23 +02:00
spinlock_types.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
spinlock.h parisc: Fix lightweight spinlock checks to not break futexes 2023-08-10 17:32:09 +02:00
string.h Revert "parisc: Add assembly implementations for memset, strlen, strcpy, strncpy and strcat" 2021-08-29 10:13:32 -07:00
superio.h
switch_to.h
syscall.h syscall.h: introduce syscall_set_nr() 2025-05-11 17:48:15 -07:00
text-patching.h asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
thread_info.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
timex.h parisc: define get_cycles macro for arch-override 2022-05-13 23:59:23 +02:00
tlb.h
tlbflush.h parisc: Add vDSO support 2022-03-11 19:49:30 +01:00
topology.h parisc: Switch from GENERIC_CPU_DEVICES to GENERIC_ARCH_TOPOLOGY 2022-03-29 21:37:12 +02:00
traps.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
uaccess.h parisc: Revise __get_user() to probe user read access 2025-07-25 22:45:24 +02:00
ucontext.h
unistd.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
unwind.h
vdso.h parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-05-04 20:46:27 +02:00
video.h arch: Rename fbdev header and source files 2024-05-03 17:07:50 +02:00
vmalloc.h