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] [day] [month] [year] [list]
Message-ID: <2145ca92-66f2-4411-7847-618a885c203b@intel.com>
Date:   Mon, 7 Nov 2022 05:26:27 -0800
From:   Dave Hansen <dave.hansen@...el.com>
To:     Borislav Petkov <bp@...en8.de>
Cc:     Dave Hansen <dave.hansen@...ux.intel.com>,
        linux-kernel@...r.kernel.org, linux-tip-commits@...r.kernel.org,
        "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        x86@...nel.org
Subject: Re: [tip: x86/urgent] x86/tdx: Prepare for using "INFO" call for a
 second purpose

On 11/6/22 11:50, Borislav Petkov wrote:
> On Sun, Nov 06, 2022 at 09:02:27AM -0800, Dave Hansen wrote:
>> It's fine for now, except that the naming on this:
>>
>> -	tdx_parse_tdinfo(&cc_mask);
>> +	cc_mask = tdx_parse_tdinfo();
>>
>> is a bit funky since tdx_parse_tdinfo() is doing a couple of things
> Yeah, that was the next thing that was bothering me.
> 
>> and will need to return a second item shortly.
> Well, then rename this one back to get_cc_mask() and have a new function
> return the second item?

That's doable.  It would look something like what I've attached for now.
 The only downside to this is making two tdx_module_call(TDX_GET_INFO...)
calls.  That seems a bit wasteful, but it's not the end of the world.
It would look something like the attached patch.

I kinda like the idea of making one tdx_module_call() and parsing it all
in one place.  The calls are kinda slow, but two of them versus one
isn't going to hurt anybody.

The other thing I considered was keeping a temporary 'struct
tdx_guest_info' structure or something, filling it one, and parsing it
in get_cc_mask() and attribute checking functions.  But, that seemed
like overkill.
View attachment "tdinfo.patch" of type "text/x-patch" (1739 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