netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <dlezcano@fr.ibm.com>
To: Filka Michal <Michal.Filka@sitronicsts.com>
Cc: netdev@vger.kernel.org
Subject: Re: kernel newbie question on kernel panic
Date: Mon, 21 Jul 2008 18:07:25 +0200	[thread overview]
Message-ID: <4884B43D.2080205@fr.ibm.com> (raw)
In-Reply-To: <4474723F928CA640ADB2172099AEAB111B603F@exalfa.stromtelecom.cz>

Filka Michal wrote:
> Hi all,
> 
> I try to create my first kernel module.
> I have following problem. I have a function rp ... interesting part
> follows (just some initialization is ommited - nothing special - the
> function is just a skeleton)
> 
> int rp( struct sk_buff ** skb)
> {
> 	_filter_rule * rule = NULL;
> 
> ...
> 
> 	rule = placebo();
> -->	if( rule == NULL)
> 		printk( KERN_DEBUG "null rule\n");
> 	return 1;
> }
> 
> The rp is called (subsequently) in netfilter (prerouting) hook context,
> so as far as I know it runs in a SoftIRQ.
> 
> The placebo function does nothing - just returns NULL. The problem is in
> line selected (-->).Everything goes until I try to somehow access
> returned value. The access raises kernel panic, seems that some page
> fault happent. If I comment out the line bellow selected (the test), no
> kernel panic happens.
> 
> Questions are:
> - why the page fault happens (some trouble in memory usage, or so?)
> - how to avoid it?
> 
> Thanks for any help
> Michal Filka

What is the definition of _filter_rule ?

      reply	other threads:[~2008-07-21 16:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-21 15:24 kernel newbie question on kernel panic Filka Michal
2008-07-21 16:07 ` Daniel Lezcano [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=4884B43D.2080205@fr.ibm.com \
    --to=dlezcano@fr.ibm.com \
    --cc=Michal.Filka@sitronicsts.com \
    --cc=netdev@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).