diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2018-09-13 03:45:09 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2018-09-13 03:45:09 +0000 |
commit | 15cf1f6e76411f0fda7c46013c8be30b9b0553ab (patch) | |
tree | 949bfad4ba667f07fa859a5df0dcde1d5c7c68d8 /sys/dev/pci | |
parent | 5271834a880a6ed92633e975954837dca2d3a843 (diff) |
drm/i915/userptr: reject zero user_size
From Matthew Auld
182e963432d867384f2e55487ec60ca7a9f99cd1 in linux 4.4.y/4.4.155
c11c7bfd213495784b22ef82a69b6489f8d0092f in mainline linux
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/drm/i915/i915_gem_userptr.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/i915/i915_gem_userptr.c b/sys/dev/pci/drm/i915/i915_gem_userptr.c index cfef42c2bf0..781419bed4b 100644 --- a/sys/dev/pci/drm/i915/i915_gem_userptr.c +++ b/sys/dev/pci/drm/i915/i915_gem_userptr.c @@ -846,6 +846,9 @@ i915_gem_userptr_ioctl(struct drm_device *dev, void *data, struct drm_file *file I915_USERPTR_UNSYNCHRONIZED)) return -EINVAL; + if (!args->user_size) + return -EINVAL; + if (offset_in_page(args->user_ptr | args->user_size)) return -EINVAL; |