mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
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: f453ba0460
('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>
This commit is contained in:
parent
04ccb89073
commit
9ac0934bbe
1 changed files with 1 additions and 1 deletions
|
@ -4105,7 +4105,7 @@ drm_property_create_blob(struct drm_device *dev, size_t length,
|
|||
struct drm_property_blob *blob;
|
||||
int ret;
|
||||
|
||||
if (!length)
|
||||
if (!length || length > ULONG_MAX - sizeof(struct drm_property_blob))
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
blob = kzalloc(sizeof(struct drm_property_blob)+length, GFP_KERNEL);
|
||||
|
|
Loading…
Reference in a new issue