<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/char/tpm, branch linux-5.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2019-07-14T06:09:47Z</updated>
<entry>
<title>tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM operations</title>
<updated>2019-07-14T06:09:47Z</updated>
<author>
<name>Vadim Sukhomlinov</name>
<email>sukhomlinov@google.com</email>
</author>
<published>2019-06-10T22:01:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a28f6c295dbed6795617fc8e2466c53f2d3b0181'/>
<id>urn:sha1:a28f6c295dbed6795617fc8e2466c53f2d3b0181</id>
<content type='text'>
commit db4d8cb9c9f2af71c4d087817160d866ed572cc9 upstream.

TPM 2.0 Shutdown involve sending TPM2_Shutdown to TPM chip and disabling
future TPM operations. TPM 1.2 behavior was different, future TPM
operations weren't disabled, causing rare issues. This patch ensures
that future TPM operations are disabled.

Fixes: d1bd4a792d39 ("tpm: Issue a TPM2_Shutdown for TPM2 devices.")
Cc: stable@vger.kernel.org
Signed-off-by: Vadim Sukhomlinov &lt;sukhomlinov@google.com&gt;
[dianders: resolved merge conflicts with mainline]
Signed-off-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tpm: Actually fail on TPM errors during "get random"</title>
<updated>2019-07-14T06:09:47Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2019-04-01T19:06:07Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=446daaf5d94a392c99e8a7fa48afb0dc472e701f'/>
<id>urn:sha1:446daaf5d94a392c99e8a7fa48afb0dc472e701f</id>
<content type='text'>
commit 782779b60faa2fc7ff609ac8ef938260fd792c0f upstream.

A "get random" may fail with a TPM error, but those codes were returned
as-is to the caller, which assumed the result was the number of bytes
that had been written to the target buffer, which could lead to a kernel
heap memory exposure and over-read.

This fixes tpm1_get_random() to mask positive TPM errors into -EIO, as
before.

[   18.092103] tpm tpm0: A TPM error (379) occurred attempting get random
[   18.092106] usercopy: Kernel memory exposure attempt detected from SLUB object 'kmalloc-64' (offset 0, size 379)!

Link: https://bugzilla.redhat.com/show_bug.cgi?id=1650989
Reported-by: Phil Baker &lt;baker1tex@gmail.com&gt;
Reported-by: Craig Robson &lt;craig@zhatt.com&gt;
Fixes: 7aee9c52d7ac ("tpm: tpm1: rewrite tpm1_get_random() using tpm_buf structure")
Cc: Laura Abbott &lt;labbott@redhat.com&gt;
Cc: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Cc: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Tested-by: Bartosz Szczepanek &lt;bsz@semihalf.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tpm: Fix the type of the return value in calc_tpm2_event_size()</title>
<updated>2019-04-08T22:58:54Z</updated>
<author>
<name>Yue Haibing</name>
<email>yuehaibing@huawei.com</email>
</author>
<published>2019-02-20T08:25:38Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b9d0a85d6b2e76630cfd4c475ee3af4109bfd87a'/>
<id>urn:sha1:b9d0a85d6b2e76630cfd4c475ee3af4109bfd87a</id>
<content type='text'>
calc_tpm2_event_size() has an invalid signature because
it returns a 'size_t' where as its signature says that
it returns 'int'.

Cc: &lt;stable@vger.kernel.org&gt;
Fixes: 4d23cc323cdb ("tpm: add securityfs support for TPM 2.0 firmware event log")
Suggested-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Yue Haibing &lt;yuehaibing@huawei.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: James Morris &lt;james.morris@microsoft.com&gt;
</content>
</entry>
<entry>
<title>tpm: fix an invalid condition in tpm_common_poll</title>
<updated>2019-04-08T22:58:53Z</updated>
<author>
<name>Tadeusz Struk</name>
<email>tadeusz.struk@intel.com</email>
</author>
<published>2019-03-27T18:32:38Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7110629263469b4664d00b38ef80a656eddf3637'/>
<id>urn:sha1:7110629263469b4664d00b38ef80a656eddf3637</id>
<content type='text'>
The poll condition should only check response_length,
because reads should only be issued if there is data to read.
The response_read flag only prevents double writes.
The problem was that the write set the response_read to false,
enqued a tpm job, and returned. Then application called poll
which checked the response_read flag and returned EPOLLIN.
Then the application called read, but got nothing.
After all that the async_work kicked in.
Added also mutex_lock around the poll check to prevent
other possible race conditions.

