[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <12b5fa1e-c6cf-489b-b7bd-4f9d5ed9aba6@csgroup.eu>
Date: Fri, 16 Feb 2024 19:35:32 +0000
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Kees Cook <keescook@...omium.org>
CC: Luis Chamberlain <mcgrof@...nel.org>, "linux-modules@...r.kernel.org"
<linux-modules@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "linux-hardening @ vger . kernel . org"
<linux-hardening@...r.kernel.org>, Marek Szyprowski
<m.szyprowski@...sung.com>, Mark Rutland <mark.rutland@....com>, Michael
Ellerman <mpe@...erman.id.au>
Subject: Re: [PATCH v2] module: Don't ignore errors from set_memory_XX()
Le 16/02/2024 à 20:28, Kees Cook a écrit :
> On Fri, Feb 16, 2024 at 09:14:27AM +0100, Christophe Leroy wrote:
>> set_memory_ro(), set_memory_nx(), set_memory_x() and other helpers
>> can fail and return an error. In that case the memory might not be
>> protected as expected and the module loading has to be aborted to
>> avoid security issues.
>>
>> Check return value of all calls to set_memory_XX() and handle
>> error if any.
>>
>> Add a check to not call set_memory_XX() on NULL pointers as some
>> architectures may not like it allthough numpages is always 0 in that
>> case. This also avoid a useless call to set_vm_flush_reset_perms().
>>
>> Link: https://github.com/KSPP/linux/issues/7
>> Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>
>
> Yay! Glad to see this happening. Universal __must_check for set_memory_*()
> starts to appear on the horizon. ;)
>
> Reviewed-by: Kees Cook <keescook@...omium.org>
>
Thanks
I also sent 3 patches to powerpc, I forgot to copy you but I put the
links in https://github.com/KSPP/linux/issues/7
Christophe
Powered by blists - more mailing lists