<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/char/tpm, branch linux-3.6.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.6.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.6.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2012-10-21T16:32:43Z</updated>
<entry>
<title>tpm: Propagate error from tpm_transmit to fix a timeout hang</title>
<updated>2012-10-21T16:32:43Z</updated>
<author>
<name>Peter Huewe</name>
</author>
<published>2012-09-27T14:09:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=561948de6498c5a59ebd59f6e383eec7d6d7afd7'/>
<id>urn:sha1:561948de6498c5a59ebd59f6e383eec7d6d7afd7</id>
<content type='text'>
commit abce9ac292e13da367bbd22c1f7669f988d931ac upstream.

tpm_write calls tpm_transmit without checking the return value and
assigns the return value unconditionally to chip-&gt;pending_data, even if
it's an error value.
This causes three bugs.

So if we write to /dev/tpm0 with a tpm_param_size bigger than
TPM_BUFSIZE=0x1000 (e.g. 0x100a)
and a bufsize also bigger than TPM_BUFSIZE (e.g. 0x100a)
tpm_transmit returns -E2BIG which is assigned to chip-&gt;pending_data as
-7, but tpm_write returns that TPM_BUFSIZE bytes have been successfully
been written to the TPM, altough this is not true (bug #1).

As we did write more than than TPM_BUFSIZE bytes but tpm_write reports
that only TPM_BUFSIZE bytes have been written the vfs tries to write
the remaining bytes (in this case 10 bytes) to the tpm device driver via
tpm_write which then blocks at

 /* cannot perform a write until the read has cleared
 either via tpm_read or a user_read_timer timeout */
 while (atomic_read(&amp;chip-&gt;data_pending) != 0)
	 msleep(TPM_TIMEOUT);

for 60 seconds, since data_pending is -7 and nobody is able to
read it (since tpm_read luckily checks if data_pending is greater than
0) (#bug 2).

After that the remaining bytes are written to the TPM which are
interpreted by the tpm as a normal command. (bug #3)
So if the last bytes of the command stream happen to be a e.g.
tpm_force_clear this gets accidentally sent to the TPM.

This patch fixes all three bugs, by propagating the error code of
tpm_write and returning -E2BIG if the input buffer is too big,
since the response from the tpm for a truncated value is bogus anyway.
Moreover it returns -EBUSY to userspace if there is a response ready to be
read.

Signed-off-by: Peter Huewe &lt;peter.huewe@infineon.com&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tpm_tis / PM: Fix unused function warning for CONFIG_PM_SLEEP</title>
<updated>2012-08-10T12:29:50Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2012-08-09T21:00:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=07368d32f1a67e797def08cf2ee3ea1647b204b6'/>
<id>urn:sha1:07368d32f1a67e797def08cf2ee3ea1647b204b6</id>
<content type='text'>
According to a compiler warning, the tpm_tis_resume() function is not
used for CONFIG_PM_SLEEP unset, so add a #ifdef to prevent it from
being built in that case.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security</title>
<updated>2012-07-24T01:49:06Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2012-07-24T01:49:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e05644e17e744315bce12b0948cdc36910b9a76e'/>
<id>urn:sha1:e05644e17e744315bce12b0948cdc36910b9a76e</id>
<content type='text'>
Pull security subsystem updates from James Morris:
 "Nothing groundbreaking for this kernel, just cleanups and fixes, and a
  couple of Smack enhancements."

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (21 commits)
  Smack: Maintainer Record
  Smack: don't show empty rules when /smack/load or /smack/load2 is read
  Smack: user access check bounds
  Smack: onlycap limits on CAP_MAC_ADMIN
  Smack: fix smack_new_inode bogosities
  ima: audit is compiled only when enabled
  ima: ima_initialized is set only if successful
  ima: add policy for pseudo fs
  ima: remove unused cleanup functions
  ima: free securityfs violations file
  ima: use full pathnames in measurement list
  security: Fix nommu build.
  samples: seccomp: add .gitignore for untracked executables
  tpm: check the chip reference before using it
  TPM: fix memleak when register hardware fails
  TPM: chip disabled state erronously being reported as error
  MAINTAINERS: TPM maintainers' contacts update
  Merge branches 'next-queue' and 'next' into next
  Remove unused code from MPI library
  Revert "crypto: GnuPG based MPI lib - additional sources (part 4)"
  ...
</content>
</entry>
<entry>
<title>tpm_nsc: Use struct dev_pm_ops for power management</title>
<updated>2012-07-10T19:37:18Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2012-07-06T17:09:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ca9a2054fe041326888811a94f17459acab9f950'/>
<id>urn:sha1:ca9a2054fe041326888811a94f17459acab9f950</id>
<content type='text'>
Make the tpm_nsc driver define its PM callbacks through
a struct dev_pm_ops object rather than by using legacy PM hooks
in struct platform_driver.

This allows the driver to use tpm_pm_suspend() and tpm_pm_resume()
as its PM callbacks directly, without defining its own PM callback
routines.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>tpm_tis: Use struct dev_pm_ops for power management</title>
<updated>2012-07-10T19:37:11Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2012-07-06T17:09:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b633f0507e19224f1527921644722bfb36db9bb0'/>
<id>urn:sha1:b633f0507e19224f1527921644722bfb36db9bb0</id>
<content type='text'>
Make the tpm_tis driver define its PM callbacks through
a struct dev_pm_ops object rather than by using legacy PM hooks
in struct platform_driver.

This allows the driver to use tpm_pm_suspend() as its suspend
callback directly, without defining its own suspend callback
routine.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>tpm_atmel: Use struct dev_pm_ops for power management</title>
<updated>2012-07-10T19:37:02Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2012-07-06T17:09:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8324be05380be044df8b70cb4bfb0c0b50eec3e5'/>
<id>urn:sha1:8324be05380be044df8b70cb4bfb0c0b50eec3e5</id>
<content type='text'>
Make the tpm_atmel driver define its PM callbacks through
a struct dev_pm_ops object rather than by using legacy PM hooks
in struct platform_driver.

This allows the driver to use tpm_pm_suspend() and tpm_pm_resume()
as its PM callbacks directly, without defining its own PM callback
routines.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>PM / TPM: Drop unused pm_message_t argument from tpm_pm_suspend()</title>
<updated>2012-07-10T19:36:57Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2012-07-06T17:09:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=035e2ce8eb7412dbcb8522c19676a1dd52f3c024'/>
<id>urn:sha1:035e2ce8eb7412dbcb8522c19676a1dd52f3c024</id>
<content type='text'>
The tpm_pm_suspend()'s second argument of type pm_message_t is not
used, so remove it.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>tpm: check the chip reference before using it</title>
<updated>2012-06-12T21:53:51Z</updated>
<author>
<name>Andi Shyti</name>
</author>
<published>2012-05-28T16:42:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3072928ff2457642af0da745b88f0420b4596c48'/>
<id>urn:sha1:3072928ff2457642af0da745b88f0420b4596c48</id>
<content type='text'>
If a driver calls tpm_dev_vendor_release for a device already released
then the driver will oops.

Signed-off-by: Andi Shyti &lt;andi.shyti@gmail.com&gt;
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: Rajiv Andrade &lt;srajiv@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>TPM: fix memleak when register hardware fails</title>
<updated>2012-06-12T21:53:50Z</updated>
<author>
<name>Wanlong Gao</name>
</author>
<published>2012-05-16T08:24:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dad79cb89254ce646906846b0f0cf7995d626710'/>
<id>urn:sha1:dad79cb89254ce646906846b0f0cf7995d626710</id>
<content type='text'>
Adding proper kfree() before returning.

Signed-off-by: Wanlong Gao &lt;gaowanlong@cn.fujitsu.com&gt;
Signed-off-by: Rajiv Andrade &lt;srajiv@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>TPM: chip disabled state erronously being reported as error</title>
<updated>2012-06-12T21:53:49Z</updated>
<author>
<name>Rajiv Andrade</name>
</author>
<published>2012-04-24T20:38:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=24ebe6670de3d1f0dca11c9eb372134c7ab05503'/>
<id>urn:sha1:24ebe6670de3d1f0dca11c9eb372134c7ab05503</id>
<content type='text'>
tpm_do_selftest() attempts to read a PCR in order to
decide if one can rely on the TPM being used or not.
The function that's used by __tpm_pcr_read() does not
expect the TPM to be disabled or deactivated, and if so,
reports an error.

It's fine if the TPM returns this error when trying to
use it for the first time after a power cycle, but it's
definitely not if it already returned success for a
previous attempt to read one of its PCRs.

The tpm_do_selftest() was modified so that the driver only
reports this return code as an error when it really is.

Reported-and-tested-by: Paul Bolle &lt;pebolle@tiscali.nl&gt;
Cc: Stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Rajiv Andrade &lt;srajiv@linux.vnet.ibm.com&gt;
</content>
</entry>
</feed>
