summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Schier <nsc@kernel.org>2026-01-14 16:57:15 +0300
committerKees Cook <kees@kernel.org>2026-01-15 06:49:55 +0300
commit9f54ab83cb2a17071be70a80b94db6c36e597696 (patch)
treea96bfd8fff375f30d1fedf8b496cf5179097eefe
parentccfe7d6251f4e140e6ebdc87a9ecb33d86e2019e (diff)
downloadlinux-9f54ab83cb2a17071be70a80b94db6c36e597696.tar.xz
fortify: Cleanup temp file also on non-successful exit
Ensure cleanup of test_fortify.sh's temporary file also on script interruption, or some common signals. Reported-by: WangYuli <wangyuli@aosc.io> Closes: https://lore.kernel.org/linux-kbuild/20251112114725.287349-1-wangyuli@aosc.io/ Reviewed-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: WangYuli <wangyuli@aosc.io> Signed-off-by: Nicolas Schier <nsc@kernel.org> Link: https://patch.msgid.link/20260114-fortify-improve-handling-of-tempfile-v2-2-63b86c4dbd0e@kernel.org Signed-off-by: Kees Cook <kees@kernel.org>
-rw-r--r--lib/test_fortify/test_fortify.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/test_fortify/test_fortify.sh b/lib/test_fortify/test_fortify.sh
index 368d07d9acbf..ad6dd44fa31c 100644
--- a/lib/test_fortify/test_fortify.sh
+++ b/lib/test_fortify/test_fortify.sh
@@ -29,7 +29,7 @@ shift
__cleanup() {
rm -f "$TMP"
}
-trap __cleanup EXIT
+trap __cleanup EXIT HUP INT QUIT TERM
# Function names in warnings are wrapped in backticks under UTF-8 locales.
# Run the commands with LANG=C so that grep output will not change.