Re: RANDSTRUCT structs need linux/compiler_types.h (Was: [nfsd4] potentially hardware breaking regression in 4.14-rc and 4.13.11)

From: Kees Cook
Date: Wed Feb 21 2018 - 19:12:40 EST


On Wed, Feb 21, 2018 at 3:24 PM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> On Wed, Feb 21, 2018 at 2:52 PM, Kees Cook <keescook@xxxxxxxxxxxx> wrote:
>>
>> I'll play with Linus's suggestion and see what we get.
>
> It may be just as well to just include <linux/compiler_types.h> from
> <linux/kconfig.h> and be done with it.

Hah, yeah, that would certainly solve it too. :)

> I do hate including unnecessary stuff because it makes builds slower,
> but kernel header files probably don't get much more core than
> <linux/compiler_types.h>.

It also has the benefit of not letting it "go wrong" in the first
place. (And the separate fix for nfs isn't needed...)

Do you want me to send the patch for this, or do you already have it
prepared? The body-fields I had prepared for the nfs were:

Reported-by: Patrick McLean <chutzpah@xxxxxxxxxx>
Reported-by: Maciej S. Szmigiero <mail@xxxxxxxxxxxxxxxxxxxxx>
Fixes: 3859a271a003 ("randstruct: Mark various structs for randomization")

-Kees

--
Kees Cook
Pixel Security