Skip to content

Commit 5bf8bec

Browse files
danvettorvalds
authored andcommitted
drm: limit to INT_MAX in create_blob ioctl
The hardened usercpy code is too paranoid ever since commit 6a30afa8c1fb ("uaccess: disallow > INT_MAX copy sizes") Code itself should have been fine as-is. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Daniel Vetter <[email protected]> Reported-by: [email protected] Fixes: 6a30afa8c1fb ("uaccess: disallow > INT_MAX copy sizes") Cc: Kees Cook <[email protected]> Cc: Alexander Viro <[email protected]> Cc: Stephen Rothwell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent bd7bca4 commit 5bf8bec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/drm_property.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ drm_property_create_blob(struct drm_device *dev, size_t length,
561561
struct drm_property_blob *blob;
562562
int ret;
563563

564-
if (!length || length > ULONG_MAX - sizeof(struct drm_property_blob))
564+
if (!length || length > INT_MAX - sizeof(struct drm_property_blob))
565565
return ERR_PTR(-EINVAL);
566566

567567
blob = kvzalloc(sizeof(struct drm_property_blob)+length, GFP_KERNEL);

0 commit comments

Comments
 (0)