[PATCH 1/2] net: ethernet: Fix typo of 'network' in comment

2021-03-30 Thread Eric Lin
Signed-off-by: Eric Lin Reported-by: Gustavo A. R. Silva --- drivers/net/ethernet/via/via-velocity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c index b65767f9e499..fecc4d7b00b0 100644

[PATCH 2/2] net: wireless: Fix typo of 'Networks' in comment

2021-03-30 Thread Eric Lin
Signed-off-by: Eric Lin Reported-by: Gustavo A. R. Silva --- drivers/net/wireless/wl3501.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/wl3501.h b/drivers/net/wireless/wl3501.h index e98e04ee9a2c..5779ffbe5d0f 100644 --- a/drivers/net/wireless/wl3501

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 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 p

[PATCH v3 2/2] riscv/mm: Prevent kernel module to access user memory without uaccess routines

2020-12-03 Thread Eric Lin
We found this issue in an legacy out-of-tree kernel module which didn't properly access user space pointer by get/put_user(). Such an illegal access loops in the page fault handler. To resolve this, let it die here. Signed-off-by: Eric Lin Cc: Alan Kao Reviewed-by: Pekka Enberg --- arch/

[PATCH v3 0/2] Let illegal access to user-space memory die

2020-12-03 Thread Eric Lin
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 | 28 ++-- 1 file changed, 22 insertions(+), 6 deletions

[PATCH v3 1/2] riscv/mm: Introduce a die_kernel_fault() helper function

2020-12-03 Thread Eric Lin
Like arm64, this patch adds a die_kernel_fault() helper to ensure the same semantics for the different kernel faults. Signed-off-by: Eric Lin Cc: Alan Kao Reviewed-by: Pekka Enberg --- arch/riscv/mm/fault.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff

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

2020-12-02 Thread Eric Lin
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

[PATCH v2 2/2] riscv/mm: Prevent kernel module to access user memory without uaccess routines

2020-12-02 Thread Eric Lin
We found this issue in an legacy out-of-tree kernel module which didn't properly access user space pointer by get/put_user(). Such an illegal access loops in the page fault handler. To resolve this, let it die here. Signed-off-by: Eric Lin Cc: Alan Kao --- arch/riscv/mm/fault.c | 5 +++

[PATCH v2 1/2] riscv/mm: Introduce a die_kernel_fault() helper function

2020-12-02 Thread Eric Lin
Like arm64, this patch adds a die_kernel_fault() helper to ensure the same semantics for the different kernel faults. Signed-off-by: Eric Lin Cc: Alan Kao --- arch/riscv/mm/fault.c | 13 + 1 file changed, 13 insertions(+) diff --git a/arch/riscv/mm/fault.c b/arch/riscv/mm/fault.c

Re: [PATCH v2 0/2] Let illegal access to user-space memory die

2020-12-03 Thread Eric Lin
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 wrote: > > > > Accesses to user-space memory without calling uaccess routine > > leads to hanging in page fault handler. Like arm64, we let

[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