[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aYNN3aPIIQqrRbaB@smile.fi.intel.com>
Date: Wed, 4 Feb 2026 15:47:09 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Kees Cook <kees@...nel.org>, Petr Mladek <pmladek@...e.com>,
Arnd Bergmann <arnd@...db.de>, kernel test robot <lkp@...el.com>,
Alexei Starovoitov <alexei.starovoitov@...il.com>,
Andy Shevchenko <andy@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Bartosz Golaszewski <brgl@...nel.org>, linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org, bpf@...r.kernel.org
Subject: Re: [PATCH] vsnprintf: drop __printf() attributes on binary printing
functions
On Wed, Feb 04, 2026 at 02:26:23PM +0100, Arnd Bergmann wrote:
> The printf() format attributes are applied inconsistently for the binary
> printf helpers, which causes warnings for the bpf_trace code using
> them from functions that pass down format strings:
>
> kernel/trace/bpf_trace.c: In function '____bpf_trace_printk':
> kernel/trace/bpf_trace.c:377:9: error: function '____bpf_trace_printk' might be a candidate for 'gnu_printf' format attribute [-Werror=suggest-attribute=format]
> 377 | ret = bstr_printf(data.buf, MAX_BPRINTF_BUF, fmt, data.bin_args);
> | ^~~
>
> This can be addressed either by annotating all five callers in bpf code,
> or by removing the annotations on the callees that were added by Andy
> Shevchenko last year.
>
> As Alexei Starovoitov points out, there are no callers in C code that
> would benefit from the __printf attributes, the only users are in BPF
> code or in the do_trace_printk() helper that already checks the arguments.
>
> Drop all three of these annotations, reverting the earlierl commits that
> added these, in order to get a clean build with -Wsuggest-attribute=format.
Acked-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists