Re: [PATCH] lib/tests: Make FORTIFY_KUNIT_TEST depend on FORTIFY_SOURCE

From: Kees Cook
Date: Mon Jun 02 2025 - 14:12:07 EST


On Mon, Jun 02, 2025 at 04:51:44PM +0200, Geert Uytterhoeven wrote:
> When CONFIG_FORTIFY_SOURCE is not enabled, all fortify tests are
> skipped. Move this logic from run-time to config-time, to avoid people
> building and running tests that do not do anything.
>
> This basically reverts commit 1a78f8cb5daac774 ("fortify: Allow KUnit
> test to build without FORTIFY") in v6.9, which was v3 of commit
> a9dc8d0442294b42 ("fortify: Allow KUnit test to build without FORTIFY")
> in v6.5, which was quickly reverted in commit 5e2956ee46244ffb ("Revert
> "fortify: Allow KUnit test to build without FORTIFY"").

Same thing as for randstruct: I want the test to always be available. I
don't want 1a78f8cb5daac reverted.

-Kees

--
Kees Cook