aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/cdns3/cdns3-ti.c
diff options
context:
space:
mode:
authorJarkko Sakkinen <[email protected]>2024-10-31 00:16:09 +0000
committerJarkko Sakkinen <[email protected]>2024-11-03 23:59:08 +0000
commit9265fed6db601ee2ec47577815387458ef4f047a (patch)
tree80d52af37db72cf9eaf1ee80bb6aaa23580317e3 /drivers/usb/cdns3/cdns3-ti.c
parentMerge tag 'linux_kselftest-fixes-6.12-rc6' of git://git.kernel.org/pub/scm/li... (diff)
downloadkernel-9265fed6db601ee2ec47577815387458ef4f047a.tar.gz
kernel-9265fed6db601ee2ec47577815387458ef4f047a.zip
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. Cc: [email protected] # v6.4+ Fixes: 99d464506255 ("tpm: Prevent hwrng from activating during resume") Reported-by: Mike Seo <[email protected]> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219383 Reviewed-by: Jerry Snitselaar <[email protected]> Tested-by: Mike Seo <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-ti.c')
0 files changed, 0 insertions, 0 deletions