<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/char/tpm, branch v4.0</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>tpm: fix call order in tpm-chip.c</title>
<updated>2015-03-06T21:35:49+00:00</updated>
<author>
<name>Jarkko Sakkinen</name>
<email>jarkko.sakkinen@linux.intel.com</email>
</author>
<published>2015-03-01T21:55:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=19913b6db3aa417d855318c9cf5b40fbc1f28e52'/>
<id>19913b6db3aa417d855318c9cf5b40fbc1f28e52</id>
<content type='text'>
- tpm_dev_add_device(): cdev_add() must be done before uevent is
  propagated in order to avoid races.
- tpm_chip_register(): tpm_dev_add_device() must be done as the
  last step before exposing device to the user space in order to
  avoid races.

In addition clarified description in tpm_chip_register().

Fixes: 313d21eeab92 ("tpm: device class for tpm")
Fixes: afb5abc262e9 ("tpm: two-phase chip management functions")

Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Reviewed-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- tpm_dev_add_device(): cdev_add() must be done before uevent is
  propagated in order to avoid races.
- tpm_chip_register(): tpm_dev_add_device() must be done as the
  last step before exposing device to the user space in order to
  avoid races.

In addition clarified description in tpm_chip_register().

Fixes: 313d21eeab92 ("tpm: device class for tpm")
Fixes: afb5abc262e9 ("tpm: two-phase chip management functions")

Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Reviewed-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tpm/ibmvtpm: Additional LE support for tpm_ibmvtpm_send</title>
<updated>2015-03-06T21:35:48+00:00</updated>
<author>
<name>jmlatten@linux.vnet.ibm.com</name>
<email>jmlatten@linux.vnet.ibm.com</email>
</author>
<published>2015-02-21T00:11:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=62dfd912ab3b5405b6fe72d0135c37e9648071f1'/>
<id>62dfd912ab3b5405b6fe72d0135c37e9648071f1</id>
<content type='text'>
Problem: When IMA and VTPM are both enabled in kernel config,
kernel hangs during bootup on LE OS.

Why?: IMA calls tpm_pcr_read() which results in tpm_ibmvtpm_send
and tpm_ibmtpm_recv getting called. A trace showed that
tpm_ibmtpm_recv was hanging.

Resolution: tpm_ibmtpm_recv was hanging because tpm_ibmvtpm_send
was sending CRQ message that probably did not make much sense
to phype because of Endianness. The fix below sends correctly
converted CRQ for LE. This was not caught before because it
seems IMA is not enabled by default in kernel config and
IMA exercises this particular code path in vtpm.

Tested with IMA and VTPM enabled in kernel config and VTPM
enabled on both a BE OS and a LE OS ppc64 lpar. This exercised
CRQ and TPM command code paths in vtpm.
Patch is against Peter's tpmdd tree on github which included
Vicky's previous vtpm le patches.

Signed-off-by: Joy Latten &lt;jmlatten@linux.vnet.ibm.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # eb71f8a5e33f: "Added Little Endian support to vtpm module"
Cc: &lt;stable@vger.kernel.org&gt;
Reviewed-by: Ashley Lai &lt;ashley@ahsleylai.com&gt;
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem: When IMA and VTPM are both enabled in kernel config,
kernel hangs during bootup on LE OS.

Why?: IMA calls tpm_pcr_read() which results in tpm_ibmvtpm_send
and tpm_ibmtpm_recv getting called. A trace showed that
tpm_ibmtpm_recv was hanging.

Resolution: tpm_ibmtpm_recv was hanging because tpm_ibmvtpm_send
was sending CRQ message that probably did not make much sense
to phype because of Endianness. The fix below sends correctly
converted CRQ for LE. This was not caught before because it
seems IMA is not enabled by default in kernel config and
IMA exercises this particular code path in vtpm.

Tested with IMA and VTPM enabled in kernel config and VTPM
enabled on both a BE OS and a LE OS ppc64 lpar. This exercised
CRQ and TPM command code paths in vtpm.
Patch is against Peter's tpmdd tree on github which included
Vicky's previous vtpm le patches.

