flowcache: Fix kernel panic in flow_cache_flush_task
Subsystems (2)
PATCH 1/1 flowcache: Fix kernel panic in flow_cache_flush_task
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.
--- net/core/flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/flow.c +1 -1
@@ -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);
Signature · 1 line
2.0.4
Quoted 10 lines · Miroslav Urbanek
flow_cache_flush_taskreferences a structure memberflow_cache_gc_workwhere it should referenceflow_cache_flush_taskinstead.Kernel panic occurs on kernels using IPsec during XFRM garbagecollection. The garbage collection interval can be shortened using the following sysctl settings:
net.ipv4.xfrm4_gc_thresh=4
net.ipv6.xfrm6_gc_thresh=4
Quoted 8 lines
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 <[email protected]>Tested-by Jan Hejl <[email protected]>Signed-off-by Miroslav Urbanek <[email protected]>---
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.
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.
Quoted 9 lines
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 <[email protected]>
From: Eric Dumazet <[email protected]>
Date: Thu, 05 Feb 2015 08:44:08 -0800
Quoted 20 lines · Miroslav Urbanek
Quoted 10 lines
flow_cache_flush_taskreferences a structure memberflow_cache_gc_workwhere it should referenceflow_cache_flush_taskinstead.Kernel panic occurs on kernels using IPsec during XFRM garbagecollection. The garbage collection interval can be shortened using the following sysctl settings:
net.ipv4.xfrm4_gc_thresh=4
net.ipv6.xfrm6_gc_thresh=4Quoted 8 lines
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 <[email protected]>Tested-by Jan Hejl <[email protected]>Signed-off-by Miroslav Urbanek <[email protected]>---
Quoted 7 lines
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 <[email protected]>
Applied, thanks.