netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Giacomo <delleceste@gmail.com>
To: netfilter-devel@vger.kernel.org
Subject: netlink question
Date: Tue, 10 Feb 2009 21:33:38 +0100	[thread overview]
Message-ID: <885896af0902101233t6f1a7054y90c86f9d93ebf112@mail.gmail.com> (raw)

Dear netfilter list.

I would like to ask you about a strange issue.

I wrote a software that communicates with kernel space via the netlink socket.

A data structure of 212 byte (+16 byte of netlink header) used to
travel from user to kernel space and viceversa
without any problem.
Inside kernel space, socket buffer is allocated with alloc_skb
together with GFP_ATOMIC flag.

Since a couple of fields in the structure have changed

from __u32 source_ip  to __u32 source_ip[50];

and equivalently __u32 dest_ip became  __u32 dest_ip[50];

__u16 sport;   ->  __u16 sport[50];

__u16 dport;   ->  __u16 dport[50];

kernel began to crash, reporting, among other messages "scheduling
while atomic".

The data structure is now grown up to 788bytes (+16 netlink header).

I introduced in the functions responsible of netlink communication
some printks reporting the value of
in_atomic();

while with little data structures I always read in_atomic() == 0,  in
the same actions, but with the bigger
data structure, sometimes i read in_atomic() == 1


Is there a possible reason for this behaviour?

If yes, how should the behaviour be corrected?

Thanks in advance.

Giacomo, Italy.





-- 
Giacomo S.
http://www.giacomos.it

- - - - - - - - - - - - - - - - - - - - - -

* Aprile 2008: iqfire-wall, un progetto
  open source che implementa un
  filtro di pacchetti di rete per Linux,
  e` disponibile per il download qui:
  http://sourceforge.net/projects/ipfire-wall

* Informazioni e pagina web ufficiale:
  http://www.giacomos.it/iqfire/index.html

- - - - - - - - - - - - - - - - - - - - - -

 . ''  `.
:   :'    :
 `.  ` '
    `- Debian GNU/Linux -- The power of freedom
        http://www.debian.org

                 reply	other threads:[~2009-02-10 20:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=885896af0902101233t6f1a7054y90c86f9d93ebf112@mail.gmail.com \
    --to=delleceste@gmail.com \
    --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).