]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/bpf: Fix up btf/invalid test for extended kind
authorAlan Maguire <alan.maguire@oracle.com>
Fri, 17 Apr 2026 14:30:21 +0000 (15:30 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 21 Apr 2026 00:52:48 +0000 (17:52 -0700)
With extended kinds, 32 becomes a valid (but not used)
BTF info kind value; fix up the test to check for the
"Invalid kind" rather than "Invalid btf_info" message.
Since all bits are used in BTF info, it is no longer
possible to craft an invalid BTF info value.  Use
127 (new maximum possible kind value).

Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Acked-by: Mykyta Yatsenko <yatsenko@meta.com>
Link: https://lore.kernel.org/r/20260417143023.1551481-5-alan.maguire@oracle.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/btf.c

index 054ecb6b1e9f1b8c6c0ef0bdaaabfa8e980d0ae7..0cc347e32db37f9b43b50dd9ee7f1053cfbc4078 100644 (file)
@@ -1924,11 +1924,11 @@ static struct btf_raw_test raw_tests[] = {
 },
 
 {
-       .descr = "invalid BTF_INFO",
+       .descr = "invalid BTF kind",
        .raw_types = {
                /* int */                               /* [1] */
                BTF_TYPE_INT_ENC(0, BTF_INT_SIGNED, 0, 32, 4),
-               BTF_TYPE_ENC(0, 0x20000000, 4),
+               BTF_TYPE_ENC(0, 0x7f000000, 4),
                BTF_END_RAW,
        },
        .str_sec = "",
@@ -1941,7 +1941,7 @@ static struct btf_raw_test raw_tests[] = {
        .value_type_id = 1,
        .max_entries = 4,
        .btf_load_err = true,
-       .err_str = "Invalid btf_info",
+       .err_str = "Invalid kind",
 },
 
 {