Signed-off-by: Joy Latten &lt;jmlatten@linux.vnet.ibm.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # eb71f8a5e33f: "Added Little Endian support to vtpm module"
Cc: &lt;stable@vger.kernel.org&gt;
Reviewed-by: Ashley Lai &lt;ashley@ahsleylai.com&gt;
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Added Little Endian support to vtpm module</title>
<updated>2015-02-15T16:36:05+00:00</updated>
<author>
<name>honclo</name>
<email>honclo@imap.linux.ibm.com</email>
</author>
<published>2015-02-13T02:02:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=eb71f8a5e33fa1066fb92f0111ab366a341e1f6c'/>
<id>eb71f8a5e33fa1066fb92f0111ab366a341e1f6c</id>
<content type='text'>
The tpm_ibmvtpm module is affected by an unaligned access problem.
ibmvtpm_crq_get_version failed with rc=-4 during boot when vTPM is
enabled in Power partition, which supports both little endian and
big endian modes.

We added little endian support to fix this problem:
1) added cpu_to_be64 calls to ensure BE data is sent from an LE OS.
2) added be16_to_cpu and be32_to_cpu calls to make sure data received
   is in LE format on a LE OS.

Signed-off-by: Hon Ching(Vicky) Lo &lt;honclo@linux.vnet.ibm.com&gt;
Signed-off-by: Joy Latten &lt;jmlatten@linux.vnet.ibm.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
[phuewe: manually applied the patch :( ]
Reviewed-by: Ashley Lai &lt;ashley@ahsleylai.com&gt;
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The tpm_ibmvtpm module is affected by an unaligned access problem.
ibmvtpm_crq_get_version failed with rc=-4 during boot when vTPM is
enabled in Power partition, which supports both little endian and
big endian modes.

We added little endian support to fix this problem:
1) added cpu_to_be64 calls to ensure BE data is sent from an LE OS.
2) added be16_to_cpu and be32_to_cpu calls to make sure data received
   is in LE format on a LE OS.

