Skip to content

Commit 8f3fafc

Browse files
Scott Baueraxboe
authored andcommitted
cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status
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>
1 parent db19395 commit 8f3fafc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/cdrom/cdrom.c

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

0 commit comments

Comments
 (0)