| From bippy-5f407fcff5a0 Mon Sep 17 00:00:00 2001 |
| From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| To: <linux-cve-announce@vger.kernel.org> |
| Reply-to: <cve@kernel.org>, <linux-kernel@vger.kernel.org> |
| Subject: CVE-2024-53085: tpm: Lock TPM chip in tpm_pm_suspend() first |
| |
| Description |
| =========== |
| |
| In the Linux kernel, the following vulnerability has been resolved: |
| |
| tpm: Lock TPM chip in tpm_pm_suspend() first |
| |
| 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->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. |
| |
| The Linux kernel CVE team has assigned CVE-2024-53085 to this issue. |
| |
| |
| Affected and fixed versions |
| =========================== |
| |
| Issue introduced in 6.4 with commit 99d46450625590d410f86fe4660a5eff7d3b8343 and fixed in 6.6.64 with commit cfaf83501a0cbb104499c5b0892ee5ebde4e967f |
| Issue introduced in 6.4 with commit 99d46450625590d410f86fe4660a5eff7d3b8343 and fixed in 6.11.8 with commit bc203fe416abdd1c29da594565a7c3c4e979488e |
| Issue introduced in 6.4 with commit 99d46450625590d410f86fe4660a5eff7d3b8343 and fixed in 6.12 with commit 9265fed6db601ee2ec47577815387458ef4f047a |
| Issue introduced in 6.1.31 with commit 7cd46930b8bf37b84777410ac21bfdf1179021d5 |
| Issue introduced in 6.3.5 with commit eeda114c92c7b2db69878cdf27163750fd57cfe2 |
| |
| Please see https://www.kernel.org for a full list of currently supported |
| kernel versions by the kernel community. |
| |
| Unaffected versions might change over time as fixes are backported to |
| older supported kernel versions. The official CVE entry at |
| https://cve.org/CVERecord/?id=CVE-2024-53085 |
| will be updated if fixes are backported, please check that for the most |
| up to date information about this issue. |
| |
| |
| Affected files |
| ============== |
| |
| The file(s) affected by this issue are: |
| drivers/char/tpm/tpm-chip.c |
| drivers/char/tpm/tpm-interface.c |
| |
| |
| Mitigation |
| ========== |
| |
| The Linux kernel CVE team recommends that you update to the latest |
| stable kernel version for this, and many other bugfixes. Individual |
| changes are never tested alone, but rather are part of a larger kernel |
| release. Cherry-picking individual commits is not recommended or |
| supported by the Linux kernel community at all. If however, updating to |
| the latest release is impossible, the individual changes to resolve this |
| issue can be found at these commits: |
| https://git.kernel.org/stable/c/cfaf83501a0cbb104499c5b0892ee5ebde4e967f |
| https://git.kernel.org/stable/c/bc203fe416abdd1c29da594565a7c3c4e979488e |
| https://git.kernel.org/stable/c/9265fed6db601ee2ec47577815387458ef4f047a |