All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tobias DiPasquale <codeslinger@gmail.com>
To: netfilter-devel@lists.netfilter.org
Subject: Re: GFP_KERNEL i checkentry
Date: Fri, 17 Jun 2005 13:12:38 -0400	[thread overview]
Message-ID: <876ef97a050617101245656fd6@mail.gmail.com> (raw)
In-Reply-To: <20050617165026.GY12820@aaricia.csbnet.se>

On 6/17/05, Joakim Axelsson <gozem@gozem.se> wrote:
> I have during my developing of some new modules be running into some
> problem which I need help with. Since im running my routers on old
> 2.4.23-kernel i have been developing for it. However i will most probably
> convert to 2.6 soon.
> 
> Anyway, in "ipt_checkentry" that is executed everytime a new rule is added
> which uses the module (or acutally whenever ANY rule is changed, added or
> removed) it would seem that the kernel (atleast 2.4) considers this to be
> inside an interupt-handler. I guess this is the softinterupt syscall that
> get/setsockopt() refers to. However, i was using GFP_KERNEL to allocate
> memory here. This seems to be wrong and needs to be GTP_ATOMIC. In _very_
> rare occations this will trigger the BUG() on line 1130 in mm/slab.c (in
> kernel 2.4.23) whenever the general fiting slabs needs to be grown.
> 
> Now to the problem. As far as i can see, vanilla 2.6.11.9 has this problem
> in ipt_SAME. Possbile ipt_connlimit and ipt_recent. However i don't think
> proc fs punctions need to be GFP_ATOMIC. Possbily this problem exists in other
> modules in patch-o-magic. I havn't had a time to check it. However, among
> those patches i use from an about 1 year old pom in my 2.4.23 routing kernel
> there are several occations of this.
> 
> Again, this is a very very rare bug to trigger. I had to load ALOT of
> instances using iptables-restore of my module before the bug was triggered.
> 
> Question is: Should it really be GFP_ATOMIC in all of the modules hook
> functions?

No, this is definitely in process context. The bug you are
experiencing is not due to being in interrupt context when you think
you're in process: if that were the case, the bug would manifest
itself a lot more often than you claim. This sounds to me like some
kind of locking problem; I would check the locks used in my module and
see if they conflict with the locks used elsewhere up the call stack.
Failing that, look for a bug in the locking of the calling functions.

-- 
[ Tobias DiPasquale ]
0x636f6465736c696e67657240676d61696c2e636f6d

  reply	other threads:[~2005-06-17 17:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-17 16:50 GFP_KERNEL i checkentry Joakim Axelsson
2005-06-17 17:12 ` Tobias DiPasquale [this message]
2005-06-17 18:29   ` Joakim Axelsson
2005-06-17 20:30     ` Joakim Axelsson
2005-06-17 21:56       ` Tobias DiPasquale

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=876ef97a050617101245656fd6@mail.gmail.com \
    --to=codeslinger@gmail.com \
    --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.