mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	tglx@linutronix.de, mingo@redhat.com, bp@alien8.de
Cc: decui@microsoft.com, rick.p.edgecombe@intel.com,
	sathyanarayanan.kuppuswamy@linux.intel.com, seanjc@google.com,
	thomas.lendacky@amd.com, x86@kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCHv2 2/3] x86/tdx: Fix race between set_memory_encrypted() and load_unaligned_zeropad()
Date: Mon, 5 Jun 2023 16:13:45 -0700	[thread overview]
Message-ID: <7e0e7074-4bc7-3f39-27df-623448044c72@intel.com> (raw)
In-Reply-To: <20230526120225.31936-3-kirill.shutemov@linux.intel.com>

On 5/26/23 05:02, Kirill A. Shutemov wrote:
> Touching privately mapped GPA that is not properly converted to private
> with MapGPA and accepted leads to unrecoverable exit to VMM.
> 
> load_unaligned_zeropad() can touch memory that is not owned by the
> caller, but just happened to next after the owned memory.
> This load_unaligned_zeropad() behaviour makes it important when kernel
> asks VMM to convert a GPA from shared to private or back. Kernel must
> never have a page mapped into direct mapping (and aliases) as private
> when the GPA is already converted to shared or when GPA is not yet
> converted to private.
> 
> guest.enc_status_change_prepare() called before adjusting direct mapping
> and therefore it is responsible for converting the memory to private.
> 
> guest.enc_status_change_finish() called after adjusting direct mapping
> and it converts the memory to shared.
> 
> It is okay to have a shared mapping of memory that is not converted
> properly. handle_mmio() knows how to deal with load_unaligned_zeropad()
> stepping on it.

Yeah, as other said, the changelog grammar here is a bit funky.  Can you
fix it up and resend, please?

  parent reply	other threads:[~2023-06-05 23:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-26 12:02 [PATCHv2 0/3] x86/tdx: Fix one more load_unaligned_zeropad() issue Kirill A. Shutemov
2023-05-26 12:02 ` [PATCHv2 1/3] x86/mm: Allow guest.enc_status_change_prepare() to fail Kirill A. Shutemov
2023-05-26 21:50   ` Sathyanarayanan Kuppuswamy
2023-05-26 12:02 ` [PATCHv2 2/3] x86/tdx: Fix race between set_memory_encrypted() and load_unaligned_zeropad() Kirill A. Shutemov
2023-05-26 22:10   ` Sathyanarayanan Kuppuswamy
2023-05-30  0:57     ` Kirill A. Shutemov
2023-05-30 12:57       ` Tom Lendacky
2023-05-30 13:22         ` Sathyanarayanan Kuppuswamy
     [not found]           ` <BYAPR21MB1688EF2A57E90FCE02B82F84D748A@BYAPR21MB1688.namprd21.prod.outlook.com>
2023-06-01 18:19             ` Tom Lendacky
2023-06-02 16:11               ` Michael Kelley (LINUX)
2023-06-02 17:05                 ` Tom Lendacky
2023-06-02 17:42                 ` Dave Hansen
2023-06-05 12:12                   ` Kirill A. Shutemov
2023-06-05 23:13   ` Dave Hansen [this message]
2023-05-26 12:02 ` [PATCHv2 3/3] x86/mm: Fix enc_status_change_finish_noop() Kirill A. Shutemov
2023-05-30 13:20   ` Sathyanarayanan Kuppuswamy

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=7e0e7074-4bc7-3f39-27df-623448044c72@intel.com \
    --to=dave.hansen@intel.com \
    --cc=bp@alien8.de \
    --cc=decui@microsoft.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=seanjc@google.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --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

all inboxes | Powered by JetHome®