Signed-off-by: Hon Ching(Vicky) Lo &lt;honclo@linux.vnet.ibm.com&gt;
Signed-off-by: Joy Latten &lt;jmlatten@linux.vnet.ibm.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
[phuewe: manually applied the patch :( ]
Reviewed-by: Ashley Lai &lt;ashley@ahsleylai.com&gt;
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tpm, tpm_tis: fix TPM 2.0 probing</title>
<updated>2015-02-15T15:59:15+00:00</updated>
<author>
<name>Jarkko Sakkinen</name>
<email>jarkko.sakkinen@linux.intel.com</email>
</author>
<published>2015-02-04T14:21:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4d5f2051cd24adc19a645e920344e05afe8d69b9'/>
<id>4d5f2051cd24adc19a645e920344e05afe8d69b9</id>
<content type='text'>
If during transmission system error was returned, the logic was to
incorrectly deduce that chip is a TPM 1.x chip. This patch fixes this
issue. Also, this patch changes probing so that message tag is used as the
measure for TPM 2.x, which should be much more stable. A separate function
called tpm2_probe() is encapsulated because it can be used with any
chipset.

Fixes: aec04cbdf723 ("tpm: TPM 2.0 FIFO Interface")
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Reviewed-by: Stefan Berger &lt;stefanb@linux.vnet.ibm.com&gt;
Reviewed-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If during transmission system error was returned, the logic was to
incorrectly deduce that chip is a TPM 1.x chip. This patch fixes this
issue. Also, this patch changes probing so that message tag is used as the
measure for TPM 2.x, which should be much more stable. A separate function
called tpm2_probe() is encapsulated because it can be used with any
chipset.

Fixes: aec04cbdf723 ("tpm: TPM 2.0 FIFO Interface")
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Reviewed-by: Stefan Berger &lt;stefanb@linux.vnet.ibm.com&gt;
Reviewed-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tpm: fix suspend/resume paths for TPM 2.0</title>
<updated>2015-02-15T15:56:49+00:00</updated>
<author>
<name>Jarkko Sakkinen</name>
<email>jarkko.sakkinen@linux.intel.com</email>
</author>
<published>2015-01-29T05:43:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=74d6b3ceaa17d111220c3f09f50f901bf955d7c8'/>
<id>74d6b3ceaa17d111220c3f09f50f901bf955d7c8</id>
<content type='text'>
Fixed suspend/resume paths for TPM 2.0 and consolidated all the
associated code to the tpm_pm_suspend() and tpm_pm_resume()
functions. Resume path should be handled by the firmware, i.e.
Startup(CLEAR) for hibernate and Startup(STATE) for suspend.

There might be some non-PC embedded devices in the future where
Startup() is not the handled by the FW but fixing the code for
those IMHO should be postponed until there is hardware available
to test the fixes although extra Startup in the driver code is
essentially a NOP.

Added Shutdown(CLEAR) to the remove paths of TIS and CRB drivers.
Changed tpm2_shutdown() to a void function because there isn't
much you can do except print an error message if this fails with
a system error.

Fixes: aec04cbdf723 ("tpm: TPM 2.0 FIFO Interface")
Fixes: 30fc8d138e91 ("tpm: TPM 2.0 CRB Interface")
[phuewe: both did send TPM_Shutdown on resume which 'disables' the TPM
and did not send TPM2_Shutdown on teardown which leads some TPM2.0 to
believe there was an attack (no TPM2_Shutdown = no orderly shutdown =
attack)]

Reported-by: Peter Hüwe &lt;PeterHuewe@gmx.de&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Tested-by: Scot Doyle &lt;lkml14@scotdoyle.com&gt;
Reviewed-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixed suspend/resume paths for TPM 2.0 and consolidated all the
associated code to the tpm_pm_suspend() and tpm_pm_resume()
functions. Resume path should be handled by the firmware, i.e.
Startup(CLEAR) for hibernate and Startup(STATE) for suspend.

There might be some non-PC embedded devices in the future where
Startup() is not the handled by the FW but fixing the code for
those IMHO should be postponed until there is hardware available
to test the fixes although extra Startup in the driver code is
essentially a NOP.

Added Shutdown(CLEAR) to the remove paths of TIS and CRB drivers.
Changed tpm2_shutdown() to a void function because there isn't
much you can do except print an error message if this fails with
a system error.

Fixes: aec04cbdf723 ("tpm: TPM 2.0 FIFO Interface")
Fixes: 30fc8d138e91 ("tpm: TPM 2.0 CRB Interface")
[phuewe: both did send TPM_Shutdown on resume which 'disables' the TPM
and did not send TPM2_Shutdown on teardown which leads some TPM2.0 to
believe there was an attack (no TPM2_Shutdown = no orderly shutdown =
attack)]

Reported-by: Peter Hüwe &lt;PeterHuewe@gmx.de&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Tested-by: Scot Doyle &lt;lkml14@scotdoyle.com&gt;
Reviewed-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tpm/tpm_tis: Add missing ifdef CONFIG_ACPI for pnp_acpi_device</title>
<updated>2015-01-22T02:37:33+00:00</updated>
<author>
<name>Peter Huewe</name>
<email>peterhuewe@gmx.de</email>
</author>
<published>2015-01-21T23:42:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=961be7ef6963806cb978ccd6acf6bf84b0c63346'/>
<id>961be7ef6963806cb978ccd6acf6bf84b0c63346</id>
<content type='text'>
This fixes a build failure if CONFIG_PNP is set but CONFIG_ACPI is not:
drivers/char/tpm/tpm_tis.c: In function ?tpm_tis_pnp_init?:
drivers/char/tpm/tpm_tis.c:912:45: error: invalid type argument of
?-&gt;? (have ?int?)
   acpi_dev_handle = pnp_acpi_device(pnp_dev)-&gt;handle;

If CONFIG_PNPACPI is not set pnp_acpi_device is defined as 0 and thus
accesing the handle is not possible.

Fixes: 0dc553652102 ("tpm: fix raciness of PPI interface lookup")
Reported-by: Jim Davis &lt;jim.epost@gmail.com&gt;
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: James Morris &lt;james.l.morris@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes a build failure if CONFIG_PNP is set but CONFIG_ACPI is not:
drivers/char/tpm/tpm_tis.c: In function ?tpm_tis_pnp_init?:
drivers/char/tpm/tpm_tis.c:912:45: error: invalid type argument of
?-&gt;? (have ?int?)
   acpi_dev_handle = pnp_acpi_device(pnp_dev)-&gt;handle;

If CONFIG_PNPACPI is not set pnp_acpi_device is defined as 0 and thus
accesing the handle is not possible.

Fixes: 0dc553652102 ("tpm: fix raciness of PPI interface lookup")
Reported-by: Jim Davis &lt;jim.epost@gmail.com&gt;
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: James Morris &lt;james.l.morris@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tpm: fix format string error in tpm-chip.c</title>
<updated>2015-01-20T20:28:36+00:00</updated>
<author>
<name>Jarkko Sakkinen</name>
<email>jarkko.sakkinen@linux.intel.com</email>
</author>
<published>2015-01-20T10:03:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=743410a03bbf110da8942a715cf1358344ecc281'/>
<id>743410a03bbf110da8942a715cf1358344ecc281</id>
<content type='text'>
dev_set_name() takes three arguments where the second argument is
a format string. This patch fixes the call accordingly in tpm-chip.c

Reported-by: kbuild test robot &lt;fengguang.wu@intel.com&gt;
Fixes: 313d21eeab92 ("tpm: device class for tpm")
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
dev_set_name() takes three arguments where the second argument is
a format string. This patch fixes the call accordingly in tpm-chip.c

Reported-by: kbuild test robot &lt;fengguang.wu@intel.com&gt;
Fixes: 313d21eeab92 ("tpm: device class for tpm")
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>char/tpm/tpm_crb: fix build error</title>
<updated>2015-01-19T19:46:50+00:00</updated>
<author>
<name>Jarkko Sakkinen</name>
<email>jarkko.sakkinen@linux.intel.com</email>
</author>
<published>2015-01-19T08:43:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=914309995ed5c6c737df4135ac5ba2b67cff194d'/>
<id>914309995ed5c6c737df4135ac5ba2b67cff194d</id>
<content type='text'>
SIMPLE_DEV_PM_OPS() was inside #ifdef CONFIG_PM_SLEEP.

Fixes: 30fc8d1 ("tpm: TPM 2.0 CRB Interface")
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SIMPLE_DEV_PM_OPS() was inside #ifdef CONFIG_PM_SLEEP.

Fixes: 30fc8d1 ("tpm: TPM 2.0 CRB Interface")
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>char/tpm: fixed white spaces coding style issues</title>
<updated>2015-01-18T13:26:49+00:00</updated>
<author>
<name>Bruno E O Meneguele</name>
<email>bmeneguele@gmail.com</email>
</author>
<published>2015-01-17T16:03:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3b09825dd8758a59c1a70e18df5bc8d04f8e5ced'/>
<id>3b09825dd8758a59c1a70e18df5bc8d04f8e5ced</id>
<content type='text'>
Fixed some coding style issues reported by checkpatch.

Signed-off-by: Bruno E O Meneguele &lt;bmeneguele@gmail.com&gt;
[phuewe: ported to latest code]
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixed some coding style issues reported by checkpatch.

Signed-off-by: Bruno E O Meneguele &lt;bmeneguele@gmail.com&gt;
[phuewe: ported to latest code]
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tpm/tpm_i2c_stm_st33: Change tpm_i2c_stm_st33.h to tpm_stm_st33.h</title>
<updated>2015-01-17T14:04:04+00:00</updated>
<author>
<name>Christophe Ricard</name>
<email>christophe.ricard@gmail.com</email>
</author>
<published>2015-01-13T22:13:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3eda7d0ea3a0365aa72a2007f9450f314d92f065'/>
<id>3eda7d0ea3a0365aa72a2007f9450f314d92f065</id>
<content type='text'>
include/linux/platform_data/tpm_i2c_stm_st33.h can be used by other st33
tpm device driver not using i2c protocol.

Reviewed-by: Jason Gunthorpe &lt;jason.gunthorpe@obsidianresearch.com&gt;
Signed-off-by: Christophe Ricard &lt;christophe-h.ricard@st.com&gt;
Reviewed-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
include/linux/platform_data/tpm_i2c_stm_st33.h can be used by other st33
tpm device driver not using i2c protocol.

Reviewed-by: Jason Gunthorpe &lt;jason.gunthorpe@obsidianresearch.com&gt;
Signed-off-by: Christophe Ricard &lt;christophe-h.ricard@st.com&gt;
Reviewed-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
