]> git.proxmox.com Git - mirror_qemu.git/commit
tpm: fix crash when FD >= 1024 and unnecessary errors due to EINTR
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 11 Sep 2023 13:25:51 +0000 (17:25 +0400)
committerStefan Berger <stefanb@linux.ibm.com>
Wed, 13 Sep 2023 12:42:57 +0000 (08:42 -0400)
commit8e32ddff69b6b4547cc00592ad816484e160817a
treeb4220153766f115bd740988c3f168998b4ff9bc9
parent9ef497755afc252fb8e060c9ea6b0987abfd20b6
tpm: fix crash when FD >= 1024 and unnecessary errors due to EINTR

Replace select() with poll() to fix a crash when QEMU has a large number
of FDs. Also use RETRY_ON_EINTR to avoid unnecessary errors due to EINTR.

Cc: qemu-stable@nongnu.org
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2020133
Fixes: 56a3c24ffc ("tpm: Probe for connected TPM 1.2 or TPM 2")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
backends/tpm/tpm_util.c