From: "Emil Tsalapatis" <emil@etsalapatis.com>
To: "Anton Protopopov" <a.s.protopopov@gmail.com>,
<bpf@vger.kernel.org>, "Alexei Starovoitov" <ast@kernel.org>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Eduard Zingerman" <eddyz87@gmail.com>,
"Yonghong Song" <yonghong.song@linux.dev>
Subject: Re: [PATCH bpf-next 1/3] bpf: insn array: return proper address for non-zero offsets
Date: Mon, 12 Jan 2026 12:05:50 -0500 [thread overview]
Message-ID: <DFMRWCMZ9M2K.3AW08WLJR8NDR@etsalapatis.com> (raw)
In-Reply-To: <20260111153047.8388-2-a.s.protopopov@gmail.com>
On Sun Jan 11, 2026 at 10:30 AM EST, Anton Protopopov wrote:
> The map_direct_value_addr() function of the instruction
> array map incorrectly adds offset to the resulting address.
> This is a bug, because later the resolve_pseudo_ldimm64()
> function adds the offset. Fix it. Corresponding selftests
> are added in a consequent commit.
>
> Fixes: 493d9e0d6083 ("bpf, x86: add support for indirect jumps")
> Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
> ---
> kernel/bpf/bpf_insn_array.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/bpf/bpf_insn_array.c b/kernel/bpf/bpf_insn_array.c
> index c96630cb75bf..37b43102953e 100644
> --- a/kernel/bpf/bpf_insn_array.c
> +++ b/kernel/bpf/bpf_insn_array.c
> @@ -126,7 +126,7 @@ static int insn_array_map_direct_value_addr(const struct bpf_map *map, u64 *imm,
> return -EINVAL;
>
> /* from BPF's point of view, this map is a jump table */
> - *imm = (unsigned long)insn_array->ips + off;
> + *imm = (unsigned long)insn_array->ips;
>
> return 0;
> }
next prev parent reply other threads:[~2026-01-12 17:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-11 15:30 [PATCH bpf-next 0/3] properly load insn array values with offsets Anton Protopopov
2026-01-11 15:30 ` [PATCH bpf-next 1/3] bpf: insn array: return proper address for non-zero offsets Anton Protopopov
2026-01-12 17:05 ` Emil Tsalapatis [this message]
2026-01-14 3:42 ` Alexei Starovoitov
2026-01-14 10:20 ` Anton Protopopov
2026-01-11 15:30 ` [PATCH bpf-next 2/3] bpf: insn array: return EACCES for incorrect map access Anton Protopopov
2026-01-12 17:12 ` Emil Tsalapatis
2026-01-12 18:45 ` Anton Protopopov
2026-01-12 19:18 ` Emil Tsalapatis
2026-01-11 15:30 ` [PATCH bpf-next 3/3] selftests/bpf: add tests for loading map values with offsets Anton Protopopov
2026-01-14 3:40 ` [PATCH bpf-next 0/3] properly load insn array " patchwork-bot+netdevbpf
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=DFMRWCMZ9M2K.3AW08WLJR8NDR@etsalapatis.com \
--to=emil@etsalapatis.com \
--cc=a.s.protopopov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--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 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.