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

From: Joe Perches
Date: Mon Oct 17 2011 - 21:21:15 EST


On Mon, 2011-10-17 at 17:55 -0700, David Rientjes wrote:
> The release field of struct new_utsname may always change, so avoid
> hardcoded values when setting up a buffer to copy to it.

I don't think this is correct.

> diff --git a/kernel/sys.c b/kernel/sys.c
[]
> -static int override_release(char __user *release, int len)
> +static int override_release(char __user *release)
> {
> + const int len = sizeof(release);
> int ret = 0;
> - char buf[65];
> + char buf[len];

sizeof(release) = 4 or 8


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/