Skip to content

Commit 5c11616

Browse files
Yoha-testjfvogel
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]> (cherry picked from commit e4f3aa2) Orabug: 28906151 CVE: CVE-2018-18710 Reviewed-by: Darren Kenny <[email protected]> Signed-off-by: Allen Pais <[email protected]>
1 parent 9de2e19 commit 5c11616

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
@@ -2441,7 +2441,7 @@ static int cdrom_ioctl_select_disc(struct cdrom_device_info *cdi,
24412441
return -ENOSYS;
24422442

24432443
if (arg != CDSL_CURRENT && arg != CDSL_NONE) {
2444-
if ((int)arg >= cdi->capacity)
2444+
if (arg >= cdi->capacity)
24452445
return -EINVAL;
24462446
}
24472447

0 commit comments

Comments
 (0)