]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
agp: info leak in agpioc_info_wrap()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 3 May 2014 20:27:00 +0000 (23:27 +0300)
committerDave Airlie <airlied@redhat.com>
Mon, 5 May 2014 00:33:28 +0000 (10:33 +1000)
On 64 bit systems the agp_info struct has a 4 byte hole between
->agp_mode and ->aper_base.  We need to clear it to avoid disclosing
stack information to userspace.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/char/agp/frontend.c

index 8121b4c70edec77114e20295e195fa1d5f2cc797..b29703324e9431d24c5c0b588efbae14d8d2d5ba 100644 (file)
@@ -730,6 +730,7 @@ static int agpioc_info_wrap(struct agp_file_private *priv, void __user *arg)
 
        agp_copy_info(agp_bridge, &kerninfo);
 
+       memset(&userinfo, 0, sizeof(userinfo));
        userinfo.version.major = kerninfo.version.major;
        userinfo.version.minor = kerninfo.version.minor;
        userinfo.bridge_id = kerninfo.device->vendor |