linux/tools
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
..
accounting SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00
arch tools/x86/kcpuid: Protect against faulty "max subleaf" values 2024-10-17 15:11:28 +02:00
bootconfig tools/bootconfig: fix fd leak in load_xbc_file() on fstat failure 2026-04-18 10:33:22 +02:00
bpf bpftool: Fix truncated netlink dumps 2026-03-04 07:19:52 -05:00
build tools build: Align warning options with perf 2025-10-19 16:21:42 +02:00
cgroup tools/cgroup/slabinfo.py: updated to work on current kernel 2021-04-23 14:42:40 -07:00
debugging tools: Fix "the the" in a message in kernel-chktaint 2021-06-13 17:01:17 -06:00
edid tools/edid: Move EDID data sets from Documentation/ 2020-02-19 04:10:32 -07:00
firewire treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
firmware Driver Core and debugfs changes for 5.3-rc1 2019-07-12 12:24:03 -07:00
gpio tools: gpio: fix debounce_period_us output of lsgpio 2023-06-21 15:59:12 +02:00
hv vmbus_testing: fix wrong python syntax for integer value comparison 2023-09-19 12:22:28 +02:00
iio tools/iio: Add memory allocation failure check for trigger_name 2024-10-17 15:11:52 +02:00
include tools/nolibc: make time_t robust if __kernel_old_time_t is missing in host headers 2025-10-19 16:21:31 +02:00
io_uring tools/io_uring/io_uring-cp: sync with liburing example 2021-08-13 08:58:11 -06:00
kvm/kvm_stat tools/kvm_stat: fix display of error when multiple processes are found 2022-08-11 13:07:51 +02:00
laptop change email address for Pali Rohár 2020-04-10 15:36:22 -07:00
leds .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
lib libperf build: Always place libperf includes first 2026-03-04 07:19:56 -05:00
memory-model tools/memory-model: Fix bug in lock.cat 2024-08-19 05:45:15 +02:00
objtool objtool: Stop UNRET validation on UD2 2025-05-02 07:44:37 +02:00
pci tools: PCI: Zero-initialize param 2021-08-05 11:01:30 +01:00
pcmcia .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
perf perf callchain: Fix srcline printing with inlines 2026-03-04 07:19:55 -05:00
power tools/power cpupower: Reset errno before strtoull() 2026-03-04 07:19:57 -05:00
rcu tools/rcu: Add drgn script to dump number of RCU callbacks 2021-05-10 15:39:19 -07:00
scripts tools: Override makefile ARCH variable if defined, but empty 2024-12-14 19:51:30 +01:00
spi spi: tools: Add include folder to .gitignore 2026-03-04 07:19:32 -05:00
testing selftests: mptcp: more stable simult_flows tests 2026-04-18 10:33:09 +02:00
thermal/tmon tools/thermal: Fix possible path truncations 2022-08-17 14:24:15 +02:00
time treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
tracing tracing/tools: Fix incorrcet short option in usage text for --threads 2025-12-07 06:09:32 +09:00
usb usbip: tools: Fix detach_port() invalid port error path 2024-11-08 16:25:54 +01:00
virtio tools/virtio: fix build 2024-03-01 13:21:52 +01:00
vm tools/vm/slabinfo-gnuplot: use "grep -E" instead of "egrep" 2022-12-08 11:28:42 +01:00
wmi treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
Makefile tracing/tools: Add the latency-collector to tools directory 2021-02-12 11:52:59 -05:00