Skip to content

vsprintf: Add __printf attribute to where it's required

Andy Shevchenko linux-hardening linux-trace-kernel lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 6 repliesIn review
  2. v16 patches 11 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6seq_buf: Mark binary printing functions with __printf() attributeinclude/linux/seq_buf.h+2 -20 replies
2/6seq_file: Mark binary printing functions with __printf() attributeinclude/linux/seq_file.h+1 -00 replies
3/6tracing: Mark binary printing functions with __printf() attributeinclude/linux/trace.h include/linux/trace_seq.h kernel/trace/trace.c +1 more+18 -210 replies
4/6vsnprintf: Mark binary printing functions with __printf() attributeinclude/linux/string.h+2 -22 replies
5/6vsnprintf: Drop unused const char fmt * in va_format()lib/vsprintf.c+2 -20 replies
6/6vsnprintf: Silence false positive GCC warning for va_format()lib/vsprintf.c+5 -00 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPetr MladekKees Cook
SeriesR-b R-b
1/6
2/6
3/6
4/6
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/6] vsprintf: Add __printf attribute to where it's required

This whole series started from a simple fix (see the last patch) to make GCC (Debian 14.2.0-17) happy when compiling with make W=1 (note, that CONFIG_WERROR=y and all warnings break the build!) down to a rabbit hole.

However starting from v2 the last patch doesn't require the first part, I prefer still to have them since the functions, while being _binary_ printf()-like, are still printf()-like. It also puts in align the tracing stuff with the rest and fixes the wrong parameter value.

These first 4 patches are organised in a strict order and can't be reshuffled, otherwise it will produce a warnings in between.

I believe the best route for the series is printk tree with immutable tag or branch for the others.

Alternatively the first 4 patches can be applied first as they are pretty much straightforward. They also can be squashed to one (as the same topic behind), but it all is up to the respective maintainers.

In v2:
- split out patch 5 (Rasmus)
- rewritten the approach for the va_format() fix (Rasmus)
- amended tracing patch (removed a blank line and a __printf() in C file)

Andy Shevchenko (6):
seq_buf: Mark binary printing functions with __printf() attribute
seq_file: Mark binary printing functions with __printf() attribute
tracing: Mark binary printing functions with __printf() attribute
vsnprintf: Mark binary printing functions with __printf() attribute
vsnprintf: Drop unused const char fmt * in va_format()
vsnprintf: Silence false positive GCC warning for va_format()

 include/linux/seq_buf.h   |  4 ++--
 include/linux/seq_file.h  |  1 +
 include/linux/string.h    |  4 ++--
 include/linux/trace.h     |  4 ++--
 include/linux/trace_seq.h |  8 ++++----
 kernel/trace/trace.c      | 11 +++--------
 kernel/trace/trace.h      | 16 +++++++++-------
 lib/vsprintf.c            |  9 +++++++--
 8 files changed, 30 insertions(+), 27 deletions(-)
Signature · 1 line
2.47.2