Le 29/04/2026 à 12:17, Erhard Furtner a écrit :
Greetings!
Getting this on my G4 DP on kernel v7.0.2 and v7.1-rc1 at running
fortify_kunit test:
[...]
KTAP version 1
1..1
KTAP version 1
# Subtest: fortify
# module: fortify_kunit
1..26
# fortify_test_known_sizes: EXPECTATION FAILED at lib/tests/
fortify_kunit.c:90
Expected ({ char *__p = (char *)(stack); size_t __ret =
(~(size_t)0); const size_t __p_size =
__builtin_dynamic_object_size(stack, 1); if (__p_size != (~(size_t)0) &&
__builtin_constant_p(*__p)) { size_t __p_len = __p_size - 1; if
(__builtin_constant_p(__p[__p_len]) && __p[__p_len] == '\0') __ret =
__builtin_strlen(__p); } __ret; }) == 5, but
({ char *__p = (char *)(stack); size_t __ret = (~(size_t)0);
const size_t __p_size = __builtin_dynamic_object_size(stack, 1); if
(__p_size != (~(size_t)0) && __builtin_constant_p(*__p)) { size_t
__p_len = __p_size - 1; if (__builtin_constant_p(__p[__p_len]) &&
__p[__p_len] == '\0') __ret = __builtin_strlen(__p); } __ret; }) ==
4294967295 (0xffffffff)
not ok 1 fortify_test_known_sizes
I have the same on QEMU with pmac32_defconfig + FORTITY + KUNIT ...
Apparently it is due to __builtin_constant_p(*__p) returning FALSE, if I
understand correctly it is expected that it returns TRUE.
This is with GCC 15.2
Christophe
ok 2 fortify_test_control_flow_split
ok 3 fortify_test_alloc_size_kmalloc_const
ok 4 fortify_test_alloc_size_kmalloc_dynamic
ok 5 fortify_test_alloc_size_vmalloc_const
ok 6 fortify_test_alloc_size_vmalloc_dynamic
ok 7 fortify_test_alloc_size_kvmalloc_const
ok 8 fortify_test_alloc_size_kvmalloc_dynamic
ok 9 fortify_test_alloc_size_devm_kmalloc_const
ok 10 fortify_test_alloc_size_devm_kmalloc_dynamic
ok 11 fortify_test_realloc_size
ok 12 fortify_test_strlen
ok 13 fortify_test_strnlen
ok 14 fortify_test_strcpy
ok 15 fortify_test_strncpy
ok 16 fortify_test_strscpy
ok 17 fortify_test_strcat
ok 18 fortify_test_strncat
ok 19 fortify_test_strlcat
ok 20 fortify_test_memcpy
ok 21 fortify_test_memmove
ok 22 fortify_test_memscan
ok 23 fortify_test_memchr
ok 24 fortify_test_memchr_inv
ok 25 fortify_test_memcmp
ok 26 fortify_test_kmemdup
# fortify: pass:25 fail:1 skip:0 total:26
# Totals: pass:25 fail:1 skip:0 total:26
Suppose this may be a ppc/BE specific test failure as I don't get it on
my Thinkpad T60 (x86).
Full dmesg and kernel .config available on request.
Greetings,
Erhard