Skip to content

randstruct: fix container_of() false positives after __mptr removal

Kees Cook linux-hardening lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2randstruct: fix container_of() false positives after __mptr removalscripts/gcc-plugins/randomize_layout_plugin.c+58 -30 replies
2/2randstruct: report bad casts as warnings rather than notesscripts/gcc-plugins/randomize_layout_plugin.c+1 -13 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] randstruct: fix container_of() false positives after __mptr removal

Hi,

The GCC randstruct implementation specifically keyed on the __mptr temp variable name. With that removed, we need to check via a struct walk or a void * cast (which is what Clang already does).

I'm hoping to get these into v7.3 before release, but I want to put this through -next for a bit first.

-Kees

Kees Cook (2):
randstruct: fix container_of() false positives after __mptr removal
randstruct: report bad casts as warnings rather than notes

 scripts/gcc-plugins/randomize_layout_plugin.c | 63 +++++++++++++++++--
 1 file changed, 59 insertions(+), 4 deletions(-)
Signature · 1 line
2.34.1