netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfrm: Fix kernel panic when flush and dump SPD entries
@ 2008-12-01  2:00 Wei Yongjun
  2008-12-01  2:10 ` [PATCHv2] " Wei Yongjun
  0 siblings, 1 reply; 15+ messages in thread
From: Wei Yongjun @ 2008-12-01  2:00 UTC (permalink / raw)
  To: David Miller, netdev@vger.kernel.org, Herbert Xu

After flush the SPD entries, dump the SPD entries will cause kernel painc.

Used the following commands to reproduct:

ah/tunnel/3ffe:501:ffff:ff00:200:ff:fe00:b0b0-3ffe:501:ffff:ff02:200:ff:fe00:a1a1/require;\
spddump;' | setkey -c
ah/tunnel/3ffe:501:ffff:ff00:200:ff:fe00:b0b0-3ffe:501:ffff:ff02:200:ff:fe00:a1a1/require;\
spddump;' | setkey -c

This is because when flush the SPD entries, the SPD entry is not remove
from the list.

This patch fix the problem by remove the SPD entry from the list.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/xfrm/xfrm_policy.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 058f04f..fb216c9 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -817,6 +817,7 @@ int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info)
 				continue;
 			hlist_del(&pol->bydst);
 			hlist_del(&pol->byidx);
+			list_del(&pol->walk.all);
 			write_unlock_bh(&xfrm_policy_lock);
 
 			xfrm_audit_policy_delete(pol, 1, audit_info->loginuid,
-- 
1.6.0.2.530.g67faa




^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2008-12-03 13:24 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-01  2:00 [PATCH] xfrm: Fix kernel panic when flush and dump SPD entries Wei Yongjun
2008-12-01  2:10 ` [PATCHv2] " Wei Yongjun
2008-12-01  2:17   ` Yang Hongyang
2008-12-01  5:00   ` Herbert Xu
2008-12-01  6:25     ` Wei Yongjun
2008-12-01  6:27     ` [PATCHv3] " Wei Yongjun
2008-12-01  7:50       ` [PATCH v4] " Wei Yongjun
2008-12-01  8:11         ` Herbert Xu
2008-12-01  8:38           ` David Miller
2008-12-01  9:50             ` [PATCH 1/2] " Wei Yongjun
2008-12-03  8:28               ` David Miller
2008-12-01  9:55             ` [PATCH 1/2] xfrm: Cleanup for unlink SPD entry Wei Yongjun
2008-12-01  9:57               ` Wei Yongjun
2008-12-02  6:53               ` Herbert Xu
2008-12-03  8:33               ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).