lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yc2Ps9npROL3znOi@zn.tnic>
Date:   Thu, 30 Dec 2021 11:53:39 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     "Kirill A. Shutemov" <kirill@...temov.name>
Cc:     "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        tglx@...utronix.de, mingo@...hat.com, dave.hansen@...el.com,
        luto@...nel.org, peterz@...radead.org,
        sathyanarayanan.kuppuswamy@...ux.intel.com, aarcange@...hat.com,
        ak@...ux.intel.com, dan.j.williams@...el.com, david@...hat.com,
        hpa@...or.com, jgross@...e.com, jmattson@...gle.com,
        joro@...tes.org, jpoimboe@...hat.com, knsathya@...nel.org,
        pbonzini@...hat.com, sdeep@...are.com, seanjc@...gle.com,
        tony.luck@...el.com, vkuznets@...hat.com, wanpengli@...cent.com,
        x86@...nel.org, linux-kernel@...r.kernel.org,
        Sean Christopherson <sean.j.christopherson@...el.com>
Subject: Re: [PATCH 04/26] x86/traps: Add #VE support for TDX guest

On Thu, Dec 30, 2021 at 11:05:00AM +0300, Kirill A. Shutemov wrote:
> Hm. Two sentance above the one you quoted describes (maybe badly? I donno)
> why #VE doesn't happen in entry paths. Maybe it's not clear it covers NMI
> entry path too.
> 
> What if I replace the paragraph with these two:
> 
> 	Kernel avoids #VEs during syscall gap and NMI entry code.

because? Explain why here.

>	Entry code
> 	paths do not access TD-shared memory, MMIO regions, use #VE triggering
> 	MSRs, instructions, or CPUID leaves that might generate #VE. Similarly,
> 	to page faults and breakpoints, #VEs are allowed in NMI handlers once
> 	kernel is ready to deal with nested NMIs.
> 
> 	During #VE delivery, all interrupts, including NMIs, are blocked until
> 	TDGETVEINFO is called. It prevents #VE nesting until kernel reads the VE
> 	info.

This alludes somewhat to the why above.

Now, I hear that TDX doesn't generate #VE anymore for the case where the
HV might have unmapped/made non-private the page which contains the NMI
entry code.

Explain that here too pls.

And then stick that text over exc_virtualization_exception() so that it
is clear what's going on and that it can be easily found.

And then you still need to deal with

"(and should eventually be a panic, as it is expected panic_on_oops is
set to 1 for TDX guests)."

You can say what is expected to be done by the TDX guest owner in some
how-to doc but if those expectations are not met, then the guest should
simply die. Not we expect this and hope that users will do it, but
actually enforce it.

> Commit message already has this:
> 
> 	Add basic infrastructure to handle any #VE which occurs in the kernel
> 	or userspace. Later patches will add handling for specific #VE
> 	scenarios.
> 
> I'm not sure what need to be changed.

That:

+ * Return True on success and False on failure.
+ */
+static bool tdx_virt_exception_user(struct pt_regs *regs, struct ve_info *ve)
+{
+       pr_warn("Unexpected #VE: %lld\n", ve->exit_reason);
+       return false;

Kill the wrong comment.

-- 
Regards/Gruss,
    Boris.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