mbox series

[v2,0/2] Let illegal access to user-space memory die

Message ID 20201203064826.30832-1-tesheng@andestech.com (mailing list archive)
Headers show
Series Let illegal access to user-space memory die | expand

Message

Eric Lin Dec. 3, 2020, 6:48 a.m. UTC
Accesses to user-space memory without calling uaccess routine
leads to hanging in page fault handler. Like arm64, we let it
die earlier in page fault handler.

Changes in v2:
    -Add a die_kernel_fault() helper
    -Split one long line code into two

Eric Lin (2):
  riscv/mm: Introduce a die_kernel_fault() helper function
  riscv/mm: Prevent kernel module to access user memory without uaccess
    routines

 arch/riscv/mm/fault.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Pekka Enberg Dec. 3, 2020, 7:29 a.m. UTC | #1
Hi Eric,

On Thu, Dec 3, 2020 at 8:51 AM Eric Lin <tesheng@andestech.com> wrote:
>
> Accesses to user-space memory without calling uaccess routine
> leads to hanging in page fault handler. Like arm64, we let it
> die earlier in page fault handler.
>
> Changes in v2:
>     -Add a die_kernel_fault() helper
>     -Split one long line code into two

Please also make no_context() use the new helper. Other than that:

Reviewed-by: Pekka Enberg <penberg@kernel.org>
Eric Lin Dec. 3, 2020, 8:16 a.m. UTC | #2
On Thu, Dec 03, 2020 at 03:29:57PM +0800, Pekka Enberg wrote:

Hi Pekka, 

> Hi Eric,
> 
> On Thu, Dec 3, 2020 at 8:51 AM Eric Lin <tesheng@andestech.com> wrote:
> >
> > Accesses to user-space memory without calling uaccess routine
> > leads to hanging in page fault handler. Like arm64, we let it
> > die earlier in page fault handler.
> >
> > Changes in v2:
> >     -Add a die_kernel_fault() helper
> >     -Split one long line code into two
> 
> Please also make no_context() use the new helper. Other than that:
> 

OK, I'll make no_context() use the new helper in v3.
Thanks for your review.

> Reviewed-by: Pekka Enberg <penberg@kernel.org>