Linux block layer
 help / color / mirror / Atom feed
* [PATCH] cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status
@ 2018-04-26 17:51 Scott Bauer
  2018-04-27 12:41 ` Dan Carpenter
  2018-08-29 12:48 ` Dan Carpenter
  0 siblings, 2 replies; 6+ messages in thread
From: Scott Bauer @ 2018-04-26 17:51 UTC (permalink / raw)
  To: axboe; +Cc: hch, dan.carpenter, linux-block, Scott Bauer, Scott Bauer, stable

Like d88b6d04: "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
---
 drivers/cdrom/cdrom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index bfc566d3f31a..8cfa10ab7abc 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -2542,7 +2542,7 @@ static int cdrom_ioctl_drive_status(struct cdrom_device_info *cdi,
 	if (!CDROM_CAN(CDC_SELECT_DISC) ||
 	    (arg == CDSL_CURRENT || arg == CDSL_NONE))
 		return cdi->ops->drive_status(cdi, CDSL_CURRENT);
-	if (((int)arg >= cdi->capacity))
+	if (arg >= cdi->capacity)
 		return -EINVAL;
 	return cdrom_slot_status(cdi, arg);
 }
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-08-29 14:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-26 17:51 [PATCH] cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status Scott Bauer
2018-04-27 12:41 ` Dan Carpenter
2018-04-27 14:43   ` Scott Bauer
2018-04-27 15:13     ` Dan Carpenter
2018-08-29 12:48 ` Dan Carpenter
2018-08-29 14:09   ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox