Skip to content

Commit 9ac0934

Browse files
Dan Carpenterairlied
Dan Carpenter
authored andcommitted
drm: crtc: integer overflow in drm_property_create_blob()
The size here comes from the user via the ioctl, it is a number between 1-u32max so the addition here could overflow on 32 bit systems. Fixes: f453ba0 ('DRM: add mode setting support') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Cc: stable@kernel.org # v4.2 Signed-off-by: Dave Airlie <airlied@gmail.com>
1 parent 04ccb89 commit 9ac0934

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/drm_crtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4105,7 +4105,7 @@ drm_property_create_blob(struct drm_device *dev, size_t length,
41054105
struct drm_property_blob *blob;
41064106
int ret;
41074107

4108-
if (!length)
4108+
if (!length || length > ULONG_MAX - sizeof(struct drm_property_blob))
41094109
return ERR_PTR(-EINVAL);
41104110

41114111
blob = kzalloc(sizeof(struct drm_property_blob)+length, GFP_KERNEL);

0 commit comments

Comments
 (0)