All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rik van Riel <riel@surriel.com>
To: Song Liu <songliubraving@fb.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	Kernel Team <Kernel-team@fb.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	Joerg Roedel <jroedel@suse.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Andy Lutomirski <luto@kernel.org>
Subject: Re: [PATCH v2] x86/mm/pti: in pti_clone_pgtable() don't increase addr by PUD_SIZE
Date: Tue, 20 Aug 2019 12:56:20 -0400	[thread overview]
Message-ID: <5a765e1bda8ec399a29dbdb195d15faa79c44273.camel@surriel.com> (raw)
In-Reply-To: <9A7CA4D3-76FB-479B-AC7A-FC3FD03B24DF@fb.com>

[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]

On Tue, 2019-08-20 at 10:00 -0400, Song Liu wrote:
> 
> From 9ae74cff4faf4710a11cb8da4c4a3f3404bd9fdd Mon Sep 17 00:00:00
> 2001
> From: Song Liu <songliubraving@fb.com>
> Date: Mon, 19 Aug 2019 23:59:47 -0700
> Subject: [PATCH] x86/mm/pti: in pti_clone_pgtable(), increase addr
> properly
> 
> Before 32-bit support, pti_clone_pmds() always adds PMD_SIZE to addr.
> This behavior changes after the 32-bit support:  pti_clone_pgtable()
> increases addr by PUD_SIZE for pud_none(*pud) case, and increases
> addr by
> PMD_SIZE for pmd_none(*pmd) case. However, this is not accurate
> because
> addr may not be PUD_SIZE/PMD_SIZE aligned.
> 
> Fix this issue by properly rounding up addr to next PUD_SIZE/PMD_SIZE
> in these two cases.
> 
> Cc: stable@vger.kernel.org # v4.19+
> Fixes: 16a3fe634f6a ("x86/mm/pti: Clone kernel-image on PTE level for
> 32 bit")
> Signed-off-by: Song Liu <songliubraving@fb.com>
> Cc: Joerg Roedel <jroedel@suse.de>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Andy Lutomirski <luto@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>

This looks like it should do the trick!

Reviewed-by: Rik van Riel <riel@surriel.com>

-- 
All Rights Reversed.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-08-20 16:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20  7:51 [PATCH] x86/mm/pti: in pti_clone_pgtable() don't increase addr by PUD_SIZE Song Liu
2019-08-20  9:12 ` Thomas Gleixner
2019-08-20  9:12   ` Thomas Gleixner
2019-08-20 13:17   ` Song Liu
2019-08-20 10:00 ` Peter Zijlstra
2019-08-20 11:16   ` Thomas Gleixner
2019-08-20 11:16     ` Thomas Gleixner
2019-08-20 13:21     ` Song Liu
2019-08-20 13:39       ` Thomas Gleixner
2019-08-20 13:39         ` Thomas Gleixner
2019-08-20 13:55       ` Rik van Riel
2019-08-20 14:00         ` Song Liu
2019-08-20 16:56           ` Rik van Riel [this message]
2019-08-20 16:56             ` [PATCH v2] " Rik van Riel
2019-08-20 13:21     ` [PATCH] " Rik van Riel
2019-08-20 13:19   ` Song Liu
2019-08-20 13:57 ` Dave Hansen
2019-08-20 14:14   ` Song Liu
2019-08-20 14:18     ` Dave Hansen
2019-08-20 16:05       ` Song Liu
2019-08-20 16:38         ` Song Liu

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=5a765e1bda8ec399a29dbdb195d15faa79c44273.camel@surriel.com \
    --to=riel@surriel.com \
    --cc=Kernel-team@fb.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=songliubraving@fb.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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.