Skip to content

Add __require_explicit_initialization and its first user

Kees Cook linux-doc linux-fsdevel linux-hardening lkml llvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Compiler Attributes: Add __require_explicit_initialization macroDocumentation/conf.py include/linux/compiler_attributes.h scripts/checkpatch.pl +1 more+15 -02 replies
2/2seq_file: Require explicit initialization of struct seq_operationsinclude/linux/seq_file.h+9 -49 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchMiguel OjedaNick DesaulniersNathan ChancellorGreg Kroah-Hartman
1/2A-b R-b R-b A-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH 0/2] Add __require_explicit_initialization and its first user

Hi!

As discussed in Ian's kobj_type::release series[1], this takes its first patch (to add __require_explicit_initialization), with Miguel's requested comment tweak (the attribute needs Clang 20 or later), along with a first user that needs no fix-ups first: seq_file's seq_operations callbacks, which are called without a NULL check. This will make the attribute available in v7.4-rc1, while the kobj_type fixes continue separately.

The annotation adds no warnings anywhere in the tree today that I could find across allmodconfig builds:

Clang 24.0.0git: x86_64, arm64, i386, arm, riscv, s390, loongarch, powerpc. GCC 16.2.0: x86_64, arm64, i386, arm, riscv, s390, m68k, mips, parisc,
sparc, loongarch, xtensa, arc, and openrisc.

Thanks!

-Kees

[1] https://lore.kernel.org/all/[email protected]/

Ian Rogers (1):
Compiler Attributes: Add __require_explicit_initialization macro

Kees Cook (1):
seq_file: Require explicit initialization of struct seq_operations

 scripts/checkpatch.pl                 |  1 +
 Documentation/conf.py                 |  1 +
 include/linux/compiler_attributes.h   | 12 ++++++++++++
 include/linux/seq_file.h              | 13 +++++++++----
 tools/lib/python/kdoc/xforms_lists.py |  1 +
 5 files changed, 24 insertions(+), 4 deletions(-)
Signature · 1 line
2.55.0