|
| From: | Cédric Le Goater |
| Subject: | Re: [PATCH] vfio/iommufd: Remove the use of stat() to check file existence |
| Date: | Tue, 2 Jan 2024 09:10:56 +0100 |
| User-agent: | Mozilla Thunderbird |
On 12/21/23 09:09, Cédric Le Goater wrote:
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>
Applied to vfio-next. Thanks, C.
| [Prev in Thread] | Current Thread | [Next in Thread] |