drivers/gpu/drm/drm_ioc32.c: initialize all fields
authorJulia Lawall <Julia.Lawall@lip6.fr>
Mon, 30 Jan 2012 11:05:55 +0000 (12:05 +0100)
committerDave Airlie <airlied@redhat.com>
Fri, 3 Feb 2012 09:47:32 +0000 (09:47 +0000)
The c32 structure is allocated on the stack and its idx field is not
initialized before copying it to user level.  This patch takes the value
from the result of the ioctl, as done for the other fields.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_ioc32.c

index ddd70db45f7611747ee63551db2846d31383bc34..637fcc3766c7d706fb3ec0c6957d2d6f6c957568 100644 (file)
@@ -315,7 +315,8 @@ static int compat_drm_getclient(struct file *file, unsigned int cmd,
        if (err)
                return err;
 
-       if (__get_user(c32.auth, &client->auth)
+       if (__get_user(c32.idx, &client->idx)
+           || __get_user(c32.auth, &client->auth)
            || __get_user(c32.pid, &client->pid)
            || __get_user(c32.uid, &client->uid)
            || __get_user(c32.magic, &client->magic)