lkml.org 
[lkml]   [2021]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 19/42] x86/mm: Add support to validate memory when changing C-bit
On Thu, Nov 11, 2021 at 08:49:49AM -0600, Tom Lendacky wrote:
> 2032 => sizeof(ghcb->shared_buffer) ?

Or that.

> The idea is that a full snp_psc_desc structure is meant to fit completely in
> the shared_buffer area. So if there are no compile time checks, then the
> code on the HV side will need to ensure that the input doesn't cause the HV
> to access the structure outside of the shared_buffer area - which, IIRC, it
> does (think protect against a malicious guest), so the min_t() on the memcpy
> should be safe on the guest side.
>
> But given the snp_psc_desc is sized/meant to fit completely in the
> shared_buffer, a compile time check would be a good idea, too, right?

If the desc thing is meant to fit, then a compile-time check is also a
good way to express that intention. So yeah.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette

\
 
 \ /
  Last update: 2021-11-11 17:02    [W:0.146 / U:0.936 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site