mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-25 16:11:45 +00:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
Alexei Starovoitov says: ==================== pull-request: bpf 2019-09-06 The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) verifier precision tracking fix, from Alexei. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
0c04eb72d3
1 changed files with 14 additions and 9 deletions
|
@ -1772,16 +1772,21 @@ static int __mark_chain_precision(struct bpf_verifier_env *env, int regno,
|
||||||
bitmap_from_u64(mask, stack_mask);
|
bitmap_from_u64(mask, stack_mask);
|
||||||
for_each_set_bit(i, mask, 64) {
|
for_each_set_bit(i, mask, 64) {
|
||||||
if (i >= func->allocated_stack / BPF_REG_SIZE) {
|
if (i >= func->allocated_stack / BPF_REG_SIZE) {
|
||||||
/* This can happen if backtracking
|
/* the sequence of instructions:
|
||||||
* is propagating stack precision where
|
* 2: (bf) r3 = r10
|
||||||
* caller has larger stack frame
|
* 3: (7b) *(u64 *)(r3 -8) = r0
|
||||||
* than callee, but backtrack_insn() should
|
* 4: (79) r4 = *(u64 *)(r10 -8)
|
||||||
* have returned -ENOTSUPP.
|
* doesn't contain jmps. It's backtracked
|
||||||
|
* as a single block.
|
||||||
|
* During backtracking insn 3 is not recognized as
|
||||||
|
* stack access, so at the end of backtracking
|
||||||
|
* stack slot fp-8 is still marked in stack_mask.
|
||||||
|
* However the parent state may not have accessed
|
||||||
|
* fp-8 and it's "unallocated" stack space.
|
||||||
|
* In such case fallback to conservative.
|
||||||
*/
|
*/
|
||||||
verbose(env, "BUG spi %d stack_size %d\n",
|
mark_all_scalars_precise(env, st);
|
||||||
i, func->allocated_stack);
|
return 0;
|
||||||
WARN_ONCE(1, "verifier backtracking bug");
|
|
||||||
return -EFAULT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (func->stack[i].slot_type[0] != STACK_SPILL) {
|
if (func->stack[i].slot_type[0] != STACK_SPILL) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue