[PATCH 0/2] randstruct: fix container_of() false positives after __mptr removal
From: Kees Cook
Date: Thu Sep 03 2026 - 19:27:08 EST
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(-)
--
2.34.1