Linux Modules
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Kees Cook <keescook@chromium.org>
Cc: Luis Chamberlain <mcgrof@kernel.org>,
	"linux-modules@vger.kernel.org" <linux-modules@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-hardening @ vger . kernel . org"
	<linux-hardening@vger.kernel.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: [PATCH v2] module: Don't ignore errors from set_memory_XX()
Date: Fri, 16 Feb 2024 19:35:32 +0000	[thread overview]
Message-ID: <12b5fa1e-c6cf-489b-b7bd-4f9d5ed9aba6@csgroup.eu> (raw)
In-Reply-To: <202402161128.21EA3F8@keescook>



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@csgroup.eu>
> 
> Yay! Glad to see this happening. Universal __must_check for set_memory_*()
> starts to appear on the horizon. ;)
> 
> Reviewed-by: Kees Cook <keescook@chromium.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

      reply	other threads:[~2024-02-16 19:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240216081457eucas1p2c22493d17918753128b39df47e98d8cd@eucas1p2.samsung.com>
2024-02-16  8:14 ` [PATCH v2] module: Don't ignore errors from set_memory_XX() Christophe Leroy
2024-02-16 11:33   ` Marek Szyprowski
2024-02-16 19:17   ` Luis Chamberlain
2024-02-16 19:28   ` Kees Cook
2024-02-16 19:35     ` Christophe Leroy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12b5fa1e-c6cf-489b-b7bd-4f9d5ed9aba6@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mark.rutland@arm.com \
    --cc=mcgrof@kernel.org \
    --cc=mpe@ellerman.id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox