Page 1 of 1

Debuging code causes slab coruption and locks warnings

PostPosted: Sun Jun 10, 2007 8:47 am
by Raf256
Hello, strange things happen when I build 2.6.21.x kernels with both grsecurity and debuging (in kernel hacking - like slab, VM, and locks debugging).

Some files are not visible in ls /etc yet /etc/the_file/ works (and it works after reboot; no, I didnt used RBAC etc)

I get errors:
Code: Select all
000: 78 30 2c f3 00 50 bc b7 00 70 bc b7 60 27 64 f5
010: 25 00 00 00 73 00 10 00 e4 2e 64 f5 00 00 00 00
Slab corruption: vm_area_struct start=ed12a3dc, len=88
Redzone: 0x5a2cf071/0x5a2cf071.
Last user: [<c01d7826>](vma_adjust+0x186/0x400)
010: 6b 6b 6b 6b 73 00 10 00 6b 6b 6b 6b 6b 6b 6b 6b
Prev obj: start=ed12a378, len=88
Redzone: 0x170fc2a5/0x170fc2a5.


when running memtest (application) and occassionally just from time to time when using computer.

On bootup I get some lock debugging warnings (but too early to have it in boot log AFAIK).
That is on 2.6.21.3.

2.6.21.4 doesnt boot up at all - hangs, usually with error in interrupt kernel panic.

All of the problems above vanish immediatelly when not using grsecurity patch on same kernel/config.

2.6.21.4 without grsecurity patch but with same debugging option works perfectyl.

http://www.limcore.com/misc/debug/grsec/0001/ - more inform about this problem including .config Sysmap and kernel image.

PostPosted: Sun Jun 10, 2007 10:28 am
by Dr_Napalm
This might help :)

Code: Select all
--- linux-2.6.20/drivers/media/video/pwc/pwc-uncompress.c~      2007-02-04 19:44:54.000000000 +0100
+++ linux-2.6.20/drivers/media/video/pwc/pwc-uncompress.c       2007-03-28 09:53:41.000000000 +0200
@@ -26,6 +26,7 @@
    vim: set ts=8:
 */
 
+#include <linux/cpu.h>
 #include <asm/current.h>
 #include <asm/types.h>
[/code]

PostPosted: Tue Jun 12, 2007 7:19 am
by Raf256
I think you pasted wrong code (in wrong forum thread?)

Re: Debuging code causes slab coruption and locks warnings

PostPosted: Sun Jun 17, 2007 3:57 am
by PaX Team
Raf256 wrote:Some files are not visible in ls /etc yet /etc/the_file/ works (and it works after reboot; no, I didnt used RBAC etc)
this one i couldn't reproduce, probably comes from grsec itself.
I get errors:
Code: Select all
000: 78 30 2c f3 00 50 bc b7 00 70 bc b7 60 27 64 f5
010: 25 00 00 00 73 00 10 00 e4 2e 64 f5 00 00 00 00
Slab corruption: vm_area_struct start=ed12a3dc, len=88
Redzone: 0x5a2cf071/0x5a2cf071.
Last user: [<c01d7826>](vma_adjust+0x186/0x400)
010: 6b 6b 6b 6b 73 00 10 00 6b 6b 6b 6b 6b 6b 6b 6b
Prev obj: start=ed12a378, len=88
Redzone: 0x170fc2a5/0x170fc2a5.


when running memtest (application) and occassionally just from time to time when using computer.
thanks to your reports, i managed to find and fix it, it's in the latest test patch already. if you don't want to wait for spender to return from the wonderful world of WoW (i should trademark WWoWoW and have him pay each time he's lost there ;P), you can just interdiff and apply the mm/mlock.c changes yourself.
On bootup I get some lock debugging warnings (but too early to have it in boot log AFAIK).
That is on 2.6.21.3.
this i couldn't reproduce either, but if you enlarge the kernel log buffer, you can capture it later in dmesg.
2.6.21.4 doesnt boot up at all - hangs, usually with error in interrupt kernel panic.
it works for me, so i'll need detailed logs (also, try PaX alone, now at 2.6.21.5).