Re: [kees:for-next/kspp 21/25] drivers/misc/lkdtm/stackleak.c:17:39: error: call to undeclared function 'stackleak_task_low_bound'; ISO C99 and later do not support implicit function declarations

From: Kees Cook
Date: Thu May 05 2022 - 12:25:47 EST


On Thu, May 05, 2022 at 01:45:37PM +0100, Mark Rutland wrote:
> Hi Kees,
>
> I hadn't realised the LKDTM STACKLEAK test could be built with
> CONFIG_STACKLEAK=n, and my rework of that depends upon helpers that only exist
> when CONFIG_STACKLEAK=y.
>
> IMO the test is nonsensical for CONFIG_STACKLEAK=n, and I reckon we should
> either:
>
> a) Not build the stackleak test at all when CONFIG_STACKLEAK=n
>
> b) Have a small stub that just logs that CONFIG_STACKLEAK=n and the test is
> being skipped.
>
> Do you have any preference between the two?

Since it's looking for a specific poison, it doesn't make sense to look
for this property as magically appearing (where as this kind of thing
sometimes exists for other tests: did the hypervisor block it instead of
the kernel, etc)

So, yeah, I'd wrap it in an ifdef with an else: XFAIL.

--
Kees Cook