Linux block layer
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Scott Bauer <scott.bauer@intel.com>
Cc: axboe@kernel.dk, hch@infradead.org, linux-block@vger.kernel.org,
	Scott Bauer <sbauer@plzdonthack.me>,
	stable@vger.kernel.org
Subject: Re: [PATCH] cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status
Date: Wed, 29 Aug 2018 15:48:42 +0300	[thread overview]
Message-ID: <20180829124842.plpsjdvausmtikhj@mwanda> (raw)
In-Reply-To: <20180426175108.29280-1-scott.bauer@intel.com>

Sorry, I responded to this patch that this wasn't a real bug, but then
Scott corrected me that it was.

Anyway, it is a bug and we haven't applied this patch yet.

regards,
dan carpenter

On Thu, Apr 26, 2018 at 11:51:08AM -0600, Scott Bauer wrote:
> 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

  parent reply	other threads:[~2018-08-29 12:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2018-08-29 14:09   ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180829124842.plpsjdvausmtikhj@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=hch@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=sbauer@plzdonthack.me \
    --cc=scott.bauer@intel.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox