diff options
author | Cédric Le Goater <clg@redhat.com> | 2023-12-21 09:09:57 +0100 |
---|---|---|
committer | Cédric Le Goater <clg@redhat.com> | 2024-01-05 21:25:20 +0100 |
commit | 6ba254801f6bc7f3ef68a6414f1b107237c7eb26 (patch) | |
tree | ab20ad2be22c0471210e1de42b65c852eba5b9b2 /scripts/qapi/parser.py | |
parent | 9353b6da430f90e47f352dbf6dc31120c8914da6 (diff) | |
download | qemu-6ba254801f6bc7f3ef68a6414f1b107237c7eb26.zip qemu-6ba254801f6bc7f3ef68a6414f1b107237c7eb26.tar.gz qemu-6ba254801f6bc7f3ef68a6414f1b107237c7eb26.tar.bz2 |
vfio/iommufd: Remove the use of stat() to check file existence
Using stat() before opening a file or a directory can lead to a
time-of-check to time-of-use (TOCTOU) filesystem race, which is
reported by coverity as a Security best practices violations. The
sequence could be replaced by open and fdopendir but it doesn't add
much in this case. Simply use opendir to avoid the race.
Fixes: CID 1531551
Signed-off-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Zhenzhong Duan <Zhenzhong.duan@intel.com>
Diffstat (limited to 'scripts/qapi/parser.py')
0 files changed, 0 insertions, 0 deletions