Skip to contentSkip to conversation

Issue with CONFIG_GCC_PLUGIN_RANDSTRUCT=y and out of tree modules..

kernel-hardening [email protected] 2 participants 2 messages Jul 25, 2017

lore
Share & tools
lore
#0 lore raw

I discovered the hard way that changing that config variable from n to y and then doing a 'make' of an out of tree module resulted in it not working.

Once I did a 'make clean', the next 'make' resulted in a working module. So I'm guessing that the kernel dependencies were too subtle for the 'make' to notice that the structures had changed logically, if not source code wise. Probably not fixable, but could probably use a line or two in the Kconfig help for the item.

I'll code a patch if that seems like a good idea...

#1 lore raw
Quoted 2 lines · On Mon, Jul 24, 2017 at 8:21 PM, <[email protected]> wrote:

I discovered the hard way that changing that config variable from n to y and then doing a 'make' of an out of tree module resulted in it not working.

Hm, I'd need to know more details, but normally switching out the gcc plugin config should trigger a full rebuild.

Quoted 7 lines

Once I did a 'make clean', the next 'make' resulted in a working module. So I'm guessing that the kernel dependencies were too subtle for the 'make' to notice that the structures had changed logically, if not source code wise. Probably not fixable, but could probably use a line or two in the Kconfig help for the item.

I'll code a patch if that seems like a good idea...

Yeah, "make clean" would fix it. If you see a solution for what you saw, yeah, send a patch. :)

Thanks!

-Kees

Signature · 2 lines
Kees Cook
Pixel Security