Skip to content

Commit e4f3aa2

Browse files
Yoha-testaxboe
authored andcommitted
cdrom: fix improper type cast, which can leat to information leak.
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(). This issue is similar to CVE-2018-16658 and CVE-2018-10940. Signed-off-by: Young_X <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent fb6360b commit e4f3aa2

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
@@ -2445,7 +2445,7 @@ static int cdrom_ioctl_select_disc(struct cdrom_device_info *cdi,
24452445
return -ENOSYS;
24462446

24472447
if (arg != CDSL_CURRENT && arg != CDSL_NONE) {
2448-
if ((int)arg >= cdi->capacity)
2448+
if (arg >= cdi->capacity)
24492449
return -EINVAL;
24502450
}
24512451

0 commit comments

Comments
 (0)