<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/char/tpm, branch v6.13.6</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.13.6</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.13.6'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-02-17T10:36:43+00:00</updated>
<entry>
<title>tpm: Change to kvalloc() in eventlog/acpi.c</title>
<updated>2025-02-17T10:36:43+00:00</updated>
<author>
<name>Jarkko Sakkinen</name>
<email>jarkko@kernel.org</email>
</author>
<published>2024-12-27T15:39:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4c8bfe643bbd00b04ee8f9545ef33bf6a68c38db'/>
<id>urn:sha1:4c8bfe643bbd00b04ee8f9545ef33bf6a68c38db</id>
<content type='text'>
commit a3a860bc0fd6c07332e4911cf9a238d20de90173 upstream.

The following failure was reported on HPE ProLiant D320:

[   10.693310][    T1] tpm_tis STM0925:00: 2.0 TPM (device-id 0x3, rev-id 0)
[   10.848132][    T1] ------------[ cut here ]------------
[   10.853559][    T1] WARNING: CPU: 59 PID: 1 at mm/page_alloc.c:4727 __alloc_pages_noprof+0x2ca/0x330
[   10.862827][    T1] Modules linked in:
[   10.866671][    T1] CPU: 59 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.12.0-lp155.2.g52785e2-default #1 openSUSE Tumbleweed (unreleased) 588cd98293a7c9eba9013378d807364c088c9375
[   10.882741][    T1] Hardware name: HPE ProLiant DL320 Gen12/ProLiant DL320 Gen12, BIOS 1.20 10/28/2024
[   10.892170][    T1] RIP: 0010:__alloc_pages_noprof+0x2ca/0x330
[   10.898103][    T1] Code: 24 08 e9 4a fe ff ff e8 34 36 fa ff e9 88 fe ff ff 83 fe 0a 0f 86 b3 fd ff ff 80 3d 01 e7 ce 01 00 75 09 c6 05 f8 e6 ce 01 01 &lt;0f&gt; 0b 45 31 ff e9 e5 fe ff ff f7 c2 00 00 08 00 75 42 89 d9 80 e1
[   10.917750][    T1] RSP: 0000:ffffb7cf40077980 EFLAGS: 00010246
[   10.923777][    T1] RAX: 0000000000000000 RBX: 0000000000040cc0 RCX: 0000000000000000
[   10.931727][    T1] RDX: 0000000000000000 RSI: 000000000000000c RDI: 0000000000040cc0

The above transcript shows that ACPI pointed a 16 MiB buffer for the log
events because RSI maps to the 'order' parameter of __alloc_pages_noprof().
Address the bug by moving from devm_kmalloc() to devm_add_action() and
kvmalloc() and devm_add_action().

Suggested-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Cc: stable@vger.kernel.org # v2.6.16+
Fixes: 55a82ab3181b ("[PATCH] tpm: add bios measurement log")
Reported-by: Andy Liang &lt;andy.liang@hpe.com&gt;
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219495
Reviewed-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Reviewed-by: Stefan Berger &lt;stefanb@linux.ibm.com&gt;
Reviewed-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Tested-by: Andy Liang &lt;andy.liang@hpe.com&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Get rid of 'remove_new' relic from platform driver struct</title>
<updated>2024-12-01T23:12:43+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-12-01T23:12:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e70140ba0d2b1a30467d4af6bcfe761327b9ec95'/>
<id>urn:sha1:e70140ba0d2b1a30467d4af6bcfe761327b9ec95</id>
<content type='text'>
The continual trickle of small conversion patches is grating on me, and
is really not helping.  Just get rid of the 'remove_new' member
function, which is just an alias for the plain 'remove', and had a
comment to that effect:

  /*
   * .remove_new() is a relic from a prototype conversion of .remove().
   * New drivers are supposed to implement .remove(). Once all drivers are
   * converted to not use .remove_new any more, it will be dropped.
   */

This was just a tree-wide 'sed' script that replaced '.remove_new' with
'.remove', with some care taken to turn a subsequent tab into two tabs
to make things line up.

I did do some minimal manual whitespace adjustment for places that used
spaces to line things up.

