All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakob Bornecrantz <jakob@vmware.com>
To: Thomas Hellstrom <thellstrom@vmware.com>
Cc: dri-devel@lists.freedesktop.org, stable@vger.kernel.org
Subject: Re: [PATCH] drm/ttm: Fix accesses through vmas with only partial coverage
Date: Thu, 12 Dec 2013 04:22:03 -0800 (PST)	[thread overview]
Message-ID: <1600868985.4813877.1386850923859.JavaMail.root@vmware.com> (raw)
In-Reply-To: <1386574131-3417-1-git-send-email-thellstrom@vmware.com>

Looks good to me.

Cheers, Jakob.

----- Thomas Hellstrom <thellstrom@vmware.com> wrote:
> VMAs covering a bo but that didn't start at the same address space offset as
> the bo they were mapping were incorrectly generating SEGFAULT errors in
> the fault handler.
> 
> Reported-by: Joseph Dolinak <kanilo2@yahoo.com>
> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
> Cc: stable@vger.kernel.org
> ---
> drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c
> index b249ab9..6440eea 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c
> @@ -169,9 +169,9 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
> 	}
> 
> 	page_offset = ((address - vma->vm_start) >> PAGE_SHIFT) +
> -	 drm_vma_node_start(&bo->vma_node) - vma->vm_pgoff;
> -	page_last = vma_pages(vma) +
> -	 drm_vma_node_start(&bo->vma_node) - vma->vm_pgoff;
> +		vma->vm_pgoff - drm_vma_node_start(&bo->vma_node);
> +	page_last = vma_pages(vma) + vma->vm_pgoff -
> +		drm_vma_node_start(&bo->vma_node);
> 
> 	if (unlikely(page_offset >= bo->num_pages)) {
> 		retval = VM_FAULT_SIGBUS;
> -- 
> 1.7.10.4

      reply	other threads:[~2013-12-12 12:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-09  7:28 [PATCH] drm/ttm: Fix accesses through vmas with only partial coverage Thomas Hellstrom
2013-12-12 12:22 ` Jakob Bornecrantz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1600868985.4813877.1386850923859.JavaMail.root@vmware.com \
    --to=jakob@vmware.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=stable@vger.kernel.org \
    --cc=thellstrom@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.