[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5jJZtQ4AB+zwDq6sDCn95HrLTCE2maz5FNs0qZk50m51Lw@mail.gmail.com>
Date: Tue, 9 May 2017 09:12:51 -0700
From: Kees Cook <keescook@...omium.org>
To: David Howells <dhowells@...hat.com>
Cc: James Morris <james.l.morris@...cle.com>,
"Serge E. Hallyn" <serge@...lyn.com>, keyrings@...r.kernel.org,
linux-security-module <linux-security-module@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] key: Convert big_key payload.data to struct
On Tue, May 9, 2017 at 1:11 AM, David Howells <dhowells@...hat.com> wrote:
> Kees Cook <keescook@...omium.org> wrote:
>
>> This doesn't protect you against changes in struct path size,
>> though... the existing code (and this proposal) will break if that
>> ever happens...
>
> True - in which case you should kmalloc() it as Eric suggests.
>
>> What's the problem with defining the types at the top level? That
>> seems like a nice place to see them all at once.
>
> It means adding a bunch of dependencies to linux/key.h and union key_payload.
>
> Have you considered why we don't just put all the definitions for all the
> filesystems in linux/fs.h? By this logic it would seem like a nice place to
> see them all at once.
I've seen other things that want to share a structure use embedded
structures, etc. I'll see if there is something else to be done, but
just cleaning up the casts alone makes the big_key code so much more
readable. :P
-Kees
--
Kees Cook
Pixel Security
Powered by blists - more mailing lists