Skip to contentSkip to conversation

drm/i915/userptr: reject zero user_size

PATCH In review Loic 2 participants 4 messages Sep 3, 2018 – Sep 7, 2018

Subsystems (3)
lore
Share & tools
lore

Loic

author
#0 lore raw

PATCH 1/1 drm/i915/userptr: reject zero user_size

Hello,

Tested without any problem so please picked up this.

From: Matthew Auld

[ Upstream commit c11c7bfd213495784b22ef82a69b6489f8d0092f ]

Operating on a zero sized GEM userptr object will lead to explosions.

Fixes 5cc9ed4b9a7a ("drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl")

Testcase: igt/gem_userptr_blits/input-checking

---
 drivers/gpu/drm/i915/i915_gem_userptr.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/i915_gem_userptr.c +3 -0
index d596a8302ca3c..854bd51b9478a 100644
@@ -778,6 +778,9 @@ i915_gem_userptr_ioctl(struct drm_device *dev,
 			    I915_USERPTR_UNSYNCHRONIZED))
 		return -EINVAL;
 
+	if (!args->user_size)
+		return -EINVAL;
+
 	if (offset_in_page(args->user_ptr | args->user_size))
 		return -EINVAL;
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 3 lines · Loic

Hello,

Tested without any problem so please picked up this.

Pick this up for what stable kernel tree(s) exactly?

thanks,

greg k-h

author
#2 lore raw

Le 2018-09-03 18:17, Greg KH a écrit :

Quoted 6 lines · Loic
Quoted 3 lines

Hello,

Tested without any problem so please picked up this.

Pick this up for what stable kernel tree(s) exactly?

Sorry about the lack of detail For 4.4, 4.9 and 4.14 please.

Quoted 1 line

thanks,

Thanks to you too.

Quoted 2 lines

greg k-h

Signature · 3 lines
Best regards,

Loic
#3 lore raw
Quoted 9 lines · Loic

Le 2018-09-03 18:17, Greg KH a �crit�:

Quoted 6 lines · Loic
Quoted 3 lines

Hello,

Tested without any problem so please picked up this.

Pick this up for what stable kernel tree(s) exactly?

Sorry about the lack of detail For 4.4, 4.9 and 4.14 please.

Now queued up, thanks.

greg k-h