[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202601281655.n3QdrNZR-lkp@intel.com>
Date: Wed, 28 Jan 2026 16:26:28 +0100
From: kernel test robot <lkp@...el.com>
To: Feng Yang <yangfeng59949@....com>, ast@...nel.org, daniel@...earbox.net,
andrii@...nel.org, martin.lau@...ux.dev, eddyz87@...il.com,
song@...nel.org, yonghong.song@...ux.dev, john.fastabend@...il.com,
kpsingh@...nel.org, sdf@...ichev.me, haoluo@...gle.com,
jolsa@...nel.org
Cc: oe-kbuild-all@...ts.linux.dev, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next] bpf: Add the missing types in the logs
Hi Feng,
kernel test robot noticed the following build warnings:
[auto build test WARNING on bpf-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Feng-Yang/bpf-Add-the-missing-types-in-the-logs/20260128-170535
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/20260128085842.145057-1-yangfeng59949%40163.com
patch subject: [PATCH bpf-next] bpf: Add the missing types in the logs
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20260128/202601281655.n3QdrNZR-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260128/202601281655.n3QdrNZR-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601281655.n3QdrNZR-lkp@intel.com/
All warnings (new ones prefixed by >>):
kernel/bpf/log.c: In function 'reg_type_str':
>> kernel/bpf/log.c:476:59: warning: '%s' directive output may be truncated writing up to 13 bytes into a region of size between 8 and 64 [-Wformat-truncation=]
476 | snprintf(prefix, sizeof(prefix), "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
| ^~
kernel/bpf/log.c:476:9: note: 'snprintf' output between 1 and 178 bytes into a destination of size 64
476 | snprintf(prefix, sizeof(prefix), "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
477 | type & MEM_RDONLY ? "rdonly_" : "",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
478 | type & MEM_RINGBUF ? "ringbuf_" : "",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
479 | type & MEM_USER ? "user_" : "",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
480 | type & MEM_PERCPU ? "percpu_" : "",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
481 | type & MEM_RCU ? "rcu_" : "",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
482 | type & PTR_UNTRUSTED ? "untrusted_" : "",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
483 | type & PTR_TRUSTED ? "trusted_" : "",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
484 | type & MEM_UNINIT ? "uninit_" : "",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
485 | type & DYNPTR_TYPE_LOCAL ? "dynptr_local_" : "",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
486 | type & DYNPTR_TYPE_RINGBUF ? "dynptr_ringbuf_" : "",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
487 | type & MEM_FIXED_SIZE ? "fixed_size_" : "",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
488 | type & MEM_ALLOC ? "alloc_" : "",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
489 | type & NON_OWN_REF ? "non_own_ref_" : "",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
490 | type & DYNPTR_TYPE_SKB ? "dynptr_skb_" : "",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
491 | type & DYNPTR_TYPE_XDP ? "dynptr_xdp_" : "",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
492 | type & MEM_ALIGNED ? "aligned_" : "",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
493 | type & MEM_WRITE ? "write_" : "",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
494 | type & DYNPTR_TYPE_SKB_META ? "dynptr_skb_meta_" : "",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
495 | type & DYNPTR_TYPE_FILE ? "dynptr_file_" : ""
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
496 | );
| ~
vim +476 kernel/bpf/log.c
434
435 /* string representation of 'enum bpf_reg_type'
436 *
437 * Note that reg_type_str() can not appear more than once in a single verbose()
438 * statement.
439 */
440 const char *reg_type_str(struct bpf_verifier_env *env, enum bpf_reg_type type)
441 {
442 char postfix[16] = {0}, prefix[64] = {0};
443 static const char * const str[] = {
444 [NOT_INIT] = "?",
445 [SCALAR_VALUE] = "scalar",
446 [PTR_TO_CTX] = "ctx",
447 [CONST_PTR_TO_MAP] = "map_ptr",
448 [PTR_TO_MAP_VALUE] = "map_value",
449 [PTR_TO_STACK] = "fp",
450 [PTR_TO_PACKET] = "pkt",
451 [PTR_TO_PACKET_META] = "pkt_meta",
452 [PTR_TO_PACKET_END] = "pkt_end",
453 [PTR_TO_FLOW_KEYS] = "flow_keys",
454 [PTR_TO_SOCKET] = "sock",
455 [PTR_TO_SOCK_COMMON] = "sock_common",
456 [PTR_TO_TCP_SOCK] = "tcp_sock",
457 [PTR_TO_TP_BUFFER] = "tp_buffer",
458 [PTR_TO_XDP_SOCK] = "xdp_sock",
459 [PTR_TO_BTF_ID] = "ptr_",
460 [PTR_TO_MEM] = "mem",
461 [PTR_TO_ARENA] = "arena",
462 [PTR_TO_BUF] = "buf",
463 [PTR_TO_FUNC] = "func",
464 [PTR_TO_INSN] = "insn",
465 [PTR_TO_MAP_KEY] = "map_key",
466 [CONST_PTR_TO_DYNPTR] = "dynptr_ptr",
467 };
468
469 if (type & PTR_MAYBE_NULL) {
470 if (base_type(type) == PTR_TO_BTF_ID)
471 strscpy(postfix, "or_null_");
472 else
473 strscpy(postfix, "_or_null");
474 }
475
> 476 snprintf(prefix, sizeof(prefix), "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
477 type & MEM_RDONLY ? "rdonly_" : "",
478 type & MEM_RINGBUF ? "ringbuf_" : "",
479 type & MEM_USER ? "user_" : "",
480 type & MEM_PERCPU ? "percpu_" : "",
481 type & MEM_RCU ? "rcu_" : "",
482 type & PTR_UNTRUSTED ? "untrusted_" : "",
483 type & PTR_TRUSTED ? "trusted_" : "",
484 type & MEM_UNINIT ? "uninit_" : "",
485 type & DYNPTR_TYPE_LOCAL ? "dynptr_local_" : "",
486 type & DYNPTR_TYPE_RINGBUF ? "dynptr_ringbuf_" : "",
487 type & MEM_FIXED_SIZE ? "fixed_size_" : "",
488 type & MEM_ALLOC ? "alloc_" : "",
489 type & NON_OWN_REF ? "non_own_ref_" : "",
490 type & DYNPTR_TYPE_SKB ? "dynptr_skb_" : "",
491 type & DYNPTR_TYPE_XDP ? "dynptr_xdp_" : "",
492 type & MEM_ALIGNED ? "aligned_" : "",
493 type & MEM_WRITE ? "write_" : "",
494 type & DYNPTR_TYPE_SKB_META ? "dynptr_skb_meta_" : "",
495 type & DYNPTR_TYPE_FILE ? "dynptr_file_" : ""
496 );
497
498 snprintf(env->tmp_str_buf, TMP_STR_BUF_LEN, "%s%s%s",
499 prefix, str[base_type(type)], postfix);
500 return env->tmp_str_buf;
501 }
502
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists