diff options
| author | Alexei Starovoitov <[email protected]> | 2015-10-07 17:55:41 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2015-10-11 11:40:05 +0000 |
| commit | ff936a04e5f28b7e0455be0e7fa91334f89e4b44 (patch) | |
| tree | f23b1f44945600ce2631560eb1f93364606b62b6 /security/selinux/hooks.c | |
| parent | Merge branch 'net-non-modular' (diff) | |
| download | kernel-ff936a04e5f28b7e0455be0e7fa91334f89e4b44.tar.gz kernel-ff936a04e5f28b7e0455be0e7fa91334f89e4b44.zip | |
bpf: fix cb access in socket filter programs
eBPF socket filter programs may see junk in 'u32 cb[5]' area,
since it could have been used by protocol layers earlier.
For socket filter programs used in af_packet we need to clean
20 bytes of skb->cb area if it could be used by the program.
For programs attached to TCP/UDP sockets we need to save/restore
these 20 bytes, since it's used by protocol layers.
Remove SK_RUN_FILTER macro, since it's no longer used.
Long term we may move this bpf cb area to per-cpu scratch, but that
requires addition of new 'per-cpu load/store' instructions,
so not suitable as a short term fix.
Fixes: d691f9e8d440 ("bpf: allow programs to write to certain skb fields")
Reported-by: Eric Dumazet <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'security/selinux/hooks.c')
0 files changed, 0 insertions, 0 deletions
