linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Dan Williams <dan.j.williams@intel.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	X86 ML <x86@kernel.org>, Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Andi Kleen <ak@linux.intel.com>,
	Dave Hansen <dave.hansen@intel.com>,
	Andy Lutomirski <luto@amacapital.net>,
	Linux MM <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86/mm/64: Fix crash in remove_pagetable()
Date: Tue, 25 Apr 2017 20:53:34 +0200	[thread overview]
Message-ID: <20170425185333.3ecz46gn5ufy4bwi@gmail.com> (raw)
In-Reply-To: <CAPcyv4j6woeE7QfTVXEohh-kCbcFFJQmciMmgf5RDDWntM+P5w@mail.gmail.com>


* Dan Williams <dan.j.williams@intel.com> wrote:

> On Tue, Apr 25, 2017 at 2:25 AM, Kirill A. Shutemov
> <kirill.shutemov@linux.intel.com> wrote:
> > remove_pagetable() does page walk using p*d_page_vaddr() plus cast.
> > It's not canonical approach -- we usually use p*d_offset() for that.
> >
> > It works fine as long as all page table levels are present. We broke the
> > invariant by introducing folded p4d page table level.
> >
> > As result, remove_pagetable() interprets PMD as PUD and it leads to
> > crash:
> >
> >         BUG: unable to handle kernel paging request at ffff880300000000
> >         IP: memchr_inv+0x60/0x110
> >         PGD 317d067
> >         P4D 317d067
> >         PUD 3180067
> >         PMD 33f102067
> >         PTE 8000000300000060
> >
> > Let's fix this by using p*d_offset() instead of p*d_page_vaddr() for
> > page walk.
> >
> > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> > Reported-by: Dan Williams <dan.j.williams@intel.com>
> > Fixes: f2a6a7050109 ("x86: Convert the rest of the code to support p4d_t")
> 
> Thanks! This patch on top of tip/master passes a full run of the
> nvdimm regression suite.
> 
> Tested-by: Dan Williams <dan.j.williams@intel.com>

Does a re-application of:

  "x86/mm/gup: Switch GUP to the generic get_user_page_fast() implementation"

still work (which you can achive via 'git revert 6dd29b3df975'), or is that 
another breakage?

Thanks,

	Ingo

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-04-25 18:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25  9:25 Kirill A. Shutemov
2017-04-25 16:43 ` Dan Williams
2017-04-25 18:53   ` Ingo Molnar [this message]
2017-04-25 19:01     ` Dan Williams

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=20170425185333.3ecz46gn5ufy4bwi@gmail.com \
    --to=mingo@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=hpa@zytor.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@amacapital.net \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox