netfilter /proc/net/ip_conntrack locking fix
Subsystems (2)
PATCH 1/1 netfilter /proc/net/ip_conntrack locking fix
Hi Dave!
Please apply the following fix to your 2.6.x tree.
Thanks.
Name: Grab ip_conntrack_expect_tuple_lock in list_conntracks
Author: Rusty Russell
Status: Experimental
D: http://bugme.osdl.org/show_bug.cgi?id=1764
D: We're walking the expect list without the ip_conntrack_expect_tuple_lock.
include/linux/netfilter_ipv4/ip_conntrack_core.h +1 -0
@@ -50,5 +50,6 @@ static inline int ip_conntrack_confirm(sextern 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 */
net/ipv4/netfilter/ip_conntrack_standalone.c +4 -1
@@ -154,6 +154,7 @@ list_conntracks(char *buffer, char **sta }/* 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
@@ -164,10 +165,12 @@ list_conntracks(char *buffer, char **sta 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);
--
- Harald Welte <[email protected]> http://www.netfilter.org/
============================================================================
"Fragmentation is like classful addressing -- an interesting early
architectural error that shows how much experimentation was going
on while IP was being designed." -- Paul Vixie
David S. Miller
AppliedQuoted 5 lines · On Tue, 27 Jan 2004 22:45:59 +0100 Harald Welte <[email protected]> wrote:
Please apply the following fix to your 2.6.x tree.
Name: Grab
ip_conntrack_expect_tuple_lockinlist_conntracks
Author: Rusty Russell
Status: Experimental
Applied, thanks.
But please in the future, when providing patch authors give me an email address to use. Luckily I know Rusty's so this one I could handle :)