public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium•org>
To: Christophe Leroy <christophe.leroy@csgroup•eu>
Cc: Alexei Starovoitov <ast@kernel•org>,
	Daniel Borkmann <daniel@iogearbox•net>,
	Andrii Nakryiko <andrii@kernel•org>,
	Martin KaFai Lau <martin.lau@linux•dev>,
	Song Liu <song@kernel•org>,
	Yonghong Song <yonghong.song@linux•dev>,
	John Fastabend <john.fastabend@gmail•com>,
	KP Singh <kpsingh@kernel•org>,
	Stanislav Fomichev <sdf@google•com>, Hao Luo <haoluo@google•com>,
	Jiri Olsa <jolsa@kernel•org>,
	"David S. Miller" <davem@davemloft•net>,
	David Ahern <dsahern@kernel•org>,
	Thomas Gleixner <tglx@linutronix•de>,
	Ingo Molnar <mingo@redhat•com>, Borislav Petkov <bp@alien8•de>,
	Dave Hansen <dave.hansen@linux•intel.com>,
	x86@kernel•org, "H. Peter Anvin" <hpa@zytor•com>,
	Eric Dumazet <edumazet@google•com>,
	Jakub Kicinski <kuba@kernel•org>, Paolo Abeni <pabeni@redhat•com>,
	netdev@vger•kernel.org, bpf@vger•kernel.org,
	linux-kernel@vger•kernel.org,
	"linux-hardening @ vger . kernel . org"
	<linux-hardening@vger•kernel.org>
Subject: Re: [PATCH bpf-next] bpf: Check return from set_memory_rox() and friends
Date: Sat, 17 Feb 2024 14:45:03 -0800	[thread overview]
Message-ID: <202402171444.C121486@keescook> (raw)
In-Reply-To: <63322c8e8454de9b240583de58cd730bc97bb789.1708165016.git.christophe.leroy@csgroup.eu>

On Sat, Feb 17, 2024 at 11:24:07AM +0100, Christophe Leroy wrote:
> arch_protect_bpf_trampoline() and alloc_new_pack() call
> set_memory_rox() which can fail, leading to unprotected memory.
> 
> Take into account return from set_memory_XX() functions and add
> __must_check flag to arch_protect_bpf_trampoline().
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup•eu>

Thanks for doing this! This seems to hit all the right error paths that
I can see.

Reviewed-by: Kees Cook <keescook@chromium•org>

-- 
Kees Cook

  reply	other threads:[~2024-02-17 22:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-17 10:24 [PATCH bpf-next] bpf: Check return from set_memory_rox() and friends Christophe Leroy
2024-02-17 22:45 ` Kees Cook [this message]
2024-02-19 10:19 ` Simon Horman
2024-02-19 10:25   ` Christophe Leroy

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=202402171444.C121486@keescook \
    --to=keescook@chromium$(echo .)org \
    --cc=andrii@kernel$(echo .)org \
    --cc=ast@kernel$(echo .)org \
    --cc=bp@alien8$(echo .)de \
    --cc=bpf@vger$(echo .)kernel.org \
    --cc=christophe.leroy@csgroup$(echo .)eu \
    --cc=daniel@iogearbox$(echo .)net \
    --cc=dave.hansen@linux$(echo .)intel.com \
    --cc=davem@davemloft$(echo .)net \
    --cc=dsahern@kernel$(echo .)org \
    --cc=edumazet@google$(echo .)com \
    --cc=haoluo@google$(echo .)com \
    --cc=hpa@zytor$(echo .)com \
    --cc=john.fastabend@gmail$(echo .)com \
    --cc=jolsa@kernel$(echo .)org \
    --cc=kpsingh@kernel$(echo .)org \
    --cc=kuba@kernel$(echo .)org \
    --cc=linux-hardening@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=martin.lau@linux$(echo .)dev \
    --cc=mingo@redhat$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    --cc=sdf@google$(echo .)com \
    --cc=song@kernel$(echo .)org \
    --cc=tglx@linutronix$(echo .)de \
    --cc=x86@kernel$(echo .)org \
    --cc=yonghong.song@linux$(echo .)dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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