Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1836411imm; Mon, 3 Sep 2018 10:41:34 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYlOpNOynthzJjb2ZCU01ZYlTO1K2DT6LJ+hPlRx15drp4nKmMd/UwlE5njbiYNAmVi1U38 X-Received: by 2002:a63:1516:: with SMTP id v22-v6mr27054483pgl.150.1535996494202; Mon, 03 Sep 2018 10:41:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535996494; cv=none; d=google.com; s=arc-20160816; b=ghSlsKsElEwm21nIAkWWwf5reC6a3EYBTBOJ/tst/2Mnlc8V7ygn7KQkxhpKjij/Ry XuW4E4E6gpuwTGoGzofVoWCkHJI/NcSMKsffQqwEnoBZYQiNp50033IJ1L4+lcDn5RxB /T5pF/PeuCyI5r8nFEWAUeXbiwyLu8w+krTp30m2w1AKbSX0xWrb9g2EzBjrNVkT02WA Ew5ee71p915J9JIDSv8ht7m7l2opqyZsGTa1jJm6InjGgM2FZewu+eBP2oaU8+wiZSHI IJdZn/QRB3hbe6kQ/pc9M9bjspKNfT7Gq4T5K14bzJS0vojskOmbKHs9S5AKJlrPeHQy 2nQw== 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=/UMPQUIYAnvZoQdyqN0vcuHTsUhuqXnJrbsIy/F3wtI=; b=jIns+7lahiHSeHAgL4th7xa6QGlbCom9mct6eEypZSb3O7aF37SWhI5iH8BxjmS4Nz duF2p1XKu6SU8VGdCPKtpHzgo2ue6cULS8mkJX7A1tL/PruY1W0OYIMisSTffkt6nJ+2 gN84RPCyvkGQEMSR59GPrQPUwv95IK/CeTnu4iBEDTTOtHZIsz54pm0YJUHJKJxZeblQ aOuZQZ/yeuT2QmQ5EgdPkXdclDMlgCqt5b0as/83DaQldzKiq0QUghzshzxT5YPn6SGE 0aI9fSb/U65mrelpITzNx9w1zPdwhpyFAcRHnWLpEwJiZzpUGF8D6e6L0xZGkpcv+S/H jTqA== 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 x4-v6si18018684plo.459.2018.09.03.10.41.19; Mon, 03 Sep 2018 10:41:34 -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 S1731990AbeICWBB (ORCPT + 99 others); Mon, 3 Sep 2018 18:01:01 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49316 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729170AbeICWBA (ORCPT ); Mon, 3 Sep 2018 18:01:00 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id DDAAEBAE; Mon, 3 Sep 2018 17:39:49 +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.18 121/123] cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status Date: Mon, 3 Sep 2018 18:57:45 +0200 Message-Id: <20180903165724.611397234@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165719.499675257@linuxfoundation.org> References: <20180903165719.499675257@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.18-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); }