[PATCH v2 5/5] arm64: kernel: Don't toggle PAN on systems with UAO

Catalin Marinas catalin.marinas at arm.com
Thu Feb 18 06:36:48 PST 2016


On Fri, Feb 05, 2016 at 02:58:50PM +0000, James Morse wrote:
> --- a/arch/arm64/mm/fault.c
> +++ b/arch/arm64/mm/fault.c
> @@ -234,6 +234,9 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
>  	}
>  
>  	if (permission_fault(esr) && (addr < USER_DS)) {
> +		if (get_thread_info(regs->sp)->addr_limit == KERNEL_DS)
> +			panic("Accessing user space memory with fs=KERNEL_DS");

We could simply use "get_fs() == KERNEL_DS" as we should call
do_page_fault() outside the current context.

-- 
Catalin



More information about the linux-arm-kernel mailing list