Skip to content

Commit

Permalink
agp: zero pages before sending to userspace
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shaohua Li authored and Dave Airlie committed Apr 20, 2009
1 parent 07f1c7a commit 59de2be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/char/agp/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 59de2be

Please sign in to comment.