mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* How to find out kernel stack over flow?
@ 2005-09-07  7:28 nazim khan
  2005-09-07  8:18 ` Michal Schmidt
  0 siblings, 1 reply; 5+ messages in thread
From: nazim khan @ 2005-09-07  7:28 UTC (permalink / raw)
  To: linux-kernel

Hi,

I suspect that one of my module that I am inserting in
the kernel may be causing the stack overflow which is
leading to kernel crash (may because it is corrupting
some one lese memory).

How can I find this out?

Thanks in advance.
Nazim

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to find out kernel stack over flow?
  2005-09-07  7:28 How to find out kernel stack over flow? nazim khan
@ 2005-09-07  8:18 ` Michal Schmidt
  2005-09-07 11:40   ` Neil Horman
  2005-09-08  5:17   ` nazim khan
  0 siblings, 2 replies; 5+ messages in thread
From: Michal Schmidt @ 2005-09-07  8:18 UTC (permalink / raw)
  To: nazim khan; +Cc: linux-kernel

nazim khan wrote:
> I suspect that one of my module that I am inserting in
> the kernel may be causing the stack overflow which is
> leading to kernel crash (may because it is corrupting
> some one lese memory).
> 
> How can I find this out?

You could enable CONFIG_DEBUG_STACKOVERFLOW.
If you showed us your module's source code, someone might see the bug.

Michal

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to find out kernel stack over flow?
  2005-09-07  8:18 ` Michal Schmidt
@ 2005-09-07 11:40   ` Neil Horman
  2005-09-08  5:17   ` nazim khan
  1 sibling, 0 replies; 5+ messages in thread
From: Neil Horman @ 2005-09-07 11:40 UTC (permalink / raw)
  To: Michal Schmidt; +Cc: nazim khan, linux-kernel

On Wed, Sep 07, 2005 at 10:18:13AM +0200, Michal Schmidt wrote:
> nazim khan wrote:
> >I suspect that one of my module that I am inserting in
> >the kernel may be causing the stack overflow which is
> >leading to kernel crash (may because it is corrupting
> >some one lese memory).
> >
> >How can I find this out?
> 
> You could enable CONFIG_DEBUG_STACKOVERFLOW.
> If you showed us your module's source code, someone might see the bug.
> 
> Michal
> -
> 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/

Additionally, if you have netconsole/netdump set up, you can examine the
resultant core file with the crash utility to find telltale signs of an
overflow.  Nominally a stack overflow results in the corruption of data at the
end of a neighboring task_struct.

Regards
Neil

-- 
/***************************************************
 *Neil Horman
 *Software Engineer
 *gpg keyid: 1024D / 0x92A74FA1 - http://pgp.mit.edu
 ***************************************************/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to find out kernel stack over flow?
  2005-09-07  8:18 ` Michal Schmidt
  2005-09-07 11:40   ` Neil Horman
@ 2005-09-08  5:17   ` nazim khan
  2005-09-08 12:24     ` Neil Horman
  1 sibling, 1 reply; 5+ messages in thread
From: nazim khan @ 2005-09-08  5:17 UTC (permalink / raw)
  To: Michal Schmidt; +Cc: linux-kernel

Thanks Michal for your response,

I forgot to mention that I am using linux 2.4.26,
and STACKOVERFLOW option is not available here.

regards,
Nazim

--- Michal Schmidt <xschmi00@stud.feec.vutbr.cz>
wrote:

> nazim khan wrote:
> > I suspect that one of my module that I am
> inserting in
> > the kernel may be causing the stack overflow which
> is
> > leading to kernel crash (may because it is
> corrupting
> > some one lese memory).
> > 
> > How can I find this out?
> 
> You could enable CONFIG_DEBUG_STACKOVERFLOW.
> If you showed us your module's source code, someone
> might see the bug.
> 
> Michal
> 



	
		
______________________________________________________
Click here to donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to find out kernel stack over flow?
  2005-09-08  5:17   ` nazim khan
@ 2005-09-08 12:24     ` Neil Horman
  0 siblings, 0 replies; 5+ messages in thread
From: Neil Horman @ 2005-09-08 12:24 UTC (permalink / raw)
  To: nazim khan; +Cc: Michal Schmidt, linux-kernel

On Wed, Sep 07, 2005 at 10:17:16PM -0700, nazim khan wrote:
> Thanks Michal for your response,
> 
> I forgot to mention that I am using linux 2.4.26,
> and STACKOVERFLOW option is not available here.
> 
> regards,
> Nazim
> 
It shouldn't be a difficult thing to hand-edit in (or at least an approximation
thereof).  Its really just a comparison of the current stack pointer in relation
to the current task_struct preformed in the do_IRQ function (so that it check
stack depth on interrupts).

Alternative to this method, or the netdump method I mentioned earlier.  If you
have some idea of which function(s) you are likely to be executing when the
stack overflows, you can also use -finstrument-functions as a finer grained
approach to detecting the problem.

Regards
Neil

> --- Michal Schmidt <xschmi00@stud.feec.vutbr.cz>
> wrote:
> 
> > nazim khan wrote:
> > > I suspect that one of my module that I am
> > inserting in
> > > the kernel may be causing the stack overflow which
> > is
> > > leading to kernel crash (may because it is
> > corrupting
> > > some one lese memory).
> > > 
> > > How can I find this out?
> > 
> > You could enable CONFIG_DEBUG_STACKOVERFLOW.
> > If you showed us your module's source code, someone
> > might see the bug.
> > 
> > Michal
> > 
> 
> 
> 
> 	
> 		
> ______________________________________________________
> Click here to donate to the Hurricane Katrina relief effort.
> http://store.yahoo.com/redcross-donate3/
> -
> 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/

-- 
/***************************************************
 *Neil Horman
 *Software Engineer
 *gpg keyid: 1024D / 0x92A74FA1 - http://pgp.mit.edu
 ***************************************************/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-09-08 12:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-07  7:28 How to find out kernel stack over flow? nazim khan
2005-09-07  8:18 ` Michal Schmidt
2005-09-07 11:40   ` Neil Horman
2005-09-08  5:17   ` nazim khan
2005-09-08 12:24     ` Neil Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®