]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fortify: Cleanup temp file also on non-successful exit
authorNicolas Schier <nsc@kernel.org>
Wed, 14 Jan 2026 13:57:15 +0000 (14:57 +0100)
committerKees Cook <kees@kernel.org>
Thu, 15 Jan 2026 03:49:55 +0000 (19:49 -0800)
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>
lib/test_fortify/test_fortify.sh

index 368d07d9acbf737be376756b39def87f12f4e9bf..ad6dd44fa31c0ad3a063cd0caab3a4664f9f3f31 100644 (file)
@@ -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.