From: Sasha Levin Date: Thu, 21 Mar 2019 05:47:47 +0000 (-0400) Subject: fixes for fixes for 4.9 X-Git-Tag: v3.18.137~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=224ce0309a5fbae5078e7cb3436f53760d1ef8cc;p=thirdparty%2Fkernel%2Fstable-queue.git fixes for fixes for 4.9 Signed-off-by: Sasha Levin --- diff --git a/queue-4.9/drm-i915-relax-mmap-vma-check.patch b/queue-4.9/drm-i915-relax-mmap-vma-check.patch new file mode 100644 index 00000000000..f354708788d --- /dev/null +++ b/queue-4.9/drm-i915-relax-mmap-vma-check.patch @@ -0,0 +1,50 @@ +From 674b461ed076c99e1d995cbe3990b0408a20eecd Mon Sep 17 00:00:00 2001 +From: Tvrtko Ursulin +Date: Tue, 5 Mar 2019 11:04:08 +0000 +Subject: drm/i915: Relax mmap VMA check + +[ Upstream commit ca22f32a6296cbfa29de56328c8505560a18cfa8 ] + +Legacy behaviour was to allow non-page-aligned mmap requests, as does the +linux mmap(2) implementation by virtue of automatically rounding up for +the caller. + +To avoid breaking legacy userspace relax the newly introduced fix. + +Signed-off-by: Tvrtko Ursulin +Fixes: 5c4604e757ba ("drm/i915: Prevent a race during I915_GEM_MMAP ioctl with WC set") +Reported-by: Guenter Roeck +Cc: Adam Zabrocki +Cc: Joonas Lahtinen +Cc: # v4.0+ +Cc: Akash Goel +Cc: Chris Wilson +Cc: Jani Nikula +Cc: Rodrigo Vivi +Cc: intel-gfx@lists.freedesktop.org +Reviewed-by: Chris Wilson +Link: https://patchwork.freedesktop.org/patch/msgid/20190305110409.28633-1-tvrtko.ursulin@linux.intel.com +(cherry picked from commit a90e1948efb648f567444f87f3c19b2a0787affd) +Signed-off-by: Rodrigo Vivi +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/i915/i915_gem.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c +index 6509031098d5..26c4befcd234 100644 +--- a/drivers/gpu/drm/i915/i915_gem.c ++++ b/drivers/gpu/drm/i915/i915_gem.c +@@ -1600,7 +1600,8 @@ __vma_matches(struct vm_area_struct *vma, struct file *filp, + if (vma->vm_file != filp) + return false; + +- return vma->vm_start == addr && (vma->vm_end - vma->vm_start) == size; ++ return vma->vm_start == addr && ++ (vma->vm_end - vma->vm_start) == PAGE_ALIGN(size); + } + + /** +-- +2.19.1 + diff --git a/queue-4.9/series b/queue-4.9/series index 0c517fd2cc4..c42b0d35e8e 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -82,3 +82,4 @@ device-property-fix-the-length-used-in-property_entry_string.patch intel_th-don-t-reference-unassigned-outputs.patch parport_pc-fix-find_superio-io-compare-code-should-use-equal-test.patch i2c-tegra-fix-maximum-transfer-size.patch +drm-i915-relax-mmap-vma-check.patch