netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.6.28(.1) and netlink: scheduling while atomic
@ 2009-01-21  9:29 Kövesdi György
  2009-01-21  9:54 ` Patrick McHardy
  0 siblings, 1 reply; 5+ messages in thread
From: Kövesdi György @ 2009-01-21  9:29 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Netfilter Developer Mailing List

Hi,

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.

Regards:
K. Gy.

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

* Re: 2.6.28(.1) and netlink: scheduling while atomic
  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
  2009-01-21 10:25   ` Kövesdi György
  2009-01-21 10:59   ` Pablo Neira Ayuso
  0 siblings, 2 replies; 5+ messages in thread
From: Patrick McHardy @ 2009-01-21  9:54 UTC (permalink / raw)
  To: Kövesdi György
  Cc: Linux Kernel Mailing List, Netfilter Developer Mailing List

[-- 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;

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

* Re: 2.6.28(.1) and netlink: scheduling while atomic
  2009-01-21  9:54 ` Patrick McHardy
@ 2009-01-21 10:25   ` Kövesdi György
  2009-01-21 10:59   ` Pablo Neira Ayuso
  1 sibling, 0 replies; 5+ messages in thread
From: Kövesdi György @ 2009-01-21 10:25 UTC (permalink / raw)
  To: Patrick McHardy
  Cc: Netfilter Developer Mailing List, Linux Kernel Mailing List

> Thanks for the report. Does this patch fix it?
Thanks, it works!

Regards
K. Gy.

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

* Re: 2.6.28(.1) and netlink: scheduling while atomic
  2009-01-21  9:54 ` Patrick McHardy
  2009-01-21 10:25   ` Kövesdi György
@ 2009-01-21 10:59   ` Pablo Neira Ayuso
  2009-01-21 11:02     ` Patrick McHardy
  1 sibling, 1 reply; 5+ messages in thread
From: Pablo Neira Ayuso @ 2009-01-21 10:59 UTC (permalink / raw)
  To: Patrick McHardy, Netfilter Development Mailinglist

Patrick McHardy wrote:
> 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?

Hm, this was introduced when we fixed the problem with race condition in
the conntrack creation :( It would be worth to pass it to 2.6.29-rc.

-- 
"Los honestos son inadaptados sociales" -- Les Luthiers

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: 2.6.28(.1) and netlink: scheduling while atomic
  2009-01-21 10:59   ` Pablo Neira Ayuso
@ 2009-01-21 11:02     ` Patrick McHardy
  0 siblings, 0 replies; 5+ messages in thread
From: Patrick McHardy @ 2009-01-21 11:02 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Development Mailinglist

Pablo Neira Ayuso wrote:
> Patrick McHardy wrote:
>> Thanks for the report. Does this patch fix it?
> 
> Hm, this was introduced when we fixed the problem with race condition in
> the conntrack creation :( It would be worth to pass it to 2.6.29-rc.

Of course :) I'll also send it to stable once it hits upstream.

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

end of thread, other threads:[~2009-01-21 11:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2009-01-21 10:25   ` Kövesdi György
2009-01-21 10:59   ` Pablo Neira Ayuso
2009-01-21 11:02     ` Patrick McHardy

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