mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 23:25:07 +00:00
cdrom: information leak in cdrom_ioctl_media_changed()
commit 9de4ee4054
upstream.
This cast is wrong. "cdi->capacity" is an int and "arg" is an unsigned
long. The way the check is written now, if one of the high 32 bits is
set then we could read outside the info->slots[] array.
This bug is pretty old and it predates git.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: stable@vger.kernel.org
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f4df47e36a
commit
68c09d548b
1 changed files with 1 additions and 1 deletions
|
@ -2374,7 +2374,7 @@ static int cdrom_ioctl_media_changed(struct cdrom_device_info *cdi,
|
||||||
if (!CDROM_CAN(CDC_SELECT_DISC) || arg == CDSL_CURRENT)
|
if (!CDROM_CAN(CDC_SELECT_DISC) || arg == CDSL_CURRENT)
|
||||||
return media_changed(cdi, 1);
|
return media_changed(cdi, 1);
|
||||||
|
|
||||||
if ((unsigned int)arg >= cdi->capacity)
|
if (arg >= cdi->capacity)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
info = kmalloc(sizeof(*info), GFP_KERNEL);
|
info = kmalloc(sizeof(*info), GFP_KERNEL);
|
||||||
|
|
Loading…
Reference in a new issue