lkml.org 
[lkml]   [1999]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
Subjectkernel stack corruption
Every time when I use ioclt commands on my driver I get a "kernel stack corruption. Aiee".
I set a breakpoint in exit.c at line 142 (using gdbstub and debugging with ddd) and
printed the graphic of the task task_struct *p in a file which is attached to this mail.


--------------------------------------------------------------------
139 REMOVE_LINKS(p);
140 release_thread(p);
141 if (STACK_MAGIC != *(unsigned long *)p->kernel_stack_page)
142 printk(KERN_ALERT "release: %s kernel stack corruption. Aiee\n"
, p->comm);
143 free_kernel_stack(p->kernel_stack_page);
144 current->cmin_flt += p->min_flt + p->cmin_flt;

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

Who can tell me why my p->kernel_stack_page isn't STACK_MAGIC?

in linux/kernel.h

#define STACK_MAGIC 0xdeadbeef

*(unsigned long *)p->kernel_stack_page = 0x2b;

By calling the ioctl the driver allocates thought vmalloc 111600 bytes of kernel space
which is used until a new ioctl call.
Is this the reason for the stack corruption?
Has any memory who is allocated thought ioctl calls to be freed before returning the call?

Hope you can help me
Vasili

----------------------------------
E-Mail: vgo@Ratio.de
Date: 12-Feb-99
Time: 15:09:26

This message was sent by XFMail
----------------------------------
[unhandled content-type:application/postscript]
\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.028 / U:0.788 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site