netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [SOCK]: Adds a rcu_dereference() in sk_filter
@ 2008-01-08 20:31 Eric Dumazet
  2008-01-09  6:17 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2008-01-08 20:31 UTC (permalink / raw)
  To: David S. Miller; +Cc: Linux Netdev List, dim, Alexey Kuznetsov

[-- Attachment #1: Type: text/plain, Size: 297 bytes --]

It seems commit fda9ef5d679b07c9d9097aaf6ef7f069d794a8f9 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: Eric Dumazet <dada1@cosmosbay.com>


[-- Attachment #2: sk_filter.patch --]
[-- Type: text/plain, Size: 423 bytes --]

diff --git a/include/net/sock.h b/include/net/sock.h
index 67e35c7..6e1542d 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -944,7 +944,7 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb)
 		return err;
 	
 	rcu_read_lock_bh();
-	filter = sk->sk_filter;
+	filter = rcu_dereference(sk->sk_filter);
 	if (filter) {
 		unsigned int pkt_len = sk_run_filter(skb, filter->insns,
 				filter->len);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-01-09  7:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-08 20:31 [SOCK]: Adds a rcu_dereference() in sk_filter Eric Dumazet
2008-01-09  6:17 ` Herbert Xu
2008-01-09  7:41   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).