[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 9 Sep 2022 03:48:08 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "sathyanarayanan.kuppuswamy@...ux.intel.com"
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"shuah@...nel.org" <shuah@...nel.org>,
"x86@...nel.org" <x86@...nel.org>, "bp@...en8.de" <bp@...en8.de>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"ak@...ux.intel.com" <ak@...ux.intel.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"wander@...hat.com" <wander@...hat.com>,
"tim.gardner@...onical.com" <tim.gardner@...onical.com>,
"hpa@...or.com" <hpa@...or.com>,
"isaku.yamahata@...il.com" <isaku.yamahata@...il.com>,
"kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
"Luck, Tony" <tony.luck@...el.com>,
"khalid.elmously@...onical.com" <khalid.elmously@...onical.com>,
"marcelo.cerri@...onical.com" <marcelo.cerri@...onical.com>,
"Cox, Philip" <philip.cox@...onical.com>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>
Subject: Re: [PATCH v12 2/3] selftests: tdx: Test TDX attestation GetReport
support
On Wed, 2022-09-07 at 17:27 -0700, Kuppuswamy Sathyanarayanan wrote:
> +TEST(verify_report)
> +{
> + __u8 reportdata[TDX_REPORTDATA_LEN];
> + struct tdreport tdreport;
> + struct tdx_report_req req;
> + int devfd, i;
> +
> + devfd = open(TDX_GUEST_DEVNAME, O_RDWR | O_SYNC);
> +
> + ASSERT_LT(0, devfd);
> +
> + /* Generate sample report data */
> + for (i = 0; i < TDX_REPORTDATA_LEN; i++)
> + reportdata[i] = i;
> +
> + /* Initialize IOCTL request */
> + req.subtype = 0;
> + req.reportdata = (__u64)reportdata;
> + req.rpd_len = TDX_REPORTDATA_LEN;
> + req.tdreport = (__u64)&tdreport;
> + req.tdr_len = sizeof(tdreport);
> +
'req' is a local variable, which isn't guaranteed to be zero. Looks you need to
explicitly clear 'req' otherwise the req.reserved[7] may not be zero.
--
Thanks,
-Kai
Powered by blists - more mailing lists