From: Joe Perches <joe@perches.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Subject: Re: [git pull] vfs.git bits and pieces
Date: Wed, 20 Nov 2013 14:24:45 -0800 [thread overview]
Message-ID: <1384986285.2164.19.camel@joe-AO722> (raw)
In-Reply-To: <20131120221636.GH10323@ZenIV.linux.org.uk>
On Wed, 2013-11-20 at 22:16 +0000, Al Viro wrote:
> While digging in the same area:
>
> Wrong page freed on preallocate_pmds() failure exit
>
> Note that pmds[i] is simply uninitialized at that point...
> Granted, it's very hard to hit (you need split page locks
> *and* kmalloc(sizeof(spinlock_t), GFP_KERNEL) failing),
> but the code is obviously bogus.
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---
> diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
> index a7cccb6d..36aa999 100644
> --- a/arch/x86/mm/pgtable.c
> +++ b/arch/x86/mm/pgtable.c
> @@ -209,7 +209,7 @@ static int preallocate_pmds(pmd_t *pmds[])
> if (!pmd)
> failed = true;
> if (pmd && !pgtable_pmd_page_ctor(virt_to_page(pmd))) {
> - free_page((unsigned long)pmds[i]);
> + free_page((unsigned long)pmd);
> pmd = NULL;
> failed = true;
> }
trivia: It'd probably read better with an else too
if (!pmd) {
failed = true;
} else if (!pgtable_pmd_page_ctor(virt_to_page(pmd))) {
etc...
> --
> 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:[~2013-11-20 22:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-20 17:42 [git pull] vfs.git bits and pieces Al Viro
2013-11-20 17:47 ` Al Viro
2013-11-20 22:16 ` Al Viro
2013-11-20 22:24 ` Joe Perches [this message]
2013-11-20 22:33 ` Linus Torvalds
2013-11-20 22:40 ` Andrew Morton
2013-11-21 11:19 ` Kirill A. Shutemov
2013-11-20 22:42 ` Damien Wyart
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=1384986285.2164.19.camel@joe-AO722 \
--to=joe@perches.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).