]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - drivers/cdrom/cdrom.c
cdrom: information leak in cdrom_ioctl_media_changed()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 18 Apr 2018 09:51:31 +0000 (12:51 +0300)
committerKhalid Elmously <khalid.elmously@canonical.com>
Tue, 12 Jun 2018 06:28:55 +0000 (02:28 -0400)
commit51a32f6fe3bcf5e99b9d7b27c60c090c1b023ab9
tree0e82dfdaed7f739c6868d2915d0a101696b3dcaa
parent696570a449e611aeb30717ac75a2dff2e3c78319
cdrom: information leak in cdrom_ioctl_media_changed()

BugLink: http://bugs.launchpad.net/bugs/1775483
commit 9de4ee40547fd315d4a0ed1dd15a2fa3559ad707 upstream.

This cast is wrong.  "cdi->capacity" is an int and "arg" is an unsigned
long.  The way the check is written now, if one of the high 32 bits is
set then we could read outside the info->slots[] array.

This bug is pretty old and it predates git.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: stable@vger.kernel.org
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/cdrom/cdrom.c