]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
api.c: Fix TOCTOU race cgroup_get_cg_type()
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Mon, 14 Feb 2022 15:11:56 +0000 (08:11 -0700)
committerTom Hromatka <tom.hromatka@oracle.com>
Mon, 14 Feb 2022 15:12:22 +0000 (08:12 -0700)
commiteeb88d746389418f2e91c9957a5ad7ba3cd9edc7
tree4895951b69f6b2f3253fc77f2838cdedf0d99f85
parent203eb13b217311635d3afb082f0234c2618b5504
api.c: Fix TOCTOU race cgroup_get_cg_type()

Fix a TOCTOU race condition, that checks for file existence versus file
open in cgroup_get_cg_type() by opening the file and check for errno for
file existence.

Reported-by: LGTM
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/api.c