From: Eduard Zingerman <eddyz87@gmail.com>
To: Daniel Borkmann <daniel@iogearbox.net>, ast@kernel.org
Cc: memxor@gmail.com, a.s.protopopov@gmail.com, info@starlabs.sg,
bpf@vger.kernel.org, Nicholas Carlini <npc@anthropic.com>
Subject: Re: [PATCH bpf v2 07/11] bpf: Retarget indirect jump targets across prologue prepends
Date: Mon, 14 Sep 2026 17:41:16 -0700 [thread overview]
Message-ID: <7300920180144df4991e4aab7a54508e8091ac62.camel@gmail.com> (raw)
In-Reply-To: <20260914170326.249953-8-daniel@iogearbox.net>
On Mon, 2026-09-14 at 19:03 +0200, Daniel Borkmann wrote:
> A few patches do not expand in place, they prepend: gen_epilogue and
> gen_prologue splice their instructions in front of insn 0 in
> bpf_convert_ctx_accesses(), and bpf_do_misc_fixups() prepends the may_goto
> counter init at every subprog start.
>
> They copy the original instruction of 'tgt_idx' into the last slot of the
> patch buffer, so it now lives at tgt_idx + delta, and call adjust_jmp_off()
> to move direct branches from tgt_idx to tgt_idx + delta.
>
> Nothing does the same for indirect branches, so a BPF_MAP_TYPE_INSN_ARRAY
> slot that named tgt_idx keeps naming tgt_idx, which is now the first prepended
> instruction, and insn_aux_data[tgt_idx].indirect_target makes the JIT emit
> the landing pad there. Add a __bpf_patch_insn_data() variant and pass the
> BPF_PREPEND at the affected call-sites to fix up the delta.
>
> Fixes: 493d9e0d6083 ("bpf, x86: add support for indirect jumps")
> Fixes: 07ae6c130b46 ("bpf: Add helper to detect indirect jump targets")
> Reported-by: Nicholas Carlini <npc@anthropic.com>
> Suggested-by: Nicholas Carlini <npc@anthropic.com>
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
> Acked-by: Anton Protopopov <a.s.protopopov@gmail.com>
> ---
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
...
next prev parent reply other threads:[~2026-09-15 0:41 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 17:03 [PATCH bpf v2 00/11] Misc BPF gotox fixes Daniel Borkmann
2026-09-14 17:03 ` [PATCH bpf v2 01/11] bpf: Avoid quadratic successor rescan in bpf_compute_scc Daniel Borkmann
2026-09-14 17:03 ` [PATCH bpf v2 02/11] bpf: Bound the number of indirect jump edges in a program Daniel Borkmann
2026-09-14 18:19 ` bot+bpf-ci
2026-09-14 17:03 ` [PATCH bpf v2 03/11] bpf: Cache the jump table of a subprogram during CFG discovery Daniel Borkmann
2026-09-14 18:19 ` bot+bpf-ci
2026-09-14 20:05 ` Daniel Borkmann
2026-09-14 23:14 ` Eduard Zingerman
2026-09-14 17:03 ` [PATCH bpf v2 04/11] bpf: Reject indirect jumps that leave their subprogram Daniel Borkmann
2026-09-15 0:04 ` Eduard Zingerman
2026-09-14 17:03 ` [PATCH bpf v2 05/11] bpf: Don't remove indirect jump targets in the nop removal pass Daniel Borkmann
2026-09-15 0:14 ` Eduard Zingerman
2026-09-14 17:03 ` [PATCH bpf v2 06/11] bpf: Clear insn array jitted pointers on map reuse Daniel Borkmann
2026-09-14 17:29 ` sashiko-bot
2026-09-14 19:30 ` Daniel Borkmann
2026-09-14 18:19 ` bot+bpf-ci
2026-09-15 0:20 ` Eduard Zingerman
2026-09-14 17:03 ` [PATCH bpf v2 07/11] bpf: Retarget indirect jump targets across prologue prepends Daniel Borkmann
2026-09-14 18:19 ` bot+bpf-ci
2026-09-15 0:41 ` Eduard Zingerman [this message]
2026-09-14 17:03 ` [PATCH bpf v2 08/11] selftests/bpf: Add tests for the indirect jump edge limit Daniel Borkmann
2026-09-14 18:19 ` bot+bpf-ci
2026-09-15 1:59 ` Eduard Zingerman
2026-09-14 17:03 ` [PATCH bpf v2 09/11] selftests/bpf: Add tests for indirect jumps across subprograms Daniel Borkmann
2026-09-14 17:03 ` [PATCH bpf v2 10/11] selftests/bpf: Add tests for gotox nop targets and insn array reuse Daniel Borkmann
2026-09-14 18:19 ` bot+bpf-ci
2026-09-15 2:36 ` Eduard Zingerman
2026-09-14 17:03 ` [PATCH bpf v2 11/11] selftests/bpf: Add tests for gotox targets across prologue prepends Daniel Borkmann
2026-09-14 18:19 ` bot+bpf-ci
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=7300920180144df4991e4aab7a54508e8091ac62.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=a.s.protopopov@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=info@starlabs.sg \
--cc=memxor@gmail.com \
--cc=npc@anthropic.com \
/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.