[PATCH] Memset the kernel copy of rtas args before using

Sergei Shtylyov sshtylyov at ru.mvista.com
Sat Jul 26 20:52:50 EST 2008


Hello.

Nathan Fontenot wrote:
> Index: linux-2.6.git/arch/powerpc/kernel/rtas.c
> ===================================================================
> --- linux-2.6.git.orig/arch/powerpc/kernel/rtas.c    2008-07-22 
> 09:34:03.000000000 -0500
> +++ linux-2.6.git/arch/powerpc/kernel/rtas.c    2008-07-25 
> 16:06:00.000000000 -0500
> @@ -775,6 +775,8 @@
>     if (!capable(CAP_SYS_ADMIN))
>         return -EPERM;
>
> +    memset(&args, 0, sizeof(args));
> +

   You could use memzero() directly -- memset(x, 0, sizeof(x))l should 
boil down to it anyway...
>     if (copy_from_user(&args, uargs, 3 * sizeof(u32)) != 0)
>         return -EFAULT;

WBR, Sergei





More information about the Linuxppc-dev mailing list