Thread (96 messages) 96 messages, 7 authors, 2021-11-11

Re: [PATCH v6 19/42] x86/mm: Add support to validate memory when changing C-bit

From: Borislav Petkov <bp@alien8.de>
Date: 2021-11-11 16:01:25
Also in: kvm, linux-efi, linux-mm, lkml, platform-driver-x86

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help