diff options
author | Hannes Frederic Sowa <hannes@stressinduktion.org> | 2016-04-05 15:10:16 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-07 20:44:14 (GMT) |
commit | 8ced425ee630c03beea06c1dfa35190bf8395d07 (patch) | |
tree | 24f93b5ab435e0bd4cada95b9f91df0a2e205186 /include | |
parent | 1e1d04e678cf72442f57ce82803c7a407769135f (diff) | |
download | linux-8ced425ee630c03beea06c1dfa35190bf8395d07.tar.xz |
tun: use socket locks for sk_{attach,detatch}_filter
This reverts commit 5a5abb1fa3b05dd ("tun, bpf: fix suspicious RCU usage
in tun_{attach, detach}_filter") and replaces it to use lock_sock around
sk_{attach,detach}_filter. The checks inside filter.c are updated with
lockdep_sock_is_held to check for proper socket locks.
It keeps the code cleaner by ensuring that only one lock governs the
socket filter instead of two independent locks.
Cc: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/filter.h | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h index a51a536..43aa1f8 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -465,14 +465,10 @@ int bpf_prog_create_from_user(struct bpf_prog **pfp, struct sock_fprog *fprog, void bpf_prog_destroy(struct bpf_prog *fp); int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); -int __sk_attach_filter(struct sock_fprog *fprog, struct sock *sk, - bool locked); int sk_attach_bpf(u32 ufd, struct sock *sk); int sk_reuseport_attach_filter(struct sock_fprog *fprog, struct sock *sk); int sk_reuseport_attach_bpf(u32 ufd, struct sock *sk); int sk_detach_filter(struct sock *sk); -int __sk_detach_filter(struct sock *sk, bool locked); - int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, unsigned int len); |