CVE-2023-54309: tpm: tpm_vtpm_proxy: fix a race condition in /dev/vtpmx creation
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
tpm: tpm_vtpm_proxy: fix a race condition in /dev/vtpmx creation
/dev/vtpmx is made visible before 'workqueue' is initialized, which can lead to a memory corruption in the worst case scenario.
Address this by initializing 'workqueue' as the very first step of the driver initialization.
The Linux kernel CVE team has assigned CVE-2023-54309 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.8 with commit 6f99612e250041a2402d3b1694bccb149cd424a4 and fixed in 4.14.322 with commit 509d21f1c4bb9d35d397fca3226165b156a7639f Issue introduced in 4.8 with commit 6f99612e250041a2402d3b1694bccb149cd424a4 and fixed in 4.19.291 with commit 04e8697d26613ccea760cf57eb20a5a27f788c0f Issue introduced in 4.8 with commit 6f99612e250041a2402d3b1694bccb149cd424a4 and fixed in 5.4.251 with commit 86b9820395f226b8f33cbae9599deebf8af1ce72 Issue introduced in 4.8 with commit 6f99612e250041a2402d3b1694bccb149cd424a4 and fixed in 5.10.188 with commit 9ff7fcb3a2ed0e9b895bb5b4c13872d584a8815b Issue introduced in 4.8 with commit 6f99612e250041a2402d3b1694bccb149cd424a4 and fixed in 5.15.121 with commit e08295290c53a3cf174c236721747a01b9550ae2 Issue introduced in 4.8 with commit 6f99612e250041a2402d3b1694bccb149cd424a4 and fixed in 6.1.40 with commit 99b998fb9d7d2d2d9dbb3e19db2d0ade02f5a604 Issue introduced in 4.8 with commit 6f99612e250041a2402d3b1694bccb149cd424a4 and fixed in 6.4.5 with commit 092db954e2c3c5ba6c0ce990c7da72cf8f3b9c51 Issue introduced in 4.8 with commit 6f99612e250041a2402d3b1694bccb149cd424a4 and fixed in 6.5 with commit f4032d615f90970d6c3ac1d9c0bce3351eb4445c
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-2023-54309
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_vtpm_proxy.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/509d21f1c4bb9d35d397fca3226165b156a7639f https://git.kernel.org/stable/c/04e8697d26613ccea760cf57eb20a5a27f788c0f https://git.kernel.org/stable/c/86b9820395f226b8f33cbae9599deebf8af1ce72 https://git.kernel.org/stable/c/9ff7fcb3a2ed0e9b895bb5b4c13872d584a8815b https://git.kernel.org/stable/c/e08295290c53a3cf174c236721747a01b9550ae2 https://git.kernel.org/stable/c/99b998fb9d7d2d2d9dbb3e19db2d0ade02f5a604 https://git.kernel.org/stable/c/092db954e2c3c5ba6c0ce990c7da72cf8f3b9c51 https://git.kernel.org/stable/c/f4032d615f90970d6c3ac1d9c0bce3351eb4445c