What dose 'general protection fault: 0000' mean?
A message that is not in the archive (sent off-list or not yet received): [email protected]
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.
Quoted 43 lines · ganda utama
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
Quoted 31 lines · [email protected] 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: 0EIP: 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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Quoted 4 lines · Wang Hui
Quoted 4 lines
Quoted 4 lines
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
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
==================================================
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'.
Quoted 5 lines
To realize the function 1, I use this tricks: I modified all the kernel's active network device's
dev->hard_start_xmitfunction 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...
Quoted 5 lines
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.
Signature · 3 lines
Gilad Ben-Yossef <[email protected]> http://benyossef.com "Hail Eris! All Hail Discordia!"
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
Quoted 52 lines · Gilad Ben-Yossef
Quoted 4 lines · Wang Hui
Quoted 4 lines
Quoted 4 lines
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
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
==================================================
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'.
Quoted 5 lines
To realize the function 1, I use this tricks: I modified all the kernel's active network device's
dev->hard_start_xmitfunction 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...
Quoted 5 lines
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 <[email protected]>
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Quoted 9 lines · Wang Hui
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.
Quoted 3 lines
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.
Signature · 6 lines
Gilad Ben-Yossef <[email protected]> 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