From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: <rtm@csail.mit.edu>, "Daniel Borkmann" <daniel@iogearbox.net>,
"John Fastabend" <john.fastabend@gmail.com>
Cc: <bpf@vger.kernel.org>
Subject: Re: ebpf program can cause verifier crash in check_return_code()
Date: Tue, 24 Nov 2026 03:27:18 +0000 [thread overview]
Message-ID: <DN34DSBL68MS.2RHLVBAKXACD4@gmail.com> (raw)
In-Reply-To: <43917.1795463809@30-11-166.wireless.csail.mit.edu>
The following should fix it. Pls test it and send an official patch.
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index dea18409f480..5c8e84c80a9e 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -19928,7 +19928,8 @@ static int check_return_code(struct bpf_verifier_env *env, int regno, const char
* matches the operator's return type and is in its unmodified
* form. A scalar zero (i.e., a null pointer) is also allowed.
*/
- reg_type = reg->btf ? btf_type_by_id(reg->btf, reg->btf_id) : NULL;
+ reg_type = base_type(reg->type) == PTR_TO_BTF_ID ?
+ btf_type_by_id(reg->btf, reg->btf_id) : NULL;
ret_type = btf_type_resolve_ptr(prog->aux->attach_btf,
prog->aux->attach_func_proto->type,
NULL);
prev parent reply other threads:[~2026-11-24 3:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 19:56 ebpf program can cause verifier crash in check_return_code() rtm
2026-11-24 3:27 ` Alexei Starovoitov [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=DN34DSBL68MS.2RHLVBAKXACD4@gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=john.fastabend@gmail.com \
--cc=rtm@csail.mit.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.