Re: WARNING: CPU: 27 PID: 7051 at lib/math/int_log.c:63 intlog2+0xaa/0xe0 at running int_log_kunit test (v6.15-rc1)

From: Kees Cook

Date: Wed Jan 07 2026 - 18:01:27 EST


On Tue, Jan 06, 2026 at 11:17:33PM +0100, Erhard Furtner wrote:
> Greetings!
>
> Still getting this warning on kernel v6.18.3 and v6.19-rc4 when running
> int_log_kunit test via modprobe on my systems (x86_64, x86, ppc). This dmesg
> is from my Intel Core Ultra 7 265F system:
>
> [...]
> KTAP version 1
> 1..1
> KTAP version 1
> # Subtest: math-int_log
> # module: int_log_kunit
> 1..2
> KTAP version 1
> # Subtest: intlog2_test
> ------------[ cut here ]------------
> 1
> WARNING: lib/math/int_log.c:63 at intlog2+0x59/0x70, CPU#16:

This is:

if (unlikely(value == 0)) {
WARN_ON(1);
return 0;
}


> [...]
> ? kthreads_online_cpu+0xf0/0xf0
> ? kthreads_online_cpu+0xf0/0xf0
> ret_from_fork_asm+0x11/0x20
> </TASK>
> ---[ end trace 0000000000000000 ]---
> ok 1 Log base 2 of 0

Whcih seems to be exactly what is being tested...

It seems like we have another case of needed to silence warnings under
kunit[1]. Alessandro and Peter, where does the linked series stand
currently?

-Kees

[1] https://lore.kernel.org/lkml/20250526132755.166150-1-acarmina@xxxxxxxxxx/

--
Kees Cook