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]
Date:   Wed, 27 Apr 2022 17:57:57 +1200
From:   Kai Huang <kai.huang@...el.com>
To:     Isaku Yamahata <isaku.yamahata@...il.com>,
        Kuppuswamy Sathyanarayanan 
        <sathyanarayanan.kuppuswamy@...ux.intel.com>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
        "H . Peter Anvin" <hpa@...or.com>,
        "Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
        Tony Luck <tony.luck@...el.com>,
        Andi Kleen <ak@...ux.intel.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/3] x86/tdx: Add TDX Guest attestation interface
 driver

On Tue, 2022-04-26 at 22:45 -0700, Isaku Yamahata wrote:
> > + */
> > +long tdx_mcall_tdreport(void *data, void *reportdata)
> > +{
> > +	u64 ret;
> > +
> > +	/*
> > +	 * Check for a valid TDX guest to ensure this API is only
> > +	 * used by TDX guest platform. Also make sure "data" and
> > +	 * "reportdata" pointers are valid.
> > +	 */
> > +	if (!data || !reportdata ||
> > !cpu_feature_enabled(X86_FEATURE_TDX_GUEST))
> > +		return -EINVAL;
> > +
> > +	/*
> > +	 * Pass the physical address of user generated report data
> > +	 * and the physical address of output buffer to the TDX module
> > +	 * to generate the TD report. Generated data contains
> > +	 * measurements/configuration data of the TD guest. More info
> > +	 * about ABI can be found in TDX 1.0 Module specification, sec
> > +	 * titled "TDG.MR.REPORT".
> > +	 */
> > +	ret = __tdx_module_call(TDX_GET_REPORT, virt_to_phys(data),
> > +				virt_to_phys(reportdata), 0, 0, NULL);
> > +
> > +	if (ret)
> > +		return TDCALL_RETURN_CODE(ret);
> 
> Why is status code masked?
> 
> 
> > +
> > +	return 0;
> > +}
> > +EXPORT_SYMBOL_GPL(tdx_mcall_tdreport);
> 
> Can this function be put into attest.c. Instead, wecan export
> __tdx_module_call.

As we discussed, there's no need to export this anymore.

Btw, I even think we can move this function to attest.c so it can be static. 
Theoretically there should be no other caller of this except attest.c.  I
understand in this way we need to define TDX_GET_REPORT macro in attest.c but
this looks fine to me.  This function can even be removed, and we can call
__tdx_module_call() directly in attest.c.  This function literally doesn't do
anything meaningful more than __tdx_module_call(), instead, calling
__tdx_module_call() directly gives us more context, i.e., we can easily see the
buffer is allocated by kernel and passed to TDX module, etc.

-- 
Thanks,
-Kai


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