aboutsummaryrefslogtreecommitdiff
path: root/net/unix/sysctl_net_unix.c
diff options
context:
space:
mode:
authorDaniel Borkmann <[email protected]>2017-12-14 21:07:25 +0100
committerAlexei Starovoitov <[email protected]>2017-12-15 09:19:35 -0800
commit04514d13222f2c4c91adf0ecb21004cec3388795 (patch)
tree18f3909ec2918ce8b46cac6ed9d76013dc603022 /net/unix/sysctl_net_unix.c
parent87338c8e2cbb317b5f757e6172f94e2e3799cd20 (diff)
bpf: guarantee r1 to be ctx in case of bpf_helper_changes_pkt_data
Some JITs don't cache skb context on stack in prologue, so when LD_ABS/IND is used and helper calls yield bpf_helper_changes_pkt_data() as true, then they temporarily save/restore skb pointer. However, the assumption that skb always has to be in r1 is a bit of a gamble. Right now it turned out to be true for all helpers listed in bpf_helper_changes_pkt_data(), but lets enforce that from verifier side, so that we make this a guarantee and bail out if the func proto is misconfigured in future helpers. In case of BPF helper calls from cBPF, bpf_helper_changes_pkt_data() is completely unrelevant here (since cBPF is context read-only) and therefore always false. Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'net/unix/sysctl_net_unix.c')
0 files changed, 0 insertions, 0 deletions