Re: [patch] Avoid using hardcoded values in kernel/sys.c

From: David Rientjes
Date: Mon Oct 17 2011 - 21:33:15 EST


On Mon, 17 Oct 2011, Linus Torvalds wrote:

> > The release field of struct new_utsname may always change, so avoid
> > hardcoded values when setting up a buffer to copy to it.
>
> This patch is totally bogus.
>
> > +static int override_release(char __user *release)
> >  {
> > +       const int len = sizeof(release);
>

Right, I meant to pass the struct in and use sizeof(release->name), but I
was under the impression that wouldn't count as a variable length array or
be compiled as such by ISO99 standards because it's a constant expression
(as the standard says is not variable length).