mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Morris <jmorris@intercode.com.au>
To: Andrew Morton <akpm@digeo.com>
Cc: Steven Cole <scole@lanl.gov>, lkml <linux-kernel@vger.kernel.org>,
	<netfilter-devel@lists.netfilter.org>,
	Harald Welte <laforge@gnumonks.org>
Subject: Re: Sleeping function called from illegal context at slab.c:1378
Date: Tue, 24 Sep 2002 23:34:49 +1000 (EST)	[thread overview]
Message-ID: <Mutt.LNX.4.44.0209242331430.1239-100000@blackbird.intercode.com.au> (raw)
In-Reply-To: <3D8F5DB2.A3E36E16@digeo.com>

On Mon, 23 Sep 2002, Andrew Morton wrote:

> That's a bug in ip_fw_ctl().  It's calling convert_ipfw()
> inside FWC_WRITE_LOCK_IRQ(&ip_fw_lock, flags);
> 
> But convert_ipfw() does kmalloc(GFP_KERNEL).
> 

Below a patch to correct this. The bug is also present in 2.2 and 2.4 
(patches to follow on netfilter-devel).

- James
-- 
James Morris
<jmorris@intercode.com.au>

diff -urN -X dontdiff linux-2.5.38.orig/net/ipv4/netfilter/ipchains_core.c linux-2.5.38.w1/net/ipv4/netfilter/ipchains_core.c
--- linux-2.5.38.orig/net/ipv4/netfilter/ipchains_core.c	Tue Sep 10 09:43:30 2002
+++ linux-2.5.38.w1/net/ipv4/netfilter/ipchains_core.c	Tue Sep 24 23:09:50 2002
@@ -1252,7 +1252,7 @@
 		return NULL;
 	}
 
-	fwkern = kmalloc(SIZEOF_STRUCT_IP_FW_KERNEL, GFP_KERNEL);
+	fwkern = kmalloc(SIZEOF_STRUCT_IP_FW_KERNEL, GFP_ATOMIC);
 	if (!fwkern) {
 		duprintf("convert_ipfw: kmalloc failed!\n");
 		*errno = ENOMEM;


      parent reply	other threads:[~2002-09-24 13:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1032804558.28404.13.camel@spc9.esa.lanl.gov>
2002-09-23 18:30 ` Andrew Morton
2002-09-23 20:00   ` Steven Cole
2002-09-23 20:21     ` Andrew Morton
2002-09-23 20:43       ` Steven Cole
2002-09-23 20:49       ` Nuno Monteiro
2002-09-23 21:30         ` Andrew Morton
2002-09-24 13:34   ` James Morris [this message]

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=Mutt.LNX.4.44.0209242331430.1239-100000@blackbird.intercode.com.au \
    --to=jmorris@intercode.com.au \
    --cc=akpm@digeo.com \
    --cc=laforge@gnumonks.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=scole@lanl.gov \
    /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

all inboxes | Powered by JetHome®