瀏覽代碼

drivers/gpu/drm/drm_ioc32.c: initialize all fields

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>
Julia Lawall 13 年之前
父節點
當前提交
08bc3d4e67
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/gpu/drm/drm_ioc32.c

+ 2 - 1
drivers/gpu/drm/drm_ioc32.c

@@ -315,7 +315,8 @@ static int compat_drm_getclient(struct file *file, unsigned int cmd,
 	if (err)
 	if (err)
 		return 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.pid, &client->pid)
 	    || __get_user(c32.uid, &client->uid)
 	    || __get_user(c32.uid, &client->uid)
 	    || __get_user(c32.magic, &client->magic)
 	    || __get_user(c32.magic, &client->magic)