Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ab2de2b authored by Daniel Borkmann's avatar Daniel Borkmann Committed by David S. Miller
Browse files

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: dc503a8a ("bpf/verifier: track liveness for pruning")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarEdward Cree <ecree@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fd07a62d
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -3460,7 +3460,7 @@ static bool do_propagate_liveness(const struct bpf_verifier_state *state,
		if (parent->spilled_regs[i].live & REG_LIVE_READ)
		if (parent->spilled_regs[i].live & REG_LIVE_READ)
			continue;
			continue;
		if (state->spilled_regs[i].live == REG_LIVE_READ) {
		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;
			touched = true;
		}
		}
	}
	}