From: Ben Skeggs Date: Tue, 13 Sep 2011 20:08:06 +0000 (+1000) Subject: drm/ttm: request zeroed system memory pages for new TT buffer objects X-Git-Tag: v3.0.13~71 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8215014c1d9d78ef14260a46ee2a136acc3d283a;p=karo-tx-linux.git drm/ttm: request zeroed system memory pages for new TT buffer objects commit ff02b13f6867af72682d7a9bb9bd705f9af2bab0 upstream. Fixes an information leak to userspace, we were handing out un-zeroed pages for any newly created TTM_PL_TT buffer. Reported-by: Marcin Slusarz Signed-off-by: Ben Skeggs Tested-by: Marcin Slusarz Signed-off-by: Dave Airlie Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index e2b2d7866877..81b68508dc13 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -394,7 +394,8 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo, if (!(new_man->flags & TTM_MEMTYPE_FLAG_FIXED)) { if (bo->ttm == NULL) { - ret = ttm_bo_add_ttm(bo, false); + bool zero = !(old_man->flags & TTM_MEMTYPE_FLAG_FIXED); + ret = ttm_bo_add_ttm(bo, zero); if (ret) goto out_err; }