aboutsummaryrefslogtreecommitdiff
path: root/net/bridge/netfilter/ebt_ulog.c
diff options
context:
space:
mode:
authorMark Huang <mlhuang@cs.princeton.edu>2006-08-12 02:45:44 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2006-08-23 14:13:31 -0700
commitbb417c4bad96b07f075b98f874fb28cf258f8065 (patch)
tree3a45d817b08b4c8b05eb446db8ce7cf8945b2ef4 /net/bridge/netfilter/ebt_ulog.c
parentf60aad27513c78d0c0e5feaeb1013f8ce6c07a7c (diff)
ulog: fix panic on SMP kernels
[NETFILTER]: ulog: fix panic on SMP kernels Fix kernel panic on various SMP machines. The culprit is a null ub->skb in ulog_send(). If ulog_timer() has already been scheduled on one CPU and is spinning on the lock, and ipt_ulog_packet() flushes the queue on another CPU by calling ulog_send() right before it exits, there will be no skbuff when ulog_timer() acquires the lock and calls ulog_send(). Cancelling the timer in ulog_send() doesn't help because it has already been scheduled and is running on the first CPU. Similar problem exists in ebt_ulog.c and nfnetlink_log.c. Signed-off-by: Mark Huang <mlhuang@cs.princeton.edu> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net/bridge/netfilter/ebt_ulog.c')
-rw-r--r--net/bridge/netfilter/ebt_ulog.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bridge/netfilter/ebt_ulog.c b/net/bridge/netfilter/ebt_ulog.c
index ee5a51761260..ae70123c61dc 100644
--- a/net/bridge/netfilter/ebt_ulog.c
+++ b/net/bridge/netfilter/ebt_ulog.c
@@ -75,6 +75,9 @@ static void ulog_send(unsigned int nlgroup)
if (timer_pending(&ub->timer))
del_timer(&ub->timer);
+ if (!ub->skb)
+ return;
+
/* last nlmsg needs NLMSG_DONE */
if (ub->qlen > 1)
ub->lastnlh->nlmsg_type = NLMSG_DONE;