[PATCH] drm/nouveau: avoid null deref on bad arguments to nouveau_vma_getmap
Pasi Kärkkäinen
pasik at iki.fi
Wed Sep 25 07:42:46 PDT 2013
On Wed, Sep 04, 2013 at 08:59:13AM +0200, Maarten Lankhorst wrote:
>
> When looking into this bug I noticed that nouveau_bo_vma_add needs to have a check for nvbo->page_shift == vma->vm->vmm->spg_shift,
> and only if the check is true it should map the page in TTM_PL_TT. Patch below.
> Should probably also be cc'd to stable.
>
How about this patch? Is it ready to go in?
Thanks,
-- Pasi
> ~Maarten
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
> index 89b992e..355a1b7 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_bo.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
> @@ -1560,7 +1560,8 @@ nouveau_bo_vma_add(struct nouveau_bo *nvbo, struct nouveau_vm *vm,
>
> if (nvbo->bo.mem.mem_type == TTM_PL_VRAM)
> nouveau_vm_map(vma, nvbo->bo.mem.mm_node);
> - else if (nvbo->bo.mem.mem_type == TTM_PL_TT) {
> + else if (nvbo->bo.mem.mem_type == TTM_PL_TT &&
> + nvbo->page_shift == vma->vm->vmm->spg_shift) {
> if (node->sg)
> nouveau_vm_map_sg_table(vma, 0, size, node);
> else
>
More information about the dri-devel
mailing list