Commit 9d3e4442 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

[SOCK]: Adds a rcu_dereference() in sk_filter

It seems commit fda9ef5d introduced a RCU 
protection for sk_filter(), without a rcu_dereference()

Either we need a rcu_dereference(), either a comment should explain why we 
dont need it. I vote for the former.
Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
Acked-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0f99be0d
...@@ -944,7 +944,7 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb) ...@@ -944,7 +944,7 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb)
return err; return err;
rcu_read_lock_bh(); rcu_read_lock_bh();
filter = sk->sk_filter; filter = rcu_dereference(sk->sk_filter);
if (filter) { if (filter) {
unsigned int pkt_len = sk_run_filter(skb, filter->insns, unsigned int pkt_len = sk_run_filter(skb, filter->insns,
filter->len); filter->len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment