From: Patrick McHardy <kaber@trash.net>
To: "Kövesdi György" <kgy@teledigit.hu>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Netfilter Developer Mailing List
<netfilter-devel@vger.kernel.org>
Subject: Re: 2.6.28(.1) and netlink: scheduling while atomic
Date: Wed, 21 Jan 2009 10:54:51 +0100 [thread overview]
Message-ID: <4976F0EB.8050806@trash.net> (raw)
In-Reply-To: <200901211029.01619.kgy@teledigit.hu>
[-- Attachment #1: Type: text/plain, Size: 471 bytes --]
Kövesdi György wrote:
> The new netlink interface allows to add NAT directly to a conntrack entry.
> If it is used when the moudule nf-nat-ipv4 is not loaded in, it results in
> crash:
> BUG: scheduling while atomic
> It is in the kernels 2.6.28 and 2.6.28.1 in the function
> ctnetlink_parse_nat_setup(): it calls request_module() which causes the
> problem. If the module is already loaded, then there is no problem.
Thanks for the report. Does this patch fix it?
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 682 bytes --]
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index 3dddec6..c32a7e8 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -831,13 +831,16 @@ ctnetlink_parse_nat_setup(struct nf_conn *ct,
if (!parse_nat_setup) {
#ifdef CONFIG_MODULES
rcu_read_unlock();
+ spin_unlock_bh(&nf_conntrack_lock);
nfnl_unlock();
if (request_module("nf-nat-ipv4") < 0) {
nfnl_lock();
+ spin_lock_bh(&nf_conntrack_lock);
rcu_read_lock();
return -EOPNOTSUPP;
}
nfnl_lock();
+ spin_lock_bh(&nf_conntrack_lock);
rcu_read_lock();
if (nfnetlink_parse_nat_setup_hook)
return -EAGAIN;
next prev parent reply other threads:[~2009-01-21 9:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-21 9:29 2.6.28(.1) and netlink: scheduling while atomic Kövesdi György
2009-01-21 9:54 ` Patrick McHardy [this message]
2009-01-21 10:25 ` Kövesdi György
2009-01-21 10:59 ` Pablo Neira Ayuso
2009-01-21 11:02 ` 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=4976F0EB.8050806@trash.net \
--to=kaber@trash.net \
--cc=kgy@teledigit.hu \
--cc=linux-kernel@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.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 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).