Commit 328ff99f authored by Rusty Russell's avatar Rusty Russell Committed by Hideaki Yoshifuji

[NETFILTER]: Fix locking in ip_conntrack.

http://bugme.osdl.org/show_bug.cgi?id=1764
We're walking the expect list without the ip_conntrack_expect_tuple_lock.
parent 35f9c7ce
......@@ -50,5 +50,6 @@ static inline int ip_conntrack_confirm(struct sk_buff *skb)
extern struct list_head *ip_conntrack_hash;
extern struct list_head ip_conntrack_expect_list;
DECLARE_RWLOCK_EXTERN(ip_conntrack_lock);
DECLARE_RWLOCK_EXTERN(ip_conntrack_expect_tuple_lock);
#endif /* _IP_CONNTRACK_CORE_H */
......@@ -159,6 +159,7 @@ list_conntracks(char *buffer, char **start, off_t offset, int length)
}
/* Now iterate through expecteds. */
READ_LOCK(&ip_conntrack_expect_tuple_lock);
list_for_each(e, &ip_conntrack_expect_list) {
unsigned int last_len;
struct ip_conntrack_expect *expect
......@@ -169,10 +170,12 @@ list_conntracks(char *buffer, char **start, off_t offset, int length)
len += print_expect(buffer + len, expect);
if (len > length) {
len = last_len;
goto finished;
goto finished_expects;
}
}
finished_expects:
READ_UNLOCK(&ip_conntrack_expect_tuple_lock);
finished:
READ_UNLOCK(&ip_conntrack_lock);
......
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