From: Patrick McHardy <kaber@trash.net>
To: Mark Huang <mlhuang@CS.Princeton.EDU>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: [PATCH] Fix ipt_ULOG panics on SMP kernels
Date: Fri, 11 Aug 2006 18:19:58 +0200 [thread overview]
Message-ID: <44DCAE2E.8040006@trash.net> (raw)
In-Reply-To: <44DB5F4E.2080608@cs.princeton.edu>
Mark Huang wrote:
> I've run into the same kernel panic as these reports:
>
> https://lists.gnumonks.org/pipermail/ulogd/2005-August/000776.html
> http://lists.netfilter.org/pipermail/netfilter/2006-January/064509.html
> https://lists.gnumonks.org/pipermail/ulogd/2006-April/000853.html
>
> On various SMP machines. The culprit is a null ub->skb in ulog_send(). I
> believe
> that this can occur for the following reason. 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
> (because
> the threshold is reached), 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.
>
> There are two solutions that I can see: re-allocate ub->skb at the end of
> ipt_ulog_packet(), just like it does toward the beginning of the
> function. But
> the problem will still happen if the allocation fails. The second solution,
> implemented by the attached patch, is to just return from ulog_send() if
> ub->skb
> is null.
Very nice catch, thank you. The second solution is perfectly fine I
think, if the skb has already been sent there is no need to do
anything, a new allocation could be useless if no further traffic
arrives. If you could add a similar fix to
net/bridge/netfilter/ebt_ulog.c and net/netfilter/nfnetlink_log.c
and send me a Signed-off-by: line I'll push it in 2.6.18. Thanks.
next prev parent reply other threads:[~2006-08-11 16:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-10 16:31 [PATCH] Fix ipt_ULOG panics on SMP kernels Mark Huang
2006-08-11 16:19 ` Patrick McHardy [this message]
2006-08-11 16:45 ` Mark Huang
2006-08-11 17:13 ` Patrick McHardy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44DCAE2E.8040006@trash.net \
--to=kaber@trash.net \
--cc=mlhuang@CS.Princeton.EDU \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.