From 170c79464f1044a346e08289b624afefcf55e8cd Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 11 Apr 2022 03:38:46 +0000 Subject: [PATCH] drm/i915/gem: add missing boundary check in vm_access From Mastan Katragadda 312d3d4f49e12f97260bcf972c848c3562126a18 in linux 5.15.y/5.15.33 3886a86e7e6cc6ce2ce93c440fecd8f42aed0ce7 in mainline linux --- sys/dev/pci/drm/i915/gem/i915_gem_mman.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/i915/gem/i915_gem_mman.c b/sys/dev/pci/drm/i915/gem/i915_gem_mman.c index 2607a4fde21..330cb25c5be 100644 --- a/sys/dev/pci/drm/i915/gem/i915_gem_mman.c +++ b/sys/dev/pci/drm/i915/gem/i915_gem_mman.c @@ -473,7 +473,7 @@ vm_access(struct vm_area_struct *area, unsigned long addr, return -EACCES; addr -= area->vm_start; - if (addr >= obj->base.size) + if (range_overflows_t(u64, addr, len, obj->base.size)) return -EINVAL; i915_gem_ww_ctx_init(&ww, true); -- 2.20.1