Skip to contentSkip to conversation

linux-next: manual merge of the bpf-next tree with the bpf tree

PATCH Mark Brown 2 participants 2 messages Sep 3 – Sep 6

Subsystems (4)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

Hi all,

Today's linux-next merge of the bpf-next tree got a conflict in:

kernel/bpf/backtrack.c

between commit:

e3e4f66cc4b72 ("bpf: backtracking shouldn't clear outer frame R1-R5 for callbacks")

from the bpf tree and commit:

5bbb242c08590 ("bpf: Handle R2 as a return register in precision backtracking")

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.

I'm not entirely happy with this resolution but I think it's OK?

kernel/bpf/backtrack.c +0 -0
diff --cc kernel/bpf/backtrack.c
index 47282ffeeaf94,653db80bcc47b..0000000000000
@@@ -533,8 -538,12 +537,12 @@@ static int backtrack_insn(struct bpf_ve
  			from_subprog_call = subseq_idx - 1 >= 0 &&
  					    bpf_pseudo_call(&env->prog->insnsi[subseq_idx - 1]);
  
 -			/* Sample the return registers before the callback
 -			 * handling below clears R1-R5.
 -			 */
  			r0_precise = from_subprog_call && bt_is_reg_set(bt, BPF_REG_0);
+ 			r2_precise = from_subprog_call && bt_is_reg_set(bt, BPF_REG_2);
+ 
++			bt_clear_reg(bt, BPF_REG_0);
++			bt_clear_reg(bt, BPF_REG_2);
 +
  			/* Backtracking to a nested function call, 'idx' is a part of
  			 * the inner frame 'subseq_idx' is a part of the outer frame.
  			 * In case of a regular function call, instructions giving
#1 lore raw
Quoted 33 lines · Mark Brown

Hi all,

Today's linux-next merge of the bpf-next tree got a conflict in:

kernel/bpf/backtrack.c

between commit:

e3e4f66cc4b72 ("bpf: backtracking shouldn't clear outer frame R1-R5 for callbacks")

from the bpf tree and commit:

5bbb242c08590 ("bpf: Handle R2 as a return register in precision backtracking")

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.

I'm not entirely happy with this resolution but I think it's OK?

kernel/bpf/backtrack.c +0 -0
diff --cc kernel/bpf/backtrack.c
index 47282ffeeaf94,653db80bcc47b..0000000000000
@@@ -533,8 -538,12 +537,12 @@@ static int backtrack_insn(struct bpf_ve
                        from_subprog_call = subseq_idx - 1 >= 0 &&
                                            bpf_pseudo_call(&env->prog->insnsi[subseq_idx - 1]);

kernel/bpf/backtrack.c

Quoted 10 lines
kernel/bpf/backtrack.c +4 -0
 
 -                      /* Sample the return registers before the callback
 -                       * handling below clears R1-R5.
 -                       */
                        r0_precise = from_subprog_call && bt_is_reg_set(bt, BPF_REG_0);
+                       r2_precise = from_subprog_call && bt_is_reg_set(bt, BPF_REG_2);
+
++                      bt_clear_reg(bt, BPF_REG_0);
++                      bt_clear_reg(bt, BPF_REG_2);
 +

It was more involved than that,
but now the conflict is resolved.