From: Eduard Zingerman <eddyz87@gmail.com>
To: Luis Gerhorst <luis.gerhorst@fau.de>,
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@fomichev.me>,
Hao Luo <haoluo@google.com>, Jiri Olsa <jolsa@kernel.org>,
Puranjay Mohan <puranjay@kernel.org>,
Xu Kuohai <xukuohai@huaweicloud.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Hari Bathini <hbathini@linux.ibm.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Naveen N Rao <naveen@kernel.org>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
Mykola Lysenko <mykolal@fb.com>, Shuah Khan <shuah@kernel.org>,
Henriette Herzog <henriette.herzog@rub.de>,
Cupertino Miranda <cupertino.miranda@oracle.com>,
Matan Shachnai <m.shachnai@gmail.com>,
Dimitar Kanaliev <dimitar.kanaliev@siteground.com>,
Shung-Hsi Yu <shung-hsi.yu@suse.com>, Daniel Xu <dxu@dxuuu.xyz>,
bpf@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-kselftest@vger.kernel.org,
George Guo <guodongtai@kylinos.cn>, WANG Xuerui <git@xen0n.name>,
Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: Maximilian Ott <ott@cs.fau.de>, Milan Stephan <milan.stephan@fau.de>
Subject: Re: [PATCH bpf-next 09/11] bpf: Return PTR_ERR from push_stack()
Date: Mon, 17 Mar 2025 02:19:08 -0700 [thread overview]
Message-ID: <9083b52fd4a2d7a5a0473e858042c277c883f8b0.camel@gmail.com> (raw)
In-Reply-To: <20250313174149.1113165-4-luis.gerhorst@fau.de>
[-- Attachment #1: Type: text/plain, Size: 754 bytes --]
On Thu, 2025-03-13 at 18:41 +0100, Luis Gerhorst wrote:
[...]
> @@ -2011,8 +2011,10 @@ static struct bpf_verifier_state *push_stack(struct bpf_verifier_env *env,
> int err;
>
> elem = kzalloc(sizeof(struct bpf_verifier_stack_elem), GFP_KERNEL);
> - if (!elem)
> - goto err;
> + if (!elem) {
> + err = -ENOMEM;
> + goto unrecoverable_err;
> + }
Could you please point me to a location, where exact error code
returned by updated push_stack() matters?
I checked push_stack() callgraph (in the attachment), but can't find
anything.
>
> elem->insn_idx = insn_idx;
> elem->prev_insn_idx = prev_insn_idx;
> @@ -2022,12 +2024,19 @@ static struct bpf_verifier_state *push_stack(struct bpf_verifier_env *env,
[...]
[-- Attachment #2: push_stack.dot --]
[-- Type: text/vnd.graphviz, Size: 1706 bytes --]
digraph G {
Node0x55dd4a8d4b50 [label="{check_cond_jmp_op}", shape=record];
Node0x55dd4aa06790 [label="{sanitize_speculative_path}", shape=record];
Node0x55dd4a8ca580 [label="{check_helper_call}", shape=record];
Node0x55dd4a8cf260 [label="{check_kfunc_call}", shape=record];
Node0x55dd4a88d7d0 [label="{do_check}", shape=record];
Node0x55dd4aa3a360 [label="{adjust_ptr_min_max_vals}", shape=record];
Node0x55dd4a76c620 [label="{do_check_common}", shape=record];
Node0x55dd4a8ba850 [label="{adjust_reg_min_max_vals}", shape=record];
Node0x55dd4959fe40 [label="{process_iter_next_call}", shape=record];
Node0x55dd4aa5c1e0 [label="{sanitize_ptr_alu}", shape=record];
Node0x55dd4a9a3ac0 [label="{push_callback_call}", shape=record];
Node0x55dd4a9fb9d0 [label="{push_stack}", shape=record];
Node0x55dd4a778db0 [label="{do_check_subprogs}", shape=record];
Node0x55dd4a741990 [label="{bpf_check}", shape=record];
Node0x55dd4a741990 -> Node0x55dd4a778db0;
Node0x55dd4a741990 -> Node0x55dd4a76c620;
Node0x55dd4a778db0 -> Node0x55dd4a76c620;
Node0x55dd4a76c620 -> Node0x55dd4a88d7d0;
Node0x55dd4a88d7d0 -> Node0x55dd4a8d4b50;
Node0x55dd4a88d7d0 -> Node0x55dd4a8ca580;
Node0x55dd4a88d7d0 -> Node0x55dd4a8cf260;
Node0x55dd4a88d7d0 -> Node0x55dd4a8ba850;
Node0x55dd4a8cf260 -> Node0x55dd4959fe40;
Node0x55dd4a8cf260 -> Node0x55dd4a9a3ac0;
Node0x55dd4a8ca580 -> Node0x55dd4a9a3ac0;
Node0x55dd4a8d4b50 -> Node0x55dd4a9fb9d0;
Node0x55dd4a8d4b50 -> Node0x55dd4aa06790;
Node0x55dd4a8ba850 -> Node0x55dd4aa3a360;
Node0x55dd4aa3a360 -> Node0x55dd4aa5c1e0;
Node0x55dd4aa5c1e0 -> Node0x55dd4a9fb9d0;
Node0x55dd4aa06790 -> Node0x55dd4a9fb9d0;
Node0x55dd4a9a3ac0 -> Node0x55dd4a9fb9d0;
Node0x55dd4959fe40 -> Node0x55dd4a9fb9d0;
}
next prev parent reply other threads:[~2025-03-17 9:19 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-13 17:21 [PATCH bpf-next 00/11] bpf: Mitigate Spectre v1 using barriers Luis Gerhorst
2025-03-13 17:21 ` [PATCH bpf-next 01/11] bpf: Move insn if/else into do_check_insn() Luis Gerhorst
2025-03-14 22:47 ` Eduard Zingerman
2025-03-15 14:35 ` Luis Gerhorst
2025-03-13 17:21 ` [PATCH bpf-next 02/11] bpf: Return -EFAULT on misconfigurations Luis Gerhorst
2025-03-15 8:06 ` Eduard Zingerman
2025-03-13 17:29 ` [PATCH bpf-next 03/11] bpf: Return -EFAULT on internal errors Luis Gerhorst
2025-03-15 8:07 ` Eduard Zingerman
2025-03-13 17:33 ` [PATCH bpf-next 04/11] bpf, arm64, powerpc: Add bpf_jit_bypass_spec_v1/v4() Luis Gerhorst
2025-03-13 17:38 ` [PATCH bpf-next 05/11] bpf, arm64, powerpc: Change nospec to include v1 barrier Luis Gerhorst
2025-03-13 17:41 ` [PATCH bpf-next 06/11] bpf: Rename sanitize_stack_spill to nospec_result Luis Gerhorst
2025-03-13 17:41 ` [PATCH bpf-next 07/11] bpf: Fall back to nospec for Spectre v1 Luis Gerhorst
2025-03-13 17:41 ` [PATCH bpf-next 08/11] bpf: Allow nospec-protected var-offset stack access Luis Gerhorst
2025-03-13 17:41 ` [PATCH bpf-next 09/11] bpf: Return PTR_ERR from push_stack() Luis Gerhorst
2025-03-17 9:19 ` Eduard Zingerman [this message]
2025-03-18 7:59 ` Luis Gerhorst
2025-03-13 17:53 ` [PATCH bpf-next 10/11] bpf: Fall back to nospec for sanitization-failures Luis Gerhorst
2025-03-13 17:53 ` [PATCH bpf-next 11/11] bpf: Fall back to nospec for spec path verification Luis Gerhorst
2025-03-19 2:40 ` Alexei Starovoitov
2025-03-19 9:06 ` Luis Gerhorst
2025-04-03 20:33 ` Alexei Starovoitov
2025-03-14 23:40 ` [PATCH bpf-next 00/11] bpf: Mitigate Spectre v1 using barriers Eduard Zingerman
2025-03-15 15:20 ` Luis Gerhorst
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=9083b52fd4a2d7a5a0473e858042c277c883f8b0.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=catalin.marinas@arm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=cupertino.miranda@oracle.com \
--cc=daniel@iogearbox.net \
--cc=dimitar.kanaliev@siteground.com \
--cc=dxu@dxuuu.xyz \
--cc=git@xen0n.name \
--cc=guodongtai@kylinos.cn \
--cc=haoluo@google.com \
--cc=hbathini@linux.ibm.com \
--cc=henriette.herzog@rub.de \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=luis.gerhorst@fau.de \
--cc=m.shachnai@gmail.com \
--cc=maddy@linux.ibm.com \
--cc=martin.lau@linux.dev \
--cc=milan.stephan@fau.de \
--cc=mpe@ellerman.id.au \
--cc=mykolal@fb.com \
--cc=naveen@kernel.org \
--cc=npiggin@gmail.com \
--cc=ott@cs.fau.de \
--cc=puranjay@kernel.org \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=shung-hsi.yu@suse.com \
--cc=song@kernel.org \
--cc=will@kernel.org \
--cc=xukuohai@huaweicloud.com \
--cc=yangtiezhu@loongson.cn \
--cc=yonghong.song@linux.dev \
/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;
as well as URLs for NNTP newsgroup(s).