* [PATCH net-next] bpf: fix liveness propagation to parent in spilled stack slots
@ 2017-08-17 12:59 Daniel Borkmann
2017-08-17 17:16 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Borkmann @ 2017-08-17 12:59 UTC (permalink / raw)
To: davem; +Cc: ecree, ast, netdev, Daniel Borkmann
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: dc503a8ad984 ("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>
---
kernel/bpf/verifier.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 958ba84..40f669d 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -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;
}
}
--
1.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-17 17:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-17 12:59 [PATCH net-next] bpf: fix liveness propagation to parent in spilled stack slots Daniel Borkmann
2017-08-17 17:16 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).