All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Altaparmakov <aia21@cam.ac.uk>
To: Ian Collier <Ian.Collier@comlab.ox.ac.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6.13: More on drivers/block/loop.c
Date: Wed, 14 Sep 2005 14:12:48 +0100	[thread overview]
Message-ID: <1126703569.331.30.camel@imp.csi.cam.ac.uk> (raw)
In-Reply-To: <20050914135118.A25087@pixie.comlab>

On Wed, 2005-09-14 at 13:51 +0100, Ian Collier wrote:
> Vanilla 2.6.13 doesn't crash.
> 
> However, unpack a fresh copy of 2.6.13, edit include/linux/loop.h to
> change LO_KEY_SIZE from 32 to 1844, and *boom*.  [Don't ask me why
> 1844... that's just what PPDD wants.]
> 
> It's crashing somewhere in loop_set_status_old, probably during the
> call to copy_from_user, but the crash messages aren't that helpful as
> they are different each time, often seem to happen during an interrupt,
> and usually contain pages of recursive calls to do_page_fault and
> error_code.
> 
> The loop_set_status_old function has two local variables, each of which
> is now 1812 bytes longer than it was, and I'm wondering if it's a stack
> overflow problem.  How much stack is a kernel function allowed to use,
> anyway?
> 
> Replacing these variables with kmalloc'd pointers seems to stop the crashes
> anyway, so I'll pass that tip on to the PPDD folks.

Not surprising.  The _entirety_ of the kernel, i.e. not just each
function, has either 4k or 8k of stack (depending on a .config option)
so having two local variables of 1812 bytes each is _guaranteed_ to blow
the stack.

Best regards,

        Anton
-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/


  reply	other threads:[~2005-09-14 13:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-09 12:27 2.6.13: loop ioctl crashes Ian Collier
2005-09-09 12:32 ` linux-os (Dick Johnson)
2005-09-09 13:38   ` Ian Collier
2005-09-09 14:41     ` linux-os (Dick Johnson)
2005-09-09 14:59       ` linux-os (Dick Johnson)
2005-09-09 15:42       ` Ian Collier
2005-09-14 12:51 ` 2.6.13: More on drivers/block/loop.c Ian Collier
2005-09-14 13:12   ` Anton Altaparmakov [this message]
2005-09-14 15:38 ` loop: auto-load crypto module [PATCH] Ian Collier

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=1126703569.331.30.camel@imp.csi.cam.ac.uk \
    --to=aia21@cam.ac.uk \
    --cc=Ian.Collier@comlab.ox.ac.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.