[PATCH] flowcache: Fix kernel panic in flow_cache_flush_task

Subsystems: networking [general], the rest

STALE4279d REVIEWED: 1 (0M)

1 review trailer.

4 messages, 3 authors, 2015-02-05 · open the first message on its own page

[PATCH] flowcache: Fix kernel panic in flow_cache_flush_task

From: Miroslav Urbanek <hidden>
Date: 2015-02-05 15:45:43

flow_cache_flush_task references a structure member flow_cache_gc_work
where it should reference flow_cache_flush_task instead.

Kernel panic occurs on kernels using IPsec during XFRM garbage
collection. The garbage collection interval can be shortened using the
following sysctl settings:

net.ipv4.xfrm4_gc_thresh=4
net.ipv6.xfrm6_gc_thresh=4

With the default settings, our productions servers crash approximately
once a week. With the settings above, they crash immediately.

Fixes: ca925cf1534e ("flowcache: Make flow cache name space aware")
Reported-by: Tomáš Charvát <redacted>
Tested-by: Jan Hejl <redacted>
Signed-off-by: Miroslav Urbanek <redacted>
---
 net/core/flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/flow.c b/net/core/flow.c
index a0348fd..1033725 100644
--- a/net/core/flow.c
+++ b/net/core/flow.c
@@ -379,7 +379,7 @@ done:
 static void flow_cache_flush_task(struct work_struct *work)
 {
 	struct netns_xfrm *xfrm = container_of(work, struct netns_xfrm,
-						flow_cache_gc_work);
+						flow_cache_flush_work);
 	struct net *net = container_of(xfrm, struct net, xfrm);
 
 	flow_cache_flush(net);
-- 
2.0.4

Re: [PATCH] flowcache: Fix kernel panic in flow_cache_flush_task

From: Eric Dumazet <hidden>
Date: 2015-02-05 16:44:13

On Thu, 2015-02-05 at 16:36 +0100, Miroslav Urbanek wrote:
flow_cache_flush_task references a structure member flow_cache_gc_work
where it should reference flow_cache_flush_task instead.

Kernel panic occurs on kernels using IPsec during XFRM garbage
collection. The garbage collection interval can be shortened using the
following sysctl settings:

net.ipv4.xfrm4_gc_thresh=4
net.ipv6.xfrm6_gc_thresh=4

With the default settings, our productions servers crash approximately
once a week. With the settings above, they crash immediately.

Fixes: ca925cf1534e ("flowcache: Make flow cache name space aware")
Reported-by: Tomáš Charvát <redacted>
Tested-by: Jan Hejl <redacted>
Signed-off-by: Miroslav Urbanek <redacted>
---
Nice catch !

Ok, but you do not need to cc so many people/lists

netdev is fine, and we usually CC patch author, just in case.

Acked-by: Eric Dumazet <redacted>

Re: [PATCH] flowcache: Fix kernel panic in flow_cache_flush_task

From: Miroslav Urbanek <hidden>
Date: 2015-02-05 17:41:03

Thanks for the tip. It's my first kernel patch, so I wanted to make
sure it won't get lost :-)

Anyway, I also looked into the function flow_cache_fini. Isn't it
necessary to flush/cancel scheduled works here? Something like:

flush_work(&net->xfrm.flow_cache_flush_work);
flush_work(&net->xfrm.flow_cache_gc_work);

I'm not sure if it is a bug or not. Could it happen that there is a
scheduled work while the kernel calls flow_cache_fini?

I originally suspected this was the real bug we hit, but we don't use
net namespaces, so our kernels never call flow_cache_fini.
Nice catch !

Ok, but you do not need to cc so many people/lists

netdev is fine, and we usually CC patch author, just in case.

Acked-by: Eric Dumazet <redacted>

Re: [PATCH] flowcache: Fix kernel panic in flow_cache_flush_task

From: David Miller <davem@davemloft.net>
Date: 2015-02-05 22:39:09

From: Eric Dumazet <redacted>
Date: Thu, 05 Feb 2015 08:44:08 -0800
On Thu, 2015-02-05 at 16:36 +0100, Miroslav Urbanek wrote:
quoted
flow_cache_flush_task references a structure member flow_cache_gc_work
where it should reference flow_cache_flush_task instead.

Kernel panic occurs on kernels using IPsec during XFRM garbage
collection. The garbage collection interval can be shortened using the
following sysctl settings:

net.ipv4.xfrm4_gc_thresh=4
net.ipv6.xfrm6_gc_thresh=4

With the default settings, our productions servers crash approximately
once a week. With the settings above, they crash immediately.

Fixes: ca925cf1534e ("flowcache: Make flow cache name space aware")
Reported-by: Tomáš Charvát <redacted>
Tested-by: Jan Hejl <redacted>
Signed-off-by: Miroslav Urbanek <redacted>
---
Nice catch !

Ok, but you do not need to cc so many people/lists

netdev is fine, and we usually CC patch author, just in case.

Acked-by: Eric Dumazet <redacted>
Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help