linux/tools/bootconfig
Josh Law e76e88ddc9 tools/bootconfig: fix fd leak in load_xbc_file() on fstat failure
[ Upstream commit 3b2c2ab4ce ]

If fstat() fails after open() succeeds, the function returns without
closing the file descriptor. Also preserve errno across close(), since
close() may overwrite it before the error is returned.

Link: https://lore.kernel.org/all/20260318155847.78065-3-objecting@objecting.org/

Fixes: 950313ebf7 ("tools: bootconfig: Add bootconfig command")
Signed-off-by: Josh Law <objecting@objecting.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-04-18 10:33:22 +02:00
..
include/linux tools/bootconfig: Define memblock_free_ptr() to fix build error 2021-09-15 09:49:48 -07:00
samples tools/bootconfig: Support mixed value and subkey test cases 2021-06-10 13:41:26 -04:00
scripts tools/bootconfig: fix single & used for logical condition 2023-03-10 09:40:10 +01:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
main.c tools/bootconfig: fix fd leak in load_xbc_file() on fstat failure 2026-04-18 10:33:22 +02:00
Makefile bootconfig: Support O=<builddir> option 2020-03-03 17:38:42 -05:00
test-bootconfig.sh bootconfig: Fix testcase to increase max node 2023-03-30 12:47:47 +02:00