All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Jarosch <thomas.jarosch@intra2net.com>
To: netfilter-devel@lists.netfilter.org
Subject: Memory allocation inside target handler
Date: Fri, 17 Aug 2007 17:17:00 +0200	[thread overview]
Message-ID: <200708171717.01065.thomas.jarosch@intra2net.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1006 bytes --]

Hi there,

I'm currently debugging a memory allocation issue in ipt_ACCOUNT running on 
2.6.21.7. The module allocates memory using get_zeroed_page(GFP_ATOMIC) 
inside the target handler code (interrupt context).

This worked so far without problems. After upgrading from 2.4.32
to 2.6.21.7, I get a kernel oops after 15 to 30 minutes. Attached you'll
find a picture of the oops (sorry, no serial console available).

You can see the kernel is allocating memory when an interrupt is fired.
It then enters netfilter and ends up in ipt_ACCOUNT
which also tries to allocate memory -> Boom.

My question is now:
- Is it ok to use get_zeroed_page(GFP_ATOMIC) in interrupt context?
- Do I need some special locking before I can allocate memory inside
  the target handler? Is f.e. kmalloc protected by some special locking?

In addition ipt_ACCOUNT allocates some memory during the module init code
with kmalloc(GFP_KERNEL), but I guess this is not an issue here.

Thanks in advance for any help,
Thomas Jarosch

             reply	other threads:[~2007-08-17 15:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-17 15:17 Thomas Jarosch [this message]
2007-08-17 15:22 ` Memory allocation inside target handler Thomas Jarosch
2007-08-17 15:25   ` Thomas Jarosch
2007-08-17 20:39     ` Carl-Daniel Hailfinger
2007-08-20  9:29       ` Thomas Jarosch
2007-08-17 15:42 ` Jan Engelhardt
2007-08-20  9:46   ` Thomas Jarosch

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=200708171717.01065.thomas.jarosch@intra2net.com \
    --to=thomas.jarosch@intra2net.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.