inet fragments: fix race between inet_frag_find and inet_frag_secret_rebuild
[linux-2.6-block.git] / net / ipv4 / ip_fragment.c
index cd6ce6ac635843e4598e5332c32256bb0ff93926..37221f65915960a8a5173b4862fcace1591fdec9 100644 (file)
@@ -229,6 +229,8 @@ static inline struct ipq *ip_find(struct net *net, struct iphdr *iph, u32 user)
 
        arg.iph = iph;
        arg.user = user;
+
+       read_lock(&ip4_frags.lock);
        hash = ipqhashfn(iph->id, iph->saddr, iph->daddr, iph->protocol);
 
        q = inet_frag_find(&net->ipv4.frags, &ip4_frags, &arg, hash);