Re: Kernel stack....

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 13, 2003 at 13:29:56 -0700, Pat LaVarre wrote:
> Can I somehow easily ...
> 
> Erase the kernel stack of a process, run awhile, and then see how many 
> bytes of that kernel stack changed?

You can copy and later compare. However, what about recording current
value of ESP register in some interrupt(s). (You only need to store
minimum so far for each process).

> I'm interested in guessing how close to overflow I commonly am running.
> 
> http://marc.theaimsgroup.com/?l=kernelnewbies&s=stack+depth
> tells me:
> "i386 ... kernel stack is a (per process) area of 8KBytes".
> 
> On my wn I discovered that inserting the bonehead newbie declaration { 
> char buf[4 + 65530]; } into cdrom.ko along with some other seemingly 
> innocent code makes the kernel go boom.  I do not know if in fact thus 
> I did ask to allot 65534 bytes out of 8192, but I figure I may have.

Yes, you asked 65534 bytes on stack, that only has
2 * PAGE_SIZE - sizeof(struct task_struct) bytes. That can't work.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux