mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
bpf: fix liveness propagation to parent in spilled stack slots
Using parent->regs[] when propagating REG_LIVE_READ for spilled regs
doesn't work since parent->regs[] denote the set of normal registers
but not spilled ones. Propagate to the correct regs.
Fixes: dc503a8ad9
("bpf/verifier: track liveness for pruning")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
fd07a62d58
commit
1ab2de2bfe
1 changed files with 1 additions and 1 deletions
|
@ -3460,7 +3460,7 @@ static bool do_propagate_liveness(const struct bpf_verifier_state *state,
|
|||
if (parent->spilled_regs[i].live & REG_LIVE_READ)
|
||||
continue;
|
||||
if (state->spilled_regs[i].live == REG_LIVE_READ) {
|
||||
parent->regs[i].live |= REG_LIVE_READ;
|
||||
parent->spilled_regs[i].live |= REG_LIVE_READ;
|
||||
touched = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue