[PATCH -fixes] drm/vmwgfx: Fix nasty write past alloced memory area
Thomas Hellstrom
thellstrom at vmware.com
Fri Jun 1 06:39:10 PDT 2012
A typo may cause a write past the allocated area on 32-bit systems and
a resulting kernel oops. Triggers for example with the catia-03
Specviewperf test.
Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
Cc: stable at vger.kernel.org
---
drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
index 51c9ba5..21ee782 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
@@ -66,7 +66,7 @@ static int vmw_gmr2_bind(struct vmw_private *dev_priv,
cmd += sizeof(remap_cmd) / sizeof(uint32);
for (i = 0; i < num_pages; ++i) {
- if (VMW_PPN_SIZE > 4)
+ if (VMW_PPN_SIZE <= 4)
*cmd = page_to_pfn(*pages++);
else
*((uint64_t *)cmd) = page_to_pfn(*pages++);
--
1.7.7.5
More information about the dri-devel
mailing list