Fixes: 9488585b21bef0df12 ("tpm: add support for partial reads")
Reported-by: Mantas Mikulėnas &lt;grawity@gmail.com&gt;
Tested-by: Mantas Mikulėnas &lt;grawity@gmail.com&gt;
Signed-off-by: Tadeusz Struk &lt;tadeusz.struk@intel.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: James Morris &lt;james.morris@microsoft.com&gt;
</content>
</entry>
<entry>
<title>tpm: turn on TPM on suspend for TPM 1.x</title>
<updated>2019-04-08T22:58:52Z</updated>
<author>
<name>Jarkko Sakkinen</name>
<email>jarkko.sakkinen@linux.intel.com</email>
</author>
<published>2019-03-22T10:51:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e891db1a18bf11e02533ec2386b796cfd8d60666'/>
<id>urn:sha1:e891db1a18bf11e02533ec2386b796cfd8d60666</id>
<content type='text'>
tpm_chip_start/stop() should be also called for TPM 1.x devices on
suspend. Add that functionality back. Do not lock the chip because
it is unnecessary as there are no multiple threads using it when
doing the suspend.

Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
Reported-by: Paul Zimmerman &lt;pauldzim@gmail.com&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Tested-by: Domenico Andreoli &lt;domenico.andreoli@linux.com&gt;
Signed-off-by: James Morris &lt;james.morris@microsoft.com&gt;
</content>
</entry>
<entry>
<title>tpm/ppi: Enable submission of optional command parameter for PPI 1.3</title>
<updated>2019-02-13T07:48:53Z</updated>
<author>
<name>Stefan Berger</name>
<email>stefanb@linux.ibm.com</email>
</author>
<published>2019-01-17T17:41:35Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=50a81b60bfe075a0023670ff86558abd02536799'/>
<id>urn:sha1:50a81b60bfe075a0023670ff86558abd02536799</id>
<content type='text'>
This patch enables a user to specify the additional optional command
parameter by writing it into the request file:

   # echo "23 16" &gt; request
   # cat request
   23 16

For backwards compatibility:

If only 1 parameter is given then we assume this is the operation request
number.

   # echo "5" &gt; request
   # cat request
   5

Signed-off-by: Stefan Berger &lt;stefanb@linux.ibm.com&gt;
Tested-by: David Safford &lt;david.safford@ge.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>tpm/ppi: Possibly show command parameter if TPM PPI 1.3 is used</title>
<updated>2019-02-13T07:48:53Z</updated>
<author>
<name>Stefan Berger</name>
<email>stefanb@linux.ibm.com</email>
</author>
<published>2019-01-17T17:41:34Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8b60c79bcc102dba22da684c7e51e9bab1d44237'/>
<id>urn:sha1:8b60c79bcc102dba22da684c7e51e9bab1d44237</id>
<content type='text'>
TPM PPI 1.3 introduces an additional optional command parameter
that may be needed for some commands. Display the parameter if the
command requires such a parameter. Only command 23 needs one.

The PPI request file will show output like this then:

   # echo "23 16" &gt; request
   # cat request
   23 16

   # echo "5" &gt; request
   # cat request
   5

Signed-off-by: Stefan Berger &lt;stefanb@linux.ibm.com&gt;
Tested-by: David Safford &lt;david.safford@ge.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>tpm/ppi: Display up to 101 operations as define for version 1.3</title>
<updated>2019-02-13T07:48:53Z</updated>
<author>
<name>Stefan Berger</name>
<email>stefanb@linux.ibm.com</email>
</author>
<published>2019-01-17T17:41:33Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9d4023ed4db6e01ff50cb68d782202c2f50760ae'/>
<id>urn:sha1:9d4023ed4db6e01ff50cb68d782202c2f50760ae</id>
<content type='text'>
TPM PPI 1.3 defines operations up to number 101. We need to query up
to this number to show the user what the firmware implements.

Signed-off-by: Stefan Berger &lt;stefanb@linux.ibm.com&gt;
Tested-by: David Safford &lt;david.safford@ge.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>tpm/ppi: rename TPM_PPI_REVISION_ID to TPM_PPI_REVISION_ID_1</title>
<updated>2019-02-13T07:48:52Z</updated>
<author>
<name>Stefan Berger</name>
<email>stefanb@linux.ibm.com</email>
</author>
<published>2019-01-17T17:41:32Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=09fe1b42583d0275657b388ad8a67c081863d47d'/>
<id>urn:sha1:09fe1b42583d0275657b388ad8a67c081863d47d</id>
<content type='text'>
TPM PPI 1.3 introduces a function revision 2 for some functions. So,
rename the existing TPM_PPI_REVISION_ID to TPM_PPI_REVISION_ID_1.

Signed-off-by: Stefan Berger &lt;stefanb@linux.ibm.com&gt;
Tested-by: David Safford &lt;david.safford@ge.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>tpm/ppi: pass function revision ID to tpm_eval_dsm()</title>
<updated>2019-02-13T07:48:52Z</updated>
<author>
<name>Stefan Berger</name>
<email>stefanb@linux.ibm.com</email>
</author>
<published>2019-01-17T17:41:31Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=587bad77e9c6d73c49b4ce7996822628824ca30e'/>
<id>urn:sha1:587bad77e9c6d73c49b4ce7996822628824ca30e</id>
<content type='text'>
Since we will need to pass different function revision numbers
to tpm_eval_dsm, convert this function now to take the function revision
as an additional parameter.

Signed-off-by: Stefan Berger &lt;stefanb@linux.ibm.com&gt;
Tested-by: David Safford &lt;david.safford@ge.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
</content>
</entry>
</feed>
