Re: [RFC PATCH v2 1/2] ARM/mm/fault: always goto bad_area when handling with page faults of kernel address

Sebastian Andrzej Siewior
2025-11-27T14:51:31Z

On 2025-11-27 22:01:08 [+0800], Xie Yuanbin wrote:
> --- a/arch/arm/mm/fault.c
> +++ b/arch/arm/mm/fault.c
> @@ -270,10 +270,15 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
> vm_flags_t vm_flags = VM_ACCESS_FLAGS;
>
> if (kprobe_page_fault(regs, fsr))
> return 0;
>
> + if (unlikely(addr >= TASK_SIZE)) {
> + fault = 0;
> + code = SEGV_MAPERR;
> + goto bad_area;
> + }
>
> /* Enable interrupts if they were enabled in the parent context. */
> if (interrupts_enabled(regs))
> local_irq_enable();

What is with the patch I sent wrong?

Sebastian