summaryrefslogtreecommitdiffstats
path: root/kernel/bpf/verifier.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-21 10:46:08 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-21 10:46:08 -0500
commitcd6a22310ec2a70092e136d0cd65bb77c1502521 (patch)
treec01fa788b27b240c7b426d7f329d92bd58c7b8f5 /kernel/bpf/verifier.c
parent1e12a521d6917004f8b95a3b5864b92edc2694c8 (diff)
parent177c459b08a34dcf004aa9a4c1f1d8be682ff3af (diff)
Merge USB 4.20-rc8 mergepoint into usb-next
We need the USB changes in here for additional patches to be able to apply cleanly. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/bpf/verifier.c')
-rw-r--r--kernel/bpf/verifier.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index fc760d00a38c..51ba84d4d34a 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -5102,9 +5102,16 @@ static int is_state_visited(struct bpf_verifier_env *env, int insn_idx)
5102 } 5102 }
5103 new_sl->next = env->explored_states[insn_idx]; 5103 new_sl->next = env->explored_states[insn_idx];
5104 env->explored_states[insn_idx] = new_sl; 5104 env->explored_states[insn_idx] = new_sl;
5105 /* connect new state to parentage chain */ 5105 /* connect new state to parentage chain. Current frame needs all
5106 for (i = 0; i < BPF_REG_FP; i++) 5106 * registers connected. Only r6 - r9 of the callers are alive (pushed
5107 cur_regs(env)[i].parent = &new->frame[new->curframe]->regs[i]; 5107 * to the stack implicitly by JITs) so in callers' frames connect just
5108 * r6 - r9 as an optimization. Callers will have r1 - r5 connected to
5109 * the state of the call instruction (with WRITTEN set), and r0 comes
5110 * from callee with its full parentage chain, anyway.
5111 */
5112 for (j = 0; j <= cur->curframe; j++)
5113 for (i = j < cur->curframe ? BPF_REG_6 : 0; i < BPF_REG_FP; i++)
5114 cur->frame[j]->regs[i].parent = &new->frame[j]->regs[i];
5108 /* clear write marks in current state: the writes we did are not writes 5115 /* clear write marks in current state: the writes we did are not writes
5109 * our child did, so they don't screen off its reads from us. 5116 * our child did, so they don't screen off its reads from us.
5110 * (There are no read marks in current state, because reads always mark 5117 * (There are no read marks in current state, because reads always mark