All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.william.auld@gmail.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: Pevent copying uninitialised garbage into vma->ggtt_view
Date: Mon, 23 Jan 2017 15:01:20 +0000	[thread overview]
Message-ID: <CAM0jSHP6V_jiKS+f_6+72=cmT0Trd0g+Kq-yueqDJzNe_6PPRg@mail.gmail.com> (raw)
In-Reply-To: <20170123145245.3972-1-chris@chris-wilson.co.uk>

On 23 January 2017 at 14:52, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Since tweaking i915_vma_compare() we allowed constructors to skip
> clearing the ggtt_view believing that we didn't access the unused
> members. That, as it turns out, was not entirely true. In particular,
> i915_gem_fault() uses
>
>     ret = remap_io_mapping(area,
>             area->vm_start + (vma->ggtt_view.partial.offset << PAGE_SHIFT),
>             (ggtt->mappable_base + vma->node.start) >> PAGE_SHIFT,
>             min_t(u64, vma->size, area->vm_end - area->vm_start),
>             &ggtt->mappable);
>
> i.e. the ggtt_view.partial for both normal and partial views. If we
> allowed garbage into the normal vma->ggtt_view and then try userspace
> tried to mmap it, we could explode in an unobvious fashion.
>
> Fixes: 7b92c047bae2 ("drm/i915: Eliminate superfluous i915_ggtt_view_rotated")
> Fixes: 3bf4d5751943 ("drm/i915: Stop clearing i915_ggtt_view")
> Reported-by: Matthew Auld <matthew.william.auld@gmail.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Matthew Auld <matthew.william.auld@gmail.com>
Tested-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-01-23 15:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-23 14:52 [PATCH] drm/i915: Pevent copying uninitialised garbage into vma->ggtt_view Chris Wilson
2017-01-23 15:01 ` Matthew Auld [this message]
2017-01-23 16:01   ` Chris Wilson
2017-01-23 15:24 ` ✓ Fi.CI.BAT: success for " Patchwork

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='CAM0jSHP6V_jiKS+f_6+72=cmT0Trd0g+Kq-yueqDJzNe_6PPRg@mail.gmail.com' \
    --to=matthew.william.auld@gmail.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.