Skip to contentSkip to conversation

drm/vmwgfx: Fix nasty write past alloced memory area

PATCH New Thomas Hellstrom 1 participant 2 messages Jun 1, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/vmwgfx: Fix nasty write past alloced memory area

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.

---
 drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c +1 -1
index 51c9ba5..21ee782 100644
@@ -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++);
Signature · 1 line
1.7.7.5
#1 lore raw

PATCH 1/1 drm/ttm: Fix spinlock imbalance

This imbalance may cause hangs when TTM is trying to swap out a buffer that is already on the delayed delete list.

---
 drivers/gpu/drm/ttm/ttm_bo.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/gpu/drm/ttm/ttm_bo.c +1 -0
index 36792bd..b67cfca 100644
@@ -1834,6 +1834,7 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink)
 			spin_unlock(&glob->lru_lock);
 			(void) ttm_bo_cleanup_refs(bo, false, false, false);
 			kref_put(&bo->list_kref, ttm_bo_release_list);
+			spin_lock(&glob->lru_lock);
 			continue;
 		}
 
Signature · 1 line
1.7.4.4