mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Oeser <ingo.oeser@informatik.tu-chemnitz.de>
To: Bernd Harries <bha@gmx.de>
Cc: linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org
Subject: Re: 2.2.x: Secret stack size limit in Driver file-ops??? (Was:are Generic ioctls a good thing?)
Date: Sun, 5 Nov 2000 15:26:37 +0100	[thread overview]
Message-ID: <20001105152637.A7204@nightmaster.csn.tu-chemnitz.de> (raw)
In-Reply-To: <3A01C6FA.25A90016@gmx.de> <3A054DC8.1D9701EC@gmx.de>
In-Reply-To: <3A054DC8.1D9701EC@gmx.de>; from bha@gmx.de on Sun, Nov 05, 2000 at 01:08:40PM +0100

On Sun, Nov 05, 2000 at 01:08:40PM +0100, Bernd Harries wrote:
> Is there a limit to the stack size (automatic variables) in
> driver methods, esp.  ioctl?
 
Yes, there is. It's INIT_TASK_SIZE. See include/linux/sched.h for
this.

> I was just implementing some generic ioctls where the size field and cmd field
> are defined at runtime. For testing I use a kernbuf on the stack.

kmalloc() and kfree() it instead.

> In the Linux Device Drivers book I didn't find 'stack size' or
> similar in the index. Are there any limits on the stacksize? If
> yes, how large are they and why would the driver behave so
> stange and not oops or hang? I fear, my filesystem on the test
> Box could be damaged. I saw this bad addres error quite some
> times and suddenly make modules complained about strange
> contents in .config...

Because it's an overall kernel limit. Once you are in kernel
mode, you have less than the above amount of stack. So don't use
it for sth. more complex then pointers or ints. And avoid
recursion as hell.

The kernel will not oops, but instead overwriting your
current task_struct.

> Does gcc grow the stack only at the beginning of a function, or
> can it save the space and re-grow it on entering code_blocks
> also?
 
Check the assembler stage output ;-)

Regards

Ingo Oeser
-- 
Feel the power of the penguin - run linux@your.pc
<esc>:x
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

      reply	other threads:[~2000-11-05 14:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-02 19:56 are Generic ioctls a good thing? Bernd Harries
2000-11-05 12:08 ` 2.2.x: Secret stack size limit in Driver file-ops??? (Was:are Generic ioctls a good thing?) Bernd Harries
2000-11-05 14:26   ` Ingo Oeser [this message]

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=20001105152637.A7204@nightmaster.csn.tu-chemnitz.de \
    --to=ingo.oeser@informatik.tu-chemnitz.de \
    --cc=bha@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.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

all inboxes | Powered by JetHome®