* What dose 'general protection fault: 0000' mean?
@ 2002-06-11 2:09 Wang Hui
0 siblings, 0 replies; 5+ messages in thread
From: Wang Hui @ 2002-06-11 2:09 UTC (permalink / raw)
To: linux-kernel
Hi, all,
I am coding a linux kernel module, but when I run my testing code I got
a kernel panic. And the panic screen said:
general protection fault:0000
CPU: 0
EIP: 0010:[<d289a213>] Tainted: P
EFLAGS: 00010297
............
............
Code: 8b 02 8b 55 08 89 02 8b 55 0c 8b 42 04 8b 55 08 89 42 04 8b
<0> Kernel panic: Aiee, killing interrupt handler!
In interrupt handler - not syncing
==================================================
I am a newbie to linux kernel hacking. I dont know how to find out
where is the fault code. :( Could anyone give me some hints???
Thanks a lot in advance!!
Regards,
Wang Hui.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: What dose 'general protection fault: 0000' mean?
[not found] <3D057CDD.3070307@netscape.net>
@ 2002-06-11 5:36 ` Wang Hui
2002-06-11 6:27 ` Gilad Ben-Yossef
0 siblings, 1 reply; 5+ messages in thread
From: Wang Hui @ 2002-06-11 5:36 UTC (permalink / raw)
To: ganda utama; +Cc: linux-kernel
Thanks to Ganda.
In fact, I am implementing RFC3095 to linux kernel. I want to make it
a kernel module.
The basic function of this module could be described as the following 2
parts:
1. The module will modify the outgoing packet(ipv6 or IPv6 ) and compress
the IP header.(we will do flow recognition and update some context
for further compress stuff here.)
2. The other part of this module will de-compress this compressed
IP header. And then passes the de-compressed packet up to IP(v4 or v6)
module to do the normal recieving processes.
To realize the function 1, I use this tricks: I modified all the kernel's
active network device's dev->hard_start_xmit function pointer to be my own
function named as 'my_output_handler', and backuped the original
'dev->hard_start_xmit' funtion pointer witch will be called inside
'my_output_handler' as to send out the modified data.
As to realize function 2, I would like to omitted here. For it has
nothing to do with this current panic.
All the above funtions are implemented and I tested the codes via my
loopback network device(lo) using the address of '::1' or '127.0.0.1'.
The codes run OK in the lo device. But when I put my codes to the real
ethernet device which is a realtek 8139 network card, I got kernel panic.
I dont know what to do with it? I guess this panic is due to something
difference between loopback network device and the real network device
drivers. But I dont know exactly what is wrong, or say, that what should I
do to avoid this panic? Any rules to write safe code here?
Many thanks again.
Best regards,
Wang.
On Tue, 11 Jun 2002, ganda utama wrote:
> it seems that you remove the process that handles this
> interupt (perhaps by using kfree). or remove the module,
> while the kernel still think that the handler is still there...
>
> ganz
>
>
> whui@mail.ustc.edu.cn wrote:
>
> >Hi, all,
> >
> >I am coding a linux kernel module, but when I run my testing code I got
> >a kernel panic. And the panic screen said:
> >
> >general protection fault:0000
> >CPU: 0
> >EIP: 0010:[<d289a213>] Tainted: P
> >EFLAGS: 00010297
> >............
> >............
> >Code: 8b 02 8b 55 08 89 02 8b 55 0c 8b 42 04 8b 55 08 89 42 04 8b
> ><0> Kernel panic: Aiee, killing interrupt handler!
> >In interrupt handler - not syncing
> >
> >==================================================
> >
> >I am a newbie to linux kernel hacking. I dont know how to find out
> >where is the fault code. :( Could anyone give me some hints???
> >
> >Thanks a lot in advance!!
> >
> >Regards,
> >Wang Hui.
> >
> >-
> >To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> >the body of a message to majordomo@vger.kernel.org
> >More majordomo info at http://vger.kernel.org/majordomo-info.html
> >Please read the FAQ at http://www.tux.org/lkml/
> >
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: What dose 'general protection fault: 0000' mean?
2002-06-11 5:36 ` What dose 'general protection fault: 0000' mean? Wang Hui
@ 2002-06-11 6:27 ` Gilad Ben-Yossef
2002-06-11 7:46 ` Wang Hui
0 siblings, 1 reply; 5+ messages in thread
From: Gilad Ben-Yossef @ 2002-06-11 6:27 UTC (permalink / raw)
To: Wang Hui; +Cc: ganda utama, linux-kernel
On Tue, 2002-06-11 at 08:36, Wang Hui wrote:
> > >Code: 8b 02 8b 55 08 89 02 8b 55 0c 8b 42 04 8b 55 08 89 42 04 8b
> > ><0> Kernel panic: Aiee, killing interrupt handler!
> > >In interrupt handler - not syncing
> > >
> > >==================================================
> > >
> > >I am a newbie to linux kernel hacking. I dont know how to find out
> > >where is the fault code. :( Could anyone give me some hints???
> > it seems that you remove the process that handles this
> > interupt (perhaps by using kfree). or remove the module,
> > while the kernel still think that the handler is still there...
In the /scripts directory of the Linux tree there is a small utility
that can help you grok these oopses. It is called 'ksymoops'.
> To realize the function 1, I use this tricks: I modified all the kernel's
> active network device's dev->hard_start_xmit function pointer to be my own
> function named as 'my_output_handler', and backuped the original
> 'dev->hard_start_xmit' funtion pointer witch will be called inside
> 'my_output_handler' as to send out the modified data.
Suggestion: don't change kernel primitives like this. Instead write your
code as a Netfilter/iptables module. IMHO it's more of the Right
Thing(tm) and will save you a bunch of headaches...
> ethernet device which is a realtek 8139 network card, I got kernel panic.
> I dont know what to do with it? I guess this panic is due to something
> difference between loopback network device and the real network device
> drivers. But I dont know exactly what is wrong, or say, that what should I
> do to avoid this panic? Any rules to write safe code here?
Only 1 rule really - what ever happens, under ANY circumstances, never
ever go chasing after the ship's cat. Remember: "In Kernel space, no one
can hear you scream." :-)
Gilad.
--
Gilad Ben-Yossef <gilad@benyossef.com>
http://benyossef.com
"Hail Eris! All Hail Discordia!"
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: What dose 'general protection fault: 0000' mean?
2002-06-11 6:27 ` Gilad Ben-Yossef
@ 2002-06-11 7:46 ` Wang Hui
2002-06-11 14:40 ` Gilad Ben-Yossef
0 siblings, 1 reply; 5+ messages in thread
From: Wang Hui @ 2002-06-11 7:46 UTC (permalink / raw)
To: Gilad Ben-Yossef; +Cc: ganda utama, linux-kernel
Thanks to Gliad.
As you mentioned in your mail, you suggested me to make a Netfilter module
to realize what I want. In fact, it is really a good choice. But as to
my case, I have to modify the outgoing IP packet header. And after the
modification, the outgoing IP packet's header will become a none-IP
header( as defined in RFC 3095). So I dont know if this kind of
modified packet could still traverse the netfilter chains? Will the
kernel drop this 'strange header' packet (for the kernel cannot
understand this kind of none-IP header)? Or say, where should I put my
modification module in the netfilter chain as to avoid this dropping??
To clearify my problem, I would like to draw a small picture here:
[kernel ipv6 packet output] --> [My Module: modify the IP header to be a
nono-IP header] --> [ put it to the device output queue to sent out]
My current problem is where to put 'my module' in the kernel data flow?
netfilter? or else?
Looking forward to any suggestion.
Best,
Wang Hui
On 11 Jun 2002, Gilad Ben-Yossef wrote:
> On Tue, 2002-06-11 at 08:36, Wang Hui wrote:
>
>
> > > >Code: 8b 02 8b 55 08 89 02 8b 55 0c 8b 42 04 8b 55 08 89 42 04 8b
> > > ><0> Kernel panic: Aiee, killing interrupt handler!
> > > >In interrupt handler - not syncing
> > > >
> > > >==================================================
> > > >
> > > >I am a newbie to linux kernel hacking. I dont know how to find out
> > > >where is the fault code. :( Could anyone give me some hints???
>
> > > it seems that you remove the process that handles this
> > > interupt (perhaps by using kfree). or remove the module,
> > > while the kernel still think that the handler is still there...
>
> In the /scripts directory of the Linux tree there is a small utility
> that can help you grok these oopses. It is called 'ksymoops'.
>
> > To realize the function 1, I use this tricks: I modified all the kernel's
> > active network device's dev->hard_start_xmit function pointer to be my own
> > function named as 'my_output_handler', and backuped the original
> > 'dev->hard_start_xmit' funtion pointer witch will be called inside
> > 'my_output_handler' as to send out the modified data.
>
> Suggestion: don't change kernel primitives like this. Instead write your
> code as a Netfilter/iptables module. IMHO it's more of the Right
> Thing(tm) and will save you a bunch of headaches...
>
> > ethernet device which is a realtek 8139 network card, I got kernel panic.
> > I dont know what to do with it? I guess this panic is due to something
> > difference between loopback network device and the real network device
> > drivers. But I dont know exactly what is wrong, or say, that what should I
> > do to avoid this panic? Any rules to write safe code here?
>
> Only 1 rule really - what ever happens, under ANY circumstances, never
> ever go chasing after the ship's cat. Remember: "In Kernel space, no one
> can hear you scream." :-)
>
> Gilad.
>
> --
> Gilad Ben-Yossef <gilad@benyossef.com>
> http://benyossef.com
> "Hail Eris! All Hail Discordia!"
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: What dose 'general protection fault: 0000' mean?
2002-06-11 7:46 ` Wang Hui
@ 2002-06-11 14:40 ` Gilad Ben-Yossef
0 siblings, 0 replies; 5+ messages in thread
From: Gilad Ben-Yossef @ 2002-06-11 14:40 UTC (permalink / raw)
To: Wang Hui; +Cc: ganda utama, linux-kernel
On Tue, 2002-06-11 at 10:46, Wang Hui wrote:
> As you mentioned in your mail, you suggested me to make a Netfilter module
> to realize what I want. In fact, it is really a good choice. But as to
> my case, I have to modify the outgoing IP packet header. And after the
> modification, the outgoing IP packet's header will become a none-IP
> header( as defined in RFC 3095). So I dont know if this kind of
> modified packet could still traverse the netfilter chains? Will the
> kernel drop this 'strange header' packet (for the kernel cannot
> understand this kind of none-IP header)? Or say, where should I put my
> modification module in the netfilter chain as to avoid this dropping??
I understand completly the problem of not being able to *continue*
traversing the netfilter path because of the sk_buff no longer
containing a valid IP packet.
My suggestion is to use the netfilter (or even better iptables) system
to 'harvest' the packets, modify them and then do whatever needs to be
done to transmit them.
AFAIK RFC3095 has several modes of operations and only with some of them
the end result is a non IP packet where in the others the it is an
encapsulating IP packet. When you harvest the packet using
netfilter/iptables you can re-inject those packets to the stack if it is
apropriate (the end result in an IP packet) or directly to the transmit
queue of the device (when it isn't).
Aoother advantage of my suggestion is that you don't need to *alter* the
dev struct, so you don't need to worry about the race and other
conditions that are involved with such a thing.
It'll also enable you do neat tricks like use RFC3095 only for a
specific stream while leaving all the rest intact. Whether this actually
makes sense or not I don't know.
> To clearify my problem, I would like to draw a small picture here:
> [kernel ipv6 packet output] --> [My Module: modify the IP header to be a
> nono-IP header] --> [ put it to the device output queue to sent out]
To clarify my suggestion, I'm thinking of:
[ IP stack ] -> [Netfilter/iptables hook ] -> [Your module] if IP packet
-> [ IP stack] else -> [ device xmit queue ]
Gilad.
--
Gilad Ben-Yossef <gilad@benyossef.com>
Code mangler, senior coffee drinker and VP SIGSEGV
Qlusters ltd.
"A billion flies _can_ be wrong - I'd rather eat lamb chops than shit."
-- Linus Torvalds on lkml
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-06-11 14:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <3D057CDD.3070307@netscape.net>
2002-06-11 5:36 ` What dose 'general protection fault: 0000' mean? Wang Hui
2002-06-11 6:27 ` Gilad Ben-Yossef
2002-06-11 7:46 ` Wang Hui
2002-06-11 14:40 ` Gilad Ben-Yossef
2002-06-11 2:09 Wang Hui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox