diff options
author | Shaohua Li <shaohua.li@intel.com> | 2009-04-19 20:08:35 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-04-19 20:08:35 -0400 |
commit | 59de2bebabc5027f93df999d59cc65df591c3e6e (patch) | |
tree | b4f9f209c254c4e830f10605054dddf52e472184 /drivers/char/agp/generic.c | |
parent | 07f1c7a7f6736d9ec2eba57d209c5f48888d841e (diff) |
agp: zero pages before sending to userspace
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>
Diffstat (limited to 'drivers/char/agp/generic.c')
-rw-r--r-- | drivers/char/agp/generic.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c index 10d6cbd7c05e..2224b762b7fb 100644 --- a/drivers/char/agp/generic.c +++ b/drivers/char/agp/generic.c | |||
@@ -1226,7 +1226,7 @@ int agp_generic_alloc_pages(struct agp_bridge_data *bridge, struct agp_memory *m | |||
1226 | int i, ret = -ENOMEM; | 1226 | int i, ret = -ENOMEM; |
1227 | 1227 | ||
1228 | for (i = 0; i < num_pages; i++) { | 1228 | for (i = 0; i < num_pages; i++) { |
1229 | page = alloc_page(GFP_KERNEL | GFP_DMA32); | 1229 | page = alloc_page(GFP_KERNEL | GFP_DMA32 | __GFP_ZERO); |
1230 | /* agp_free_memory() needs gart address */ | 1230 | /* agp_free_memory() needs gart address */ |
1231 | if (page == NULL) | 1231 | if (page == NULL) |
1232 | goto out; | 1232 | goto out; |
@@ -1257,7 +1257,7 @@ void *agp_generic_alloc_page(struct agp_bridge_data *bridge) | |||
1257 | { | 1257 | { |
1258 | struct page * page; | 1258 | struct page * page; |
1259 | 1259 | ||
1260 | page = alloc_page(GFP_KERNEL | GFP_DMA32); | 1260 | page = alloc_page(GFP_KERNEL | GFP_DMA32 | __GFP_ZERO); |
1261 | if (page == NULL) | 1261 | if (page == NULL) |
1262 | return NULL; | 1262 | return NULL; |
1263 | 1263 | ||