linux-stable/arch/riscv/mm
Björn Töpel 416721ff05
riscv, mm: Perform BPF exhandler fixup on page fault
Commit 21855cac82 ("riscv/mm: Prevent kernel module to access user
memory without uaccess routines") added early exits/deaths for page
faults stemming from accesses to user-space without using proper
uaccess routines (where sstatus.SUM is set).

Unfortunatly, this is too strict for some BPF programs, which relies
on BPF exhandler fixups. These BPF programs loads "BTF pointers". A
BTF pointers could either be a valid kernel pointer or NULL, but not a
userspace address.

Resolve the problem by calling the fixup handler in the early exit
path.

Fixes: 21855cac82 ("riscv/mm: Prevent kernel module to access user memory without uaccess routines")
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
Link: https://lore.kernel.org/r/20230214162515.184827-1-bjorn@kernel.org
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-02-21 17:21:39 -08:00
..
cacheflush.c Merge patch series "RISC-V: Ensure Zicbom has a valid block size" 2022-12-09 19:13:01 -08:00
context.c riscv: mm: notify remote harts about mmu cache updates 2022-12-08 15:18:16 -08:00
dma-noncoherent.c RISC-V: Fix compilation without RISCV_ISA_ZICBOM 2022-10-21 11:52:39 +05:30
extable.c riscv: extable: fix err reg writing in dedicated uaccess handler 2022-02-08 17:02:47 -08:00
fault.c riscv, mm: Perform BPF exhandler fixup on page fault 2023-02-21 17:21:39 -08:00
hugetlbpage.c
init.c RISC-V Patches for the 6.2 Merge Window, Part 1 2022-12-14 15:23:49 -08:00
kasan_init.c riscv: mm: add missing memcpy in kasan_init 2022-10-27 14:55:58 -07:00
Makefile Merge patch series "Add PMEM support for RISC-V" 2022-12-08 15:45:28 -08:00
pageattr.c mm: pagewalk: Fix race between unmap and page walker 2022-09-03 10:13:13 -07:00
pgtable.c riscv: Enable HAVE_ARCH_HUGE_VMAP for 64BIT 2022-10-28 17:10:01 -07:00
physaddr.c riscv: Fix crash during early errata patching 2022-12-08 17:22:53 -08:00
pmem.c RISC-V: Implement arch specific PMEM APIs 2022-12-08 15:43:59 -08:00
ptdump.c
tlbflush.c riscv: mm: notify remote harts about mmu cache updates 2022-12-08 15:18:16 -08:00