Then I just removed the old (sic) .remove_new member function, and this
is the end result.  No more unnecessary conversion noise.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>tpm: atmel: Drop PPC64 specific MMIO setup</title>
<updated>2024-11-21T22:56:50+00:00</updated>
<author>
<name>Rob Herring (Arm)</name>
<email>robh@kernel.org</email>
</author>
<published>2024-11-06T18:17:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5578b4347bb5d5dfc8eeb8ee2eb8248658707d9b'/>
<id>urn:sha1:5578b4347bb5d5dfc8eeb8ee2eb8248658707d9b</id>
<content type='text'>
The PPC64 specific MMIO setup open codes DT address functions rather
than using standard address parsing functions. The open-coded version
fails to handle any address translation and is not endian safe.

I haven't found any evidence of what platform used this. The only thing
that turned up was a PPC405 platform, but that is 32-bit and PPC405
support is being removed as well. CONFIG_TCG_ATMEL is not enabled for
any powerpc config and never was. The support was added in 2005 and
hasn't been touched since.

Rather than try to modernize and fix this code, just remove it.

[jarkko: fixed couple of style issues reported by checkpatch.pl --strict
 and put offset into parentheses in the macro declarations.]
Signed-off-by: Rob Herring (Arm) &lt;robh@kernel.org&gt;
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
</content>
</entry>
<entry>
<title>char: tpm: cr50: Add new device/vendor ID 0x50666666</title>
<updated>2024-11-21T22:48:27+00:00</updated>
<author>
<name>Jett Rink</name>
<email>jettrink@chromium.org</email>
</author>
<published>2024-09-10T19:11:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2e1827de1b0f22b420c9446a3c94e6cce8eb4da4'/>
<id>urn:sha1:2e1827de1b0f22b420c9446a3c94e6cce8eb4da4</id>
<content type='text'>
Accept another DID:VID for the next generation Google TPM. This TPM
has the same Ti50 firmware and fulfills the same interface.

Suggested-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Signed-off-by: Jett Rink &lt;jettrink@chromium.org&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
</content>
</entry>
<entry>
<title>char: tpm: cr50: Move i2c locking to request/relinquish locality ops</title>
<updated>2024-11-21T22:48:27+00:00</updated>
<author>
<name>Jan Dabros</name>
<email>jsd@semihalf.com</email>
</author>
<published>2024-10-10T09:15:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=44637b0b40f47629ff78a73744755e6535e0970e'/>
<id>urn:sha1:44637b0b40f47629ff78a73744755e6535e0970e</id>
<content type='text'>
Move i2c locking primitives to request_locality and relinquish_locality
callbacks, what effectively blocks TPM bus for the whole duration of
logical TPM operation.

With this in place, cr50-equipped TPM may be shared with external CPUs -
assuming that underneath i2c controller driver is aware of this setup
(see i2c-designware-amdpsp as an example).

Signed-off-by: Jan Dabros &lt;jsd@semihalf.com&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
</content>
</entry>
<entry>
<title>char: tpm: cr50: Use generic request/relinquish locality ops</title>
<updated>2024-11-21T22:48:27+00:00</updated>
<author>
<name>Jan Dabros</name>
<email>jsd@semihalf.com</email>
</author>
<published>2024-10-10T09:15:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=932e3a5e1ea31712c91e6b4c64d0c7f675315ab4'/>
<id>urn:sha1:932e3a5e1ea31712c91e6b4c64d0c7f675315ab4</id>
<content type='text'>
Instead of using static functions tpm_cr50_request_locality and
tpm_cr50_release_locality register callbacks from tpm class chip-&gt;ops
created for this purpose.

Signed-off-by: Jan Dabros &lt;jsd@semihalf.com&gt;
Signed-off-by: Grzegorz Bernacki &lt;bernacki@chromium.org&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
</content>
</entry>
<entry>
<title>tpm: ibmvtpm: Set TPM_OPS_AUTO_STARTUP flag on driver</title>
<updated>2024-11-21T22:48:26+00:00</updated>
<author>
<name>Stefan Berger</name>
<email>stefanb@linux.ibm.com</email>
</author>
<published>2024-10-14T14:16:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=02e9bda80d66cdd53364b9b32166ac0be1ced58f'/>
<id>urn:sha1:02e9bda80d66cdd53364b9b32166ac0be1ced58f</id>
<content type='text'>
Set the TPM_OPS_AUTO_STARTUP on the driver so that the ibmvtpm driver now
uses tpm2_auto_startup and tpm1_auto_startup like many other drivers do.
Remove tpm_get_timeouts, tpm2_get_cc_attrs_tbl, and tpm2_sessions_init
calls from it since these will all be called in tpm2_auto_startup and
tpm1_auto_startup.

