mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-12-02 17:00:37 -05:00
drm: limit to INT_MAX in create_blob ioctl
commit 5bf8bec3f4ce044a223c40cbce92590d938f0e9c upstream.
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]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
24c792fb7c
commit
cfd653e839
1 changed files with 1 additions and 1 deletions
|
|
@ -561,7 +561,7 @@ drm_property_create_blob(struct drm_device *dev, size_t length,
|
|||
struct drm_property_blob *blob;
|
||||
int ret;
|
||||
|
||||
if (!length || length > ULONG_MAX - sizeof(struct drm_property_blob))
|
||||
if (!length || length > INT_MAX - sizeof(struct drm_property_blob))
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
blob = kvzalloc(sizeof(struct drm_property_blob)+length, GFP_KERNEL);
|
||||
|
|
|
|||
Loading…
Reference in a new issue