double_fget: warn about re-using file descriptors
commit7162b9ec99f71870ad0888d5c5031e3a83d332fc
authorDan Carpenter <dan.carpenter@linaro.org>
Mon, 29 Jan 2024 11:28:54 +0000 (29 14:28 +0300)
committerDan Carpenter <dan.carpenter@linaro.org>
Mon, 29 Jan 2024 11:28:54 +0000 (29 14:28 +0300)
treeb2b14bb6ebac2c4426265d5e50eb5994be23c7f0
parent53401b162f5297d01dbbcf76022892849ce90014
double_fget: warn about re-using file descriptors

The fget() and fdget() functions map file descriptors to a file.  However,
the user has control of that mapping so if we call fdget() twice, we might
get different files back.  It could lead to a TOCTOU (Time of Check Time of
Use) security bug.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
check_double_fget.c [new file with mode: 0644]
check_list.h
smatch.h