netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ulog: add protection when remove ipt_ULOG
@ 2013-02-05  1:57 Gao feng
  2013-02-05  2:48 ` [PATCH 2/2] netfilter: ipt_ULOG: make spinlock per nlgroup Gao feng
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Gao feng @ 2013-02-05  1:57 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Gao feng

We should add a lock protection when we free the skb,
because it maybe used by ipt_ulog_packet right now.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
---
 net/ipv4/netfilter/ipt_ULOG.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c
index b5ef3cb..b390002 100644
--- a/net/ipv4/netfilter/ipt_ULOG.c
+++ b/net/ipv4/netfilter/ipt_ULOG.c
@@ -430,11 +430,12 @@ static void __exit ulog_tg_exit(void)
 			pr_debug("timer was pending, deleting\n");
 			del_timer(&ub->timer);
 		}
-
+		spin_lock_bh(&ulog_lock);
 		if (ub->skb) {
 			kfree_skb(ub->skb);
 			ub->skb = NULL;
 		}
+		spin_unlock_bh(&ulog_lock);
 	}
 }
 
-- 
1.7.11.7


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

end of thread, other threads:[~2013-03-18  9:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-05  1:57 [PATCH] ulog: add protection when remove ipt_ULOG Gao feng
2013-02-05  2:48 ` [PATCH 2/2] netfilter: ipt_ULOG: make spinlock per nlgroup Gao feng
2013-03-15 11:51   ` Pablo Neira Ayuso
2013-03-18  9:11     ` Gao feng
2013-02-07 18:27 ` [PATCH] ulog: add protection when remove ipt_ULOG Pablo Neira Ayuso
2013-02-18  3:57   ` Gao feng
2013-02-18 16:52     ` Pablo Neira Ayuso
2013-02-19  1:09       ` Gao feng
2013-03-15 11:49 ` Pablo Neira Ayuso

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).