]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
agp: zero pages before sending to userspace
authorShaohua Li <shaohua.li@intel.com>
Mon, 20 Apr 2009 00:08:35 +0000 (10:08 +1000)
committerChris Wright <chrisw@sous-sol.org>
Mon, 27 Apr 2009 17:37:05 +0000 (10:37 -0700)
upstream commit: 59de2bebabc5027f93df999d59cc65df591c3e6e

CVE-2009-1192

AGP pages might be mapped into userspace finally, so the pages should be
set to zero before userspace can use it. Otherwise there is potential
information leakage.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
drivers/char/agp/generic.c

index 10d6cbd7c05e59126f175eb1d8217cc95113d826..2224b762b7fbc4ce53688352af285c3fbd5d1eb2 100644 (file)
@@ -1226,7 +1226,7 @@ int agp_generic_alloc_pages(struct agp_bridge_data *bridge, struct agp_memory *m
        int i, ret = -ENOMEM;
 
        for (i = 0; i < num_pages; i++) {
-               page = alloc_page(GFP_KERNEL | GFP_DMA32);
+               page = alloc_page(GFP_KERNEL | GFP_DMA32 | __GFP_ZERO);
                /* agp_free_memory() needs gart address */
                if (page == NULL)
                        goto out;
@@ -1257,7 +1257,7 @@ void *agp_generic_alloc_page(struct agp_bridge_data *bridge)
 {
        struct page * page;
 
-       page = alloc_page(GFP_KERNEL | GFP_DMA32);
+       page = alloc_page(GFP_KERNEL | GFP_DMA32 | __GFP_ZERO);
        if (page == NULL)
                return NULL;