lkml.org 
[lkml]   [2016]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 5/6] fs: provide function to report enum strings
From
Date
On Tue, 2016-04-12 at 15:38 -0700, Kees Cook wrote:
> On Tue, Apr 12, 2016 at 3:31 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> > On Tue, Apr 12, 2016 at 09:54:44AM -0700, Kees Cook wrote:
> >> Providing human-readable (and audit-parsable) strings for the READING_*
> >> enums is needed by some LSMs.
> >>
> >> Signed-off-by: Kees Cook <keescook@chromium.org>
> >> ---
> >> fs/exec.c | 19 +++++++++++++++++++
> >> include/linux/fs.h | 1 +
> >> 2 files changed, 20 insertions(+)
> >
> > What the devil is that doing in fs/exec.c, of all places?
>
> Since that's where the kernel_read* functions that use the enum live,
> it seemed like the right place to put the string function too. I'm
> happy to move it where ever folks think it's best to live.

Al,

The problem is keeping the enum and corresponding string in sync. As
soon as the enum definition is separated from the string definition, it
will become a problem. I've tried to use _stringify() to initialize
both the enum and the string, but it is ugly. Perhaps someone else has
a better, prettier method.

Mimi

\
 
 \ /
  Last update: 2016-04-13 14:02    [W:0.075 / U:0.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site