All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Arjan van de Ven <arjan@infradead.org>
Cc: linux-kernel@vger.kernel.org, Al Viro <viro@ZenIV.linux.org.uk>
Subject: Re: Kernel oops (bug) in fs/buffers.c:create_empty_buffers
Date: Sun, 6 Jul 2008 13:31:00 -0700	[thread overview]
Message-ID: <20080706133100.8d8ed269.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080706132302.5ca87f4f@infradead.org>

On Sun, 6 Jul 2008 13:23:02 -0700 Arjan van de Ven <arjan@infradead.org> wrote:

> Hi,
> 
> caught this one on kerneloops.org: 
> http://www.kerneloops.org/searchweek.php?search=create_empty_buffers
> 
> void create_empty_buffers(struct page *page,
>                         unsigned long blocksize, unsigned long b_state)
> {
>         struct buffer_head *bh, *head, *tail;
> 
>         head = alloc_page_buffers(page, blocksize, 1);
>         bh = head;
>         do {
>                 bh->b_state |= b_state;
>                 tail = bh;
>                 bh = bh->b_this_page;
>         } while (bh);
> 
> 
> turns out, alloc_page_buffers() can fail and return NULL (for AIO for
> example)... yet this code blindly dereferences the result, getting a
> predictable NULL pointer fault.
> 
> It's not directly clear what to do about... make this function return
> the failure to the caller?

isofs has a habit of returning impossible block sizes and the

	while ((offset -= size) >= 0) {

consequently loops zero times and alloc_page_buffers() returns null.

Someone was having a look at it - maybe Jan?

I assume that the kernloops.org records link back to the original
report somewhere but I can't find it?


  reply	other threads:[~2008-07-06 20:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-06 20:23 Kernel oops (bug) in fs/buffers.c:create_empty_buffers Arjan van de Ven
2008-07-06 20:31 ` Andrew Morton [this message]
2008-07-06 21:27   ` Arjan van de Ven
2008-07-09 22:46   ` Jan Kara

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=20080706133100.8d8ed269.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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.