<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/crypto/ccp/psp-dev.c, branch linux-4.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-09-26T06:39:43Z</updated>
<entry>
<title>crypto: ccp - add timeout support in the SEV command</title>
<updated>2018-09-26T06:39:43Z</updated>
<author>
<name>Brijesh Singh</name>
</author>
<published>2018-08-15T21:11:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=52b7326483715cce64474aab0367e0428a59ae90'/>
<id>urn:sha1:52b7326483715cce64474aab0367e0428a59ae90</id>
<content type='text'>
commit 3702a0585e64d70d5bf73bf3e943b8d6005b72c1 upstream.

Currently, the CCP driver assumes that the SEV command issued to the PSP
will always return (i.e. it will never hang).  But recently, firmware bugs
have shown that a command can hang.  Since of the SEV commands are used
in probe routines, this can cause boot hangs and/or loss of virtualization
capabilities.

To protect against firmware bugs, add a timeout in the SEV command
execution flow.  If a command does not complete within the specified
timeout then return -ETIMEOUT and stop the driver from executing any
further commands since the state of the SEV firmware is unknown.

Cc: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Cc: Gary Hook &lt;Gary.Hook@amd.com&gt;
Cc: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
[Brijesh: Backported to 4.18..4.19 - offset change in few hunks]
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>crypto: ccp - Fix command completion detection race</title>
<updated>2018-08-17T19:03:48Z</updated>
<author>
<name>Tom Lendacky</name>
</author>
<published>2018-07-03T17:11:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f2ccfbe47112074bcaeeb11e61f9b51f354f33d9'/>
<id>urn:sha1:f2ccfbe47112074bcaeeb11e61f9b51f354f33d9</id>
<content type='text'>
commit f426d2b20f1cd63818873593031593e15c3db20b upstream.

The wait_event() function is used to detect command completion.  The
interrupt handler will set the wait condition variable when the interrupt
is triggered.  However, the variable used for wait_event() is initialized
after the command has been submitted, which can create a race condition
with the interrupt handler and result in the wait_event() never returning.
Move the initialization of the wait condition variable to just before
command submission.

Fixes: 200664d5237f ("crypto: ccp: Add Secure Encrypted Virtualization (SEV) command support")
Cc: &lt;stable@vger.kernel.org&gt; # 4.16.x-
Signed-off-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Reviewed-by: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Acked-by: Gary R Hook &lt;gary.hook@amd.com&gt;
Acked-by: Gary R Hook &lt;gary.hook@amd.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>crypto: ccp - Check for NULL PSP pointer at module unload</title>
<updated>2018-08-17T19:03:48Z</updated>
<author>
<name>Tom Lendacky</name>
</author>
<published>2018-07-26T14:37:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=93aff32d53fd3d1377414855f7275cab16fbb31e'/>
<id>urn:sha1:93aff32d53fd3d1377414855f7275cab16fbb31e</id>
<content type='text'>
commit afb31cd2d1a1bc3ca055fb2519ec4e9ab969ffe0 upstream.

Should the PSP initialization fail, the PSP data structure will be
freed and the value contained in the sp_device struct set to NULL.
At module unload, psp_dev_destroy() does not check if the pointer
value is NULL and will end up dereferencing a NULL pointer.

Add a pointer check of the psp_data field in the sp_device struct
in psp_dev_destroy() and return immediately if it is NULL.

Cc: &lt;stable@vger.kernel.org&gt; # 4.16.x-
Fixes: 2a6170dfe755 ("crypto: ccp: Add Platform Security Processor (PSP) device support")
Signed-off-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Acked-by: Gary R Hook &lt;gary.hook@amd.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>crypto: ccp - Add GET_ID SEV command</title>
<updated>2018-05-30T16:13:56Z</updated>
<author>
<name>Janakarajan Natarajan</name>
</author>
<published>2018-05-25T20:23:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0b3a830bb407dce79468a26f382260131b50b3c5'/>
<id>urn:sha1:0b3a830bb407dce79468a26f382260131b50b3c5</id>
<content type='text'>
The GET_ID command, added as of SEV API v0.16, allows the SEV firmware
to be queried about a unique CPU ID. This unique ID can then be used
to obtain the public certificate containing the Chip Endorsement Key
(CEK) public key signed by the AMD SEV Signing Key (ASK).

For more information please refer to "Section 5.12 GET_ID" of
https://support.amd.com/TechDocs/55766_SEV-KM%20API_Specification.pdf

Signed-off-by: Janakarajan Natarajan &lt;Janakarajan.Natarajan@amd.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: ccp - Add DOWNLOAD_FIRMWARE SEV command</title>
<updated>2018-05-30T16:13:54Z</updated>
<author>
<name>Janakarajan Natarajan</name>
</author>
<published>2018-05-25T20:23:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=edd303ff0e9ebc39118e633916278b5ca8558c30'/>
<id>urn:sha1:edd303ff0e9ebc39118e633916278b5ca8558c30</id>
<content type='text'>
The DOWNLOAD_FIRMWARE command, added as of SEV API v0.15, allows the OS
to install SEV firmware newer than the currently active SEV firmware.

For the new SEV firmware to be applied it must:
* Pass the validation test performed by the existing firmware.
* Be of the same build or a newer build compared to the existing firmware.

For more information please refer to "Section 5.11 DOWNLOAD_FIRMWARE" of
https://support.amd.com/TechDocs/55766_SEV-KM%20API_Specification.pdf

Signed-off-by: Janakarajan Natarajan &lt;Janakarajan.Natarajan@amd.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: ccp - Use memdup_user() rather than duplicating its implementation</title>
<updated>2018-03-16T15:33:29Z</updated>
<author>
<name>Markus Elfring</name>
</author>
<published>2018-03-05T12:50:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6c51ddddac46ab124a3f10fd17cf34979670c1ce'/>
<id>urn:sha1:6c51ddddac46ab124a3f10fd17cf34979670c1ce</id>
<content type='text'>
Reuse existing functionality from memdup_user() instead of keeping
duplicate source code.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring &lt;elfring@users.sourceforge.net&gt;
Reviewed-by: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Acked-by: Gary R Hook &lt;gary.hook@amd.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: ccp - Fix sparse, use plain integer as NULL pointer</title>
<updated>2018-03-02T16:37:11Z</updated>
<author>
<name>Brijesh Singh</name>
</author>
<published>2018-02-15T19:34:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e385b5b787c86ed16fb414139e7068395327a254'/>
<id>urn:sha1:e385b5b787c86ed16fb414139e7068395327a254</id>
<content type='text'>
Fix sparse warning: Using plain integer as NULL pointer. Replaces
assignment of 0 to pointer with NULL assignment.

Fixes: 200664d5237f (Add Secure Encrypted Virtualization ...)
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Cc: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Cc: Gary Hook &lt;gary.hook@amd.com&gt;
Cc: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Signed-off-by: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Acked-by: Gary R Hook &lt;gary.hook@amd.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: ccp: Implement SEV_PDH_CERT_EXPORT ioctl command</title>
<updated>2017-12-04T16:57:31Z</updated>
<author>
<name>Brijesh Singh</name>
</author>
<published>2017-12-04T16:57:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=76a2b524a4b1d6dc0f2421f9854a01d55d5e5436'/>
<id>urn:sha1:76a2b524a4b1d6dc0f2421f9854a01d55d5e5436</id>
<content type='text'>
The SEV_PDH_CERT_EXPORT command can be used to export the PDH and its
certificate chain. The command is defined in SEV spec section 5.10.

Cc: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Cc: "Radim Krčmář" &lt;rkrcmar@redhat.com&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Cc: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Cc: Gary Hook &lt;gary.hook@amd.com&gt;
Cc: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Cc: linux-crypto@vger.kernel.org
Cc: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Improvements-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Acked-by: Gary R Hook &lt;gary.hook@amd.com&gt;
</content>
</entry>
<entry>
<title>crypto: ccp: Implement SEV_PEK_CERT_IMPORT ioctl command</title>
<updated>2017-12-04T16:57:31Z</updated>
<author>
<name>Brijesh Singh</name>
</author>
<published>2017-12-04T16:57:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7360e4b14350a3a461645e0413ce58fbc8785fd8'/>
<id>urn:sha1:7360e4b14350a3a461645e0413ce58fbc8785fd8</id>
<content type='text'>
The SEV_PEK_CERT_IMPORT command can be used to import the signed PEK
certificate. The command is defined in SEV spec section 5.8.

Cc: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Cc: "Radim Krčmář" &lt;rkrcmar@redhat.com&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Cc: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Cc: Gary Hook &lt;gary.hook@amd.com&gt;
Cc: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Cc: linux-crypto@vger.kernel.org
Cc: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Improvements-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Acked-by: Gary R Hook &lt;gary.hook@amd.com&gt;
Reviewed-by: Borislav Petkov &lt;bp@suse.de&gt;
</content>
</entry>
<entry>
<title>crypto: ccp: Implement SEV_PEK_CSR ioctl command</title>
<updated>2017-12-04T16:57:31Z</updated>
<author>
<name>Brijesh Singh</name>
</author>
<published>2017-12-04T16:57:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e799035609e1526761aa2f896a974b233d04d36d'/>
<id>urn:sha1:e799035609e1526761aa2f896a974b233d04d36d</id>
<content type='text'>
The SEV_PEK_CSR command can be used to generate a PEK certificate
signing request. The command is defined in SEV spec section 5.7.

Cc: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Cc: "Radim Krčmář" &lt;rkrcmar@redhat.com&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Cc: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Cc: Gary Hook &lt;gary.hook@amd.com&gt;
Cc: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Cc: linux-crypto@vger.kernel.org
Cc: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Improvements-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Acked-by: Gary R Hook &lt;gary.hook@amd.com&gt;
</content>
</entry>
</feed>
