From: Nicolas Schier Date: Wed, 14 Jan 2026 13:57:15 +0000 (+0100) Subject: fortify: Cleanup temp file also on non-successful exit X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f54ab83cb2a17071be70a80b94db6c36e597696;p=thirdparty%2Flinux.git 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 Closes: https://lore.kernel.org/linux-kbuild/20251112114725.287349-1-wangyuli@aosc.io/ Reviewed-by: Nathan Chancellor Reviewed-by: WangYuli Signed-off-by: Nicolas Schier Link: https://patch.msgid.link/20260114-fortify-improve-handling-of-tempfile-v2-2-63b86c4dbd0e@kernel.org Signed-off-by: Kees Cook --- diff --git a/lib/test_fortify/test_fortify.sh b/lib/test_fortify/test_fortify.sh index 368d07d9acbf7..ad6dd44fa31c0 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.