The exporting of the tpm2_session_init symbol was only necessary while the
ibmvtpm driver was calling this function. Since this is not the case
anymore, remove this symbol from being exported.

What is new for the ibmvtpm driver is that now tpm2_do_selftest and
tpm1_do_selftest will be called that send commands to the TPM to perform
or continue its selftest. However, the firmware should already have sent
these commands so that the TPM will not do much work at this time.

Signed-off-by: Stefan Berger &lt;stefanb@linux.ibm.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
</content>
</entry>
<entry>
<title>tpm: Disable TPM on tpm2_create_primary() failure</title>
<updated>2024-11-13T19:10:45+00:00</updated>
<author>
<name>Jarkko Sakkinen</name>
<email>jarkko@kernel.org</email>
</author>
<published>2024-11-13T18:35:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=423893fcbe7e9adc875bce4e55b9b25fc1424977'/>
<id>urn:sha1:423893fcbe7e9adc875bce4e55b9b25fc1424977</id>
<content type='text'>
The earlier bug fix misplaced the error-label when dealing with the
tpm2_create_primary() return value, which the original completely ignored.

Cc: stable@vger.kernel.org
Reported-by: Christoph Anton Mitterer &lt;calestyo@scientia.org&gt;
Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1087331
Fixes: cc7d8594342a ("tpm: Rollback tpm2_load_null()")
Signed-off-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
</content>
</entry>
<entry>
<title>tpm: Opt-in in disable PCR integrity protection</title>
<updated>2024-11-13T19:10:45+00:00</updated>
<author>
<name>Jarkko Sakkinen</name>
<email>jarkko@kernel.org</email>
</author>
<published>2024-11-13T05:54:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=27184f8905ba680f22abf1707fbed24036a67119'/>
<id>urn:sha1:27184f8905ba680f22abf1707fbed24036a67119</id>
<content type='text'>
The initial HMAC session feature added TPM bus encryption and/or integrity
protection to various in-kernel TPM operations. This can cause performance
bottlenecks with IMA, as it heavily utilizes PCR extend operations.

In order to mitigate this performance issue, introduce a kernel
command-line parameter to the TPM driver for disabling the integrity
protection for PCR extend operations (i.e. TPM2_PCR_Extend).

Cc: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Link: https://lore.kernel.org/linux-integrity/20241015193916.59964-1-zohar@linux.ibm.com/
Fixes: 6519fea6fd37 ("tpm: add hmac checks to tpm2_pcr_extend()")
Tested-by: Mimi Zohar &lt;zohar@linux.ibm.com&gt;
Co-developed-by: Roberto Sassu &lt;roberto.sassu@huawei.com&gt;
Signed-off-by: Roberto Sassu &lt;roberto.sassu@huawei.com&gt;
Co-developed-by: Mimi Zohar &lt;zohar@linux.ibm.com&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.ibm.com&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
</content>
</entry>
<entry>
<title>tpm: Lock TPM chip in tpm_pm_suspend() first</title>
<updated>2024-11-03T23:59:08+00:00</updated>
<author>
<name>Jarkko Sakkinen</name>
<email>jarkko@kernel.org</email>
</author>
<published>2024-10-31T00:16:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9265fed6db601ee2ec47577815387458ef4f047a'/>
<id>urn:sha1:9265fed6db601ee2ec47577815387458ef4f047a</id>
<content type='text'>
Setting TPM_CHIP_FLAG_SUSPENDED in the end of tpm_pm_suspend() can be racy
according, as this leaves window for tpm_hwrng_read() to be called while
the operation is in progress. The recent bug report gives also evidence of
this behaviour.

Aadress this by locking the TPM chip before checking any chip-&gt;flags both
in tpm_pm_suspend() and tpm_hwrng_read(). Move TPM_CHIP_FLAG_SUSPENDED
check inside tpm_get_random() so that it will be always checked only when
the lock is reserved.

Cc: stable@vger.kernel.org # v6.4+
Fixes: 99d464506255 ("tpm: Prevent hwrng from activating during resume")
Reported-by: Mike Seo &lt;mikeseohyungjin@gmail.com&gt;
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219383
Reviewed-by: Jerry Snitselaar &lt;jsnitsel@redhat.com&gt;
Tested-by: Mike Seo &lt;mikeseohyungjin@gmail.com&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
</content>
</entry>
</feed>
