Re: [PATCH] riscv/mm: Prevent kernel module access user-space memory without uaccess routines

2020-11-30 Thread Eric Lin
On Mon, Nov 30, 2020 at 04:07:03PM +0800, Pekka Enberg wrote: Hi Pekka, > On Mon, Nov 30, 2020 at 7:33 AM Eric Lin wrote: > > > > In the page fault handler, an access to user-space memory > > without get/put_user() or copy_from/to_user() routines is > > not resolved properly. Like arm and other

Re: [PATCH] riscv/mm: Prevent kernel module access user-space memory without uaccess routines

2020-11-30 Thread Eric Lin
On Mon, Nov 30, 2020 at 04:30:15PM +0800, Christoph Hellwig wrote: Hi Christoph, > > + if (!user_mode(regs) && addr < TASK_SIZE && unlikely(!(regs->status & > > SR_SUM))) > > Please avoid the overly long line. OK, I'll modify it in v2. Thanks for your review.

Re: [PATCH] riscv/mm: Prevent kernel module access user-space memory without uaccess routines

2020-11-30 Thread Christoph Hellwig
> + if (!user_mode(regs) && addr < TASK_SIZE && unlikely(!(regs->status & > SR_SUM))) Please avoid the overly long line.

Re: [PATCH] riscv/mm: Prevent kernel module access user-space memory without uaccess routines

2020-11-30 Thread Pekka Enberg
On Mon, Nov 30, 2020 at 7:33 AM Eric Lin wrote: > > In the page fault handler, an access to user-space memory > without get/put_user() or copy_from/to_user() routines is > not resolved properly. Like arm and other architectures, > we need to let it die earlier in page fault handler. Fix looks

[PATCH] riscv/mm: Prevent kernel module access user-space memory without uaccess routines

2020-11-29 Thread Eric Lin
In the page fault handler, an access to user-space memory without get/put_user() or copy_from/to_user() routines is not resolved properly. Like arm and other architectures, we need to let it die earlier in page fault handler. Signed-off-by: Eric Lin Cc: Alan Kao --- arch/riscv/mm/fault.c | 3