Subject: Re: [PATCH 01/14] bug/kunit: Core support for suppressing warning backtraces

From: Kees Cook <[email-masked]>
Date: Tue, 12 Mar 2024 15:00:58 -0700

On Tue, Mar 12, 2024 at 10:02:56AM -0700, Guenter Roeck wrote:
> Some unit tests intentionally trigger warning backtraces by passing
> bad parameters to API functions. Such unit tests typically check the
> return value from those calls, not the existence of the warning backtrace.
> 
> Such intentionally generated warning backtraces are neither desirable
> nor useful for a number of reasons.
> - They can result in overlooked real problems.
> - A warning that suddenly starts to show up in unit tests needs to be
>   investigated and has to be marked to be ignored, for example by
>   adjusting filter scripts. Such filters are ad-hoc because there is
>   no real standard format for warnings. On top of that, such filter
>   scripts would require constant maintenance.
> 
> One option to address problem would be to add messages such as "expected
> warning backtraces start / end here" to the kernel log.  However, that
> would again require filter scripts, it might result in missing real
> problematic warning backtraces triggered while the test is running, and
> the irrelevant backtrace(s) would still clog the kernel log.
> 
> Solve the problem by providing a means to identify and suppress specific
> warning backtraces while executing test code.
> 
> Cc: Dan Carpenter <[email-masked]>
> Cc: Daniel Diaz <[email-masked]>
> Cc: Naresh Kamboju <[email-masked]>
> Cc: Kees Cook <[email-masked]>
> Signed-off-by: Guenter Roeck <[email-masked]>

Yup, this looks fine to me.

Reviewed-by: Kees Cook <[email-masked]>

-- 
Kees Cook