2020-12-04 05:48:30

by Eric Lin

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

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 v3:
-Let no_context() use die_kernel_fault() helper

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 | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)

--
2.17.0


2020-12-22 02:37:11

by Palmer Dabbelt

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] Let illegal access to user-space memory die

On Thu, 03 Dec 2020 21:42:57 PST (-0800), [email protected] 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 v3:
> -Let no_context() use die_kernel_fault() helper
>
> 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 | 28 ++++++++++++++++++++++------
> 1 file changed, 22 insertions(+), 6 deletions(-)

Thanks, these will be on for-next when the merge window ends.

2021-02-01 13:23:03

by Ben Dooks

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] Let illegal access to user-space memory die

On 22/12/2020 02:35, Palmer Dabbelt wrote:
> On Thu, 03 Dec 2020 21:42:57 PST (-0800), [email protected] 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 v3:
>>     -Let no_context() use die_kernel_fault() helper
>>
>> 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 | 28 ++++++++++++++++++++++------
>>  1 file changed, 22 insertions(+), 6 deletions(-)
>
> Thanks, these will be on for-next when the merge window ends.

Just tested this and it seems to be working.

--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius

https://www.codethink.co.uk/privacy.html