linux-next: manual merge of the bpf-next tree with the bpf tree
From: Mark Brown
Date: Fri Nov 27 2026 - 10:55:20 EST
Hi all,
Today's linux-next merge of the bpf-next tree got a conflict in:
kernel/bpf/fixups.c
between commit:
1879b5e505de9 ("bpf: Emit nospec after calls and atomics that write to the stack")
from the bpf tree and commit:
57fae4059380a ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf 7.4-rc1")
from the bpf-next tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
diff --cc kernel/bpf/fixups.c
index 8c3a17a05a4e1,7af8cb886f7d4..0000000000000
--- a/kernel/bpf/fixups.c
+++ b/kernel/bpf/fixups.c
@@@ -907,14 -1261,11 +1261,12 @@@ int bpf_convert_ctx_accesses(struct bpf
{
struct bpf_subprog_info *subprogs = env->subprog_info;
const struct bpf_verifier_ops *ops = env->ops;
- int i, cnt, size, ctx_field_size, ret, delta = 0, epilogue_cnt = 0;
- const int insn_cnt = env->prog->len;
+ int i, cnt, size, ctx_field_size, ret, epilogue_cnt = 0, first = 0;
struct bpf_insn *epilogue_buf = env->epilogue_buf;
struct bpf_insn *insn_buf = env->insn_buf;
+ bool nospec, nospec_next = false;
struct bpf_insn *insn;
u32 target_size, size_default, off;
- struct bpf_prog *new_prog;
enum bpf_access_type type;
bool is_narrower_load;
int epilogue_idx = 0;
@@@ -995,13 -1336,10 +1337,15 @@@
enum bpf_reg_type ptr_type;
u8 mode;
+ insn = &env->prog->insnsi[i];
+
- if (env->insn_aux_data[i].nospec) {
- WARN_ON_ONCE(env->insn_aux_data[i].alu_state);
+ /* A call or an atomic gets its nospec in front of the next insn */
- nospec = env->insn_aux_data[i + delta].nospec;
- WARN_ON_ONCE(nospec && env->insn_aux_data[i + delta].alu_state);
++ nospec = env->insn_aux_data[i].nospec;
++ WARN_ON_ONCE(nospec && env->insn_aux_data[i].alu_state);
+ nospec |= nospec_next;
- nospec_next = env->insn_aux_data[i + delta].nospec_result;
++ nospec_next = env->insn_aux_data[i].nospec_result;
+
+ if (nospec) {
struct bpf_insn *patch = insn_buf;
*patch++ = BPF_ST_NOSPEC();
@@@ -1101,14 -1423,9 +1429,10 @@@
*patch++ = *insn;
*patch++ = BPF_ST_NOSPEC();
cnt = patch - insn_buf;
- new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, cnt);
- if (!new_prog)
- return -ENOMEM;
-
- delta += cnt - 1;
- env->prog = new_prog;
- insn = new_prog->insnsi + i + delta;
+ insn = bpf_patch_list_add(env, i, insn_buf, cnt);
+ if (IS_ERR(insn))
+ return PTR_ERR(insn);
+ nospec_next = false;
continue;
}
Attachment:
signature.asc
Description: PGP signature