From: "Breno" <brenosp@brasilsec.com.br>
To: "Andreas Dilger" <adilger@clusterfs.com>
Cc: "Kernel List" <linux-kernel@vger.kernel.org>
Subject: Re: stack overflow
Date: Fri, 12 Sep 2003 20:14:18 +0100 [thread overview]
Message-ID: <00ed01c37962$141237c0$f8e4a7c8@bsb.virtua.com.br> (raw)
In-Reply-To: <20030912165047.Z18851@schatzie.adilger.int>
I think that size limit of user stack is 8mb
Breno
----- Original Message -----
From: "Andreas Dilger" <adilger@clusterfs.com>
To: "Breno" <brenosp@brasilsec.com.br>
Cc: "Kernel List" <linux-kernel@vger.kernel.org>
Sent: Friday, September 12, 2003 11:50 PM
Subject: Re: stack overflow
> On Sep 12, 2003 18:53 +0100, Breno wrote:
> > Hi ... this is my idea to check a stack overflow. What do you think ?
> >
> > #define STACK_LIMIT (1024*8192)/PAGE_SIZE
> >
> > int check_stack_overflow(struct task_struct *tsk)
> > {
> >
> > unsigned long stack_size,stack_addr,stack_ptr;
> > int i;
> >
> > if(tsk->mm != NULL)
> > {
> > stack_addr = tsk->mm->start_stack;
> >
> > stack_ptr = tsk->thread.esp;
> >
> > for(i=0; i < stack_ptr; i++)
> > stack_addr++;
> >
> > stack_size = (stack_addr - stack_ptr)/PAGE_SIZE;
> >
> > if(stack_size > ( STACK_LIMIT - 1))
>
> Well, with the exception of the fact that STACK_LIMIT is 8MB, and kernel
> stacks are only 8kB (on i386)...
>
> Also, see "do_IRQ()" (i386) for CONFIG_DEBUG_STACKOVERFLOW to see this
already.
>
> Cheers, Andreas
> --
> Andreas Dilger
> http://sourceforge.net/projects/ext2resize/
> http://www-mddsp.enel.ucalgary.ca/People/adilger/
>
> -
> 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/
next prev parent reply other threads:[~2003-09-12 23:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-12 17:53 Breno
2003-09-12 22:50 ` Andreas Dilger
2003-09-12 19:14 ` Breno [this message]
2003-09-12 23:06 ` William Lee Irwin III
2003-09-12 19:23 ` Breno
2003-09-12 23:18 ` Alan Cox
2003-09-12 23:25 ` William Lee Irwin III
2003-09-12 23:18 ` stack overflow - kernel thread Breno
-- strict thread matches above, loose matches on Subject: below --
2003-01-24 7:08 Stack overflow Madhavi
2003-01-24 7:53 ` Linux Geek
2003-01-24 15:32 ` GrandMasterLee
2003-01-24 15:41 ` Madhavi
2003-01-24 16:42 ` Richard B. Johnson
2003-01-24 16:52 ` Gianni Tedesco
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='00ed01c37962$141237c0$f8e4a7c8@bsb.virtua.com.br' \
--to=brenosp@brasilsec.com.br \
--cc=adilger@clusterfs.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome