From: Rik van Riel <riel@redhat.com>
To: Dave Hansen <dave@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
arunabal@in.ibm.com, sbest@us.ibm.com, stable <stable@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Christoph Hellwig <hch@lst.de>, Al Viro <viro@zeniv.linux.org.uk>,
Minchan Kim <minchan.kim@gmail.com>
Subject: Re: [PATCH] Revalidate page->mapping in do_generic_file_read()
Date: Thu, 04 Nov 2010 10:11:40 -0400 [thread overview]
Message-ID: <4CD2BF1C.10608@redhat.com> (raw)
In-Reply-To: <20101103220941.C88FA932@kernel.beaverton.ibm.com>
On 11/03/2010 06:09 PM, Dave Hansen wrote:
> 70 hours into some stress tests of a 2.6.32-based enterprise kernel,
> we ran into a NULL dereference in here:
>
> int block_is_partially_uptodate(struct page *page, read_descriptor_t *desc,
> unsigned long from)
> {
> ----> struct inode *inode = page->mapping->host;
>
> It looks like page->mapping was the culprit. (xmon trace is below).
> After closer examination, I realized that do_generic_file_read() does
> a find_get_page(), and eventually locks the page before calling
> block_is_partially_uptodate(). However, it doesn't revalidate the
> page->mapping after the page is locked. So, there's a small window
> between the find_get_page() and ->is_partially_uptodate() where the
> page could get truncated and page->mapping cleared.
>
> We _have_ a reference, so it can't get reclaimed, but it certainly
> can be truncated.
Acked-by: Rik van Riel <riel@redhat.com>
--
All rights reversed
WARNING: multiple messages have this Message-ID (diff)
From: Rik van Riel <riel@redhat.com>
To: Dave Hansen <dave@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
arunabal@in.ibm.com, sbest@us.ibm.com, stable <stable@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Christoph Hellwig <hch@lst.de>, Al Viro <viro@zeniv.linux.org.uk>,
Minchan Kim <minchan.kim@gmail.com>
Subject: Re: [PATCH] Revalidate page->mapping in do_generic_file_read()
Date: Thu, 04 Nov 2010 10:11:40 -0400 [thread overview]
Message-ID: <4CD2BF1C.10608@redhat.com> (raw)
In-Reply-To: <20101103220941.C88FA932@kernel.beaverton.ibm.com>
On 11/03/2010 06:09 PM, Dave Hansen wrote:
> 70 hours into some stress tests of a 2.6.32-based enterprise kernel,
> we ran into a NULL dereference in here:
>
> int block_is_partially_uptodate(struct page *page, read_descriptor_t *desc,
> unsigned long from)
> {
> ----> struct inode *inode = page->mapping->host;
>
> It looks like page->mapping was the culprit. (xmon trace is below).
> After closer examination, I realized that do_generic_file_read() does
> a find_get_page(), and eventually locks the page before calling
> block_is_partially_uptodate(). However, it doesn't revalidate the
> page->mapping after the page is locked. So, there's a small window
> between the find_get_page() and ->is_partially_uptodate() where the
> page could get truncated and page->mapping cleared.
>
> We _have_ a reference, so it can't get reclaimed, but it certainly
> can be truncated.
Acked-by: Rik van Riel <riel@redhat.com>
--
All rights reversed
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-11-04 14:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-03 22:09 [PATCH] Revalidate page->mapping in do_generic_file_read() Dave Hansen
2010-11-03 22:09 ` Dave Hansen
2010-11-03 22:48 ` Minchan Kim
2010-11-03 22:48 ` Minchan Kim
2010-11-04 13:54 ` Johannes Weiner
2010-11-04 13:54 ` Johannes Weiner
2010-11-04 14:11 ` Rik van Riel [this message]
2010-11-04 14:11 ` Rik van Riel
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=4CD2BF1C.10608@redhat.com \
--to=riel@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=arunabal@in.ibm.com \
--cc=dave@linux.vnet.ibm.com \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan.kim@gmail.com \
--cc=sbest@us.ibm.com \
--cc=stable@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.