From: Greg KH <gregkh@linuxfoundation.org>
To: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: stable-commits@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
stable@vger.kernel.org, Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH 4.17] x86/mm: Don't free P4D table when it is folded at runtime
Date: Mon, 2 Jul 2018 10:47:58 +0200 [thread overview]
Message-ID: <20180702084758.GA15228@kroah.com> (raw)
In-Reply-To: <20180702084536.29833-1-aryabinin@virtuozzo.com>
On Mon, Jul 02, 2018 at 11:45:36AM +0300, Andrey Ryabinin wrote:
> From: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Huh? I didn't write this patch.
>
> commit 0e311d237d7f3022b7dafb639b42541bfb42fe94 upstream.
>
> When the P4D page table layer is folded at runtime, the p4d_free()
> should do nothing, the same as in <asm-generic/pgtable-nop4d.h>.
>
> It seems this bug should cause double-free in efi_call_phys_epilog(),
> but I don't know how to trigger that code path, so I can't confirm that
> by testing.
>
> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
> Reviewed-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: stable@vger.kernel.org # 4.17
> Fixes: 98219dda2ab5 ("x86/mm: Fold p4d page table layer at runtime")
> Link: http://lkml.kernel.org/r/20180625102427.15015-1-aryabinin@virtuozzo.com
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
> ---
> arch/x86/include/asm/pgalloc.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/x86/include/asm/pgalloc.h b/arch/x86/include/asm/pgalloc.h
> index 263c142a6a6c..f65e9e1cea4c 100644
> --- a/arch/x86/include/asm/pgalloc.h
> +++ b/arch/x86/include/asm/pgalloc.h
> @@ -184,6 +184,9 @@ static inline p4d_t *p4d_alloc_one(struct mm_struct *mm, unsigned long addr)
>
> static inline void p4d_free(struct mm_struct *mm, p4d_t *p4d)
> {
> + if (!pgtable_l5_enabled)
> + return;
> +
Did you test build this patch?
Please do so, and be careful about author attribution, again, I did not
write this patch.
greg k-h
next prev parent reply other threads:[~2018-07-02 8:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180701143858.GA22410@kroah.com>
2018-07-02 8:45 ` [PATCH 4.17] x86/mm: Don't free P4D table when it is folded at runtime Andrey Ryabinin
2018-07-02 8:47 ` Greg KH [this message]
2018-07-02 9:01 ` Andrey Ryabinin
2018-07-02 8:48 ` [PATCH 4.17 v2] " Andrey Ryabinin
2018-07-02 9:15 ` Greg KH
2018-07-02 9:20 ` Andrey Ryabinin
2018-07-02 9:37 ` Greg KH
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=20180702084758.GA15228@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=aryabinin@virtuozzo.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=stable-commits@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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.