diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2017-06-06 18:38:04 +0200 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2022-04-19 00:51:12 +0300 |
commit | 2d18534cf9e5e2648ec1ed0d0705197a1c2c1fa4 (patch) | |
tree | bbc9998642a99a78b560b4258bed86769ade8b52 /kernel/bpf/arraymap.c | |
parent | 0d559c9e9f1bbfac52fda4b504b56ef6ab2b2ee3 (diff) |
FROMLIST: bpf: cgroup skb progs cannot access ld_abs/ind
Commit fb9a307d11d6 ("bpf: Allow CGROUP_SKB eBPF program to
access sk_buff") enabled programs of BPF_PROG_TYPE_CGROUP_SKB
type to use ld_abs/ind instructions. However, at this point,
we cannot use them, since offsets relative to SKF_LL_OFF will
end up pointing skb_mac_header(skb) out of bounds since in the
egress path it is not yet set at that point in time, but only
after __dev_queue_xmit() did a general reset on the mac header.
bpf_internal_load_pointer_neg_helper() will then end up reading
data from a wrong offset.
BPF_PROG_TYPE_CGROUP_SKB programs can use bpf_skb_load_bytes()
already to access packet data, which is also more flexible than
the insns carried over from cBPF.
Fixes: fb9a307d11d6 ("bpf: Allow CGROUP_SKB eBPF program to access sk_buff")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Cc: Chenbo Feng <fengc@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(url: http://patchwork.ozlabs.org/patch/771946/)
Signed-off-by: Chenbo Feng <fengc@google.com>
Bug: 30950746
Change-Id: Ia32ac79d8c0d18f811ec101897284a8b60cb042a
Signed-off-by: Chatur27 <jasonbright2709@gmail.com>
Diffstat (limited to 'kernel/bpf/arraymap.c')
0 files changed, 0 insertions, 0 deletions