Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1828870imm; Mon, 3 Sep 2018 10:29:49 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaTqfNEBE0Ylp+hzakO6RKpj2MercUZ6beGKIxvsNzrmp9mqrHG/yxNTP0kcIJ046G5X+3x X-Received: by 2002:a17:902:d706:: with SMTP id w6-v6mr29742588ply.158.1535995789625; Mon, 03 Sep 2018 10:29:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535995789; cv=none; d=google.com; s=arc-20160816; b=T8bxwZSpRWB5BdcED0uRBLJC03hvxmGUumB6uAK+Ml6jBFHDSR0VcXgKRsCBVt54PP +YwkJRQ4PE93pmfIGpq6IwN7o/CqR5fTQFraFr+ggXCVlhi2d+dXfaEEKbaMFDdBAVfR dqIOZi88vpbPTjfEnlQ1S7JUy9JKj9/aHQi436/G2PQC5oehwY5wvGf8l9LUHF0LwWd4 arY1ys+C30tEMJYfXlbBUMhtV34wlNEXgR1ZQO68jMHE7pj1Z/mYRNv3um4S8LSiWFZ+ vE2Lgd9B00DpbRO0A+aYHaYporjPFddfVM+whnTXBQuQrpTICxIYpD51kbvpQ15at2GW oZWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=579wlWza6pAWu9N64Afspk9u5hpfN2frsq0StI73O7w=; b=prHxSYYIXtPozYga3mHxTj5QTHHPzosrPdg0SjEV5T04Apj+rDZALjilgkl77iixUp dfiqSSjliQTFEuy4hYo7fduzXY1edxT46skWal9YHyPYd+R5gx0CtjN6W4DNuo0wlZwP tQRWDP4njGSpb1prklGUPqsx7Ub+/TB4XqOx18yzRuZR0N4b4NM833FtzlmE5v7dUPK2 heGR/xd7TXq24m6NZ/0pnPnY5Z0kEp1l+WNVkyQzN7NDM6AOgB1WWlegXEoubyIYHa6X sQ5eKzt6m2JWVs4EjkE9i0XklFxTGnkEjRRM46dHUE86Tpbcbq1dTRxqMUjkbMY1MPtE 4YmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n13-v6si14658891pgd.280.2018.09.03.10.29.34; Mon, 03 Sep 2018 10:29:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731145AbeICVtb (ORCPT + 99 others); Mon, 3 Sep 2018 17:49:31 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46418 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728175AbeICVta (ORCPT ); Mon, 3 Sep 2018 17:49:30 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 16505D01; Mon, 3 Sep 2018 17:28:21 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Scott Bauer , Scott Bauer , Jens Axboe Subject: [PATCH 4.14 163/165] cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status Date: Mon, 3 Sep 2018 18:57:29 +0200 Message-Id: <20180903165705.275429213@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Scott Bauer commit 8f3fafc9c2f0ece10832c25f7ffcb07c97a32ad4 upstream. 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 Signed-off-by: Scott Bauer Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- drivers/cdrom/cdrom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -2542,7 +2542,7 @@ static int cdrom_ioctl_drive_status(stru 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); }