All of lore.kernel.org
 help / color / mirror / Atom feed
* [android-common:android17-6.18 1/1] kernel/bpf/stream.c:384:70: warning: diagnostic behavior may be improved by adding the 'format(printf, 2, 0)' attribute to the declaration of 'bpf_stream_vprintk_impl'
@ 2026-04-23  0:20 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-04-23  0:20 UTC (permalink / raw)
  To: cros-kernel-buildreports; +Cc: oe-kbuild-all

Hi Mykyta,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://android.googlesource.com/kernel/common android17-6.18
head:   d847e03df243cdbc643c9f57cb5b0712286d5a39
commit: 137cc92ffe2e71705fce112656a460d924934ebe [1/1] bpf: add _impl suffix for bpf_stream_vprintk() kfunc
config: arm64-randconfig-001-20260422 (https://download.01.org/0day-ci/archive/20260423/202604230831.vIPGQrir-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 5bac06718f502014fade905512f1d26d578a18f3)
rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260423/202604230831.vIPGQrir-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
| Fixes: 137cc92ffe2e ("bpf: add _impl suffix for bpf_stream_vprintk() kfunc")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202604230831.vIPGQrir-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> kernel/bpf/stream.c:384:70: warning: diagnostic behavior may be improved by adding the 'format(printf, 2, 0)' attribute to the declaration of 'bpf_stream_vprintk_impl' [-Wmissing-format-attribute]
     358 |         ret = bstr_printf(data.buf, MAX_BPRINTF_BUF, fmt__str, data.bin_args);
         |                                                                             ^
   kernel/bpf/stream.c:358:17: note: 'bpf_stream_vprintk_impl' declared here
     358 | __bpf_kfunc int bpf_stream_vprintk_impl(int stream_id, const char *fmt__str, const void *args,
         |                 ^
   1 warning generated.


vim +384 kernel/bpf/stream.c

5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  353  
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  354  /*
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  355   * Avoid using enum bpf_stream_id so that kfunc users don't have to pull in the
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  356   * enum in headers.
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  357   */
137cc92ffe2e717 Mykyta Yatsenko         2025-11-04  358  __bpf_kfunc int bpf_stream_vprintk_impl(int stream_id, const char *fmt__str, const void *args,
137cc92ffe2e717 Mykyta Yatsenko         2025-11-04  359  					u32 len__sz, void *aux__prog)
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  360  {
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  361  	struct bpf_bprintf_data data = {
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  362  		.get_bin_args	= true,
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  363  		.get_buf	= true,
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  364  	};
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  365  	struct bpf_prog_aux *aux = aux__prog;
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  366  	u32 fmt_size = strlen(fmt__str) + 1;
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  367  	struct bpf_stream *stream;
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  368  	u32 data_len = len__sz;
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  369  	int ret, num_args;
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  370  
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  371  	stream = bpf_stream_get(stream_id, aux);
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  372  	if (!stream)
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  373  		return -ENOENT;
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  374  
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  375  	if (data_len & 7 || data_len > MAX_BPRINTF_VARARGS * 8 ||
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  376  	    (data_len && !args))
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  377  		return -EINVAL;
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  378  	num_args = data_len / 8;
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  379  
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  380  	ret = bpf_bprintf_prepare(fmt__str, fmt_size, args, num_args, &data);
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  381  	if (ret < 0)
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  382  		return ret;
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  383  
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03 @384  	ret = bstr_printf(data.buf, MAX_BPRINTF_BUF, fmt__str, data.bin_args);
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  385  	/* Exclude NULL byte during push. */
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  386  	ret = bpf_stream_push_str(stream, data.buf, ret);
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  387  	bpf_bprintf_cleanup(&data);
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  388  
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  389  	return ret;
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  390  }
5ab154f1463a111 Kumar Kartikeya Dwivedi 2025-07-03  391  

:::::: The code at line 384 was first introduced by commit
:::::: 5ab154f1463a111e1dc8fd5d31eaa7a2a71fe2e6 bpf: Introduce BPF standard streams

:::::: TO: Kumar Kartikeya Dwivedi <memxor@gmail.com>
:::::: CC: Alexei Starovoitov <ast@kernel.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-04-23  0:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-23  0:20 [android-common:android17-6.18 1/1] kernel/bpf/stream.c:384:70: warning: diagnostic behavior may be improved by adding the 'format(printf, 2, 0)' attribute to the declaration of 'bpf_stream_vprintk_impl' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.