]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Fix vmap_batch page iterator overrun
authorMika Kuoppala <mika.kuoppala@linux.intel.com>
Fri, 13 Mar 2015 13:21:53 +0000 (15:21 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 17 Mar 2015 21:30:31 +0000 (22:30 +0100)
commit6a4edc9cfc0046018abfb64021893ddbb5f1e9a8
treeab091c977ced78de761dc2069c117aff441d38c2
parent31e3b0931eb29caf6a1d7a709c0d366ec87364ba
drm/i915: Fix vmap_batch page iterator overrun

vmap_batch() calculates amount of needed pages for the mapping
we are going to create. And it uses this page count as an
argument for the for_each_sg_pages() macro. The macro takes the number
of sg list entities as an argument, not the page count. So we ended
up iterating through all the pages on the mapped object, corrupting
memory past the smaller pages[] array.

Fix this by bailing out when we have enough pages.

This regression has been introduced in

commit 765e7fa6109845073edc4600494b6e030ef6306a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jan 14 11:20:57 2015 +0000

    drm/i915: Trim the command parser allocations

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_cmd_parser.c