Skip to content

Commit 73b2e70

Browse files
Scott Bauergregkh
authored andcommitted
cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status
commit 8f3fafc upstream. Like d88b6d0: "cdrom: information leak in cdrom_ioctl_media_changed()" There is another cast from unsigned long to int which causes a bounds check to fail with specially crafted input. The value is then used as an index in the slot array in cdrom_slot_status(). Signed-off-by: Scott Bauer <scott.bauer@intel.com> Signed-off-by: Scott Bauer <sbauer@plzdonthack.me> Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 63a0f9d commit 73b2e70

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/cdrom/cdrom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2542,7 +2542,7 @@ static int cdrom_ioctl_drive_status(struct cdrom_device_info *cdi,
25422542
if (!CDROM_CAN(CDC_SELECT_DISC) ||
25432543
(arg == CDSL_CURRENT || arg == CDSL_NONE))
25442544
return cdi->ops->drive_status(cdi, CDSL_CURRENT);
2545-
if (((int)arg >= cdi->capacity))
2545+
if (arg >= cdi->capacity)
25462546
return -EINVAL;
25472547
return cdrom_slot_status(cdi, arg);
25482548
}

0 commit comments

Comments
 (0)