cxl: fix setting of _PAGE_USER bit when handling page faults
Ian Munsie
imunsie at au1.ibm.com
Sat Mar 26 04:15:49 AEDT 2016
Excerpts from Michael Ellerman's message of 2016-03-25 05:01:38 -0500:
> I think you can (should) use is_kernel_addr() for the DAR check.
>
> I'm also slightly worried by that logic in the case of a non-kernel context.
>
> ie. if ctx->kernel is false, we get:
>
> if (true || !is_kernel_addr(dar))
> access |= _PAGE_USER;
>
> Which means we just add _PAGE_USER for any address. What am I missing here?
It's been ages since I did a deep dive on the related mm code, so I
don't recall the precise details so take this with a grain of salt, but
if memory serves the call to copro_handle_mm_fault will fail if a user
is trying to access a kernel region since it won't be mapped in the mm.
-Ian
More information about the Linuxppc-dev
mailing list