Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3998777pxu; Mon, 12 Oct 2020 07:02:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPmd3l3ANxo9OVGZu3XlogtpqzQ13SgrqMAdaSjpDVK8gNZzQ12fX0XPTWwXYnNRUk0Vwc X-Received: by 2002:a05:6402:b31:: with SMTP id bo17mr14927039edb.342.1602511220748; Mon, 12 Oct 2020 07:00:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602511220; cv=none; d=google.com; s=arc-20160816; b=JS1BBHMUJQtTHr6s1otpRKIaxgeapueG9Mekrn3kKUXVnY1WE3mxCEa6cnmJ7mPAlC L2xgrzj3pW9+saAJwzuZSHfz7+jJ171KvKFVQSA3RMCXb4+RuNXqpSATPJYQqSOM1UHn x9HIEBavkdLlZgNk8wXmpjPsDRbYQA/5diPcnCPS3vpZAxnEJPzwqfSd26zrD4KsvoCX Q5ARPbm9vqaqZhyaieAUHE9tmH+we2uY/lD1gFoe+oX8JVxWMO3MiT4ed33717IAXGPq sVj6wcNL4Grcr3rSi1C4Mn0cQNqeURFI2SlLCpYIErRR2WxSD9i+9csJ2vFiA/hjzf3Y kZ8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JCCcdJ3qHkcsRnaEen25K7iZHxyERSQvJRR23FGoYRA=; b=D1+oYiDmiUmA67NilmtfoDyaG0eX4aaeplSQOHqOAkoo5srjxb6ZSpaTfXjuriqvyP TfQWFhwDxckfi9iLZuGsbu0NKOqssPTgcYhKrWGvpqPBDTXtwb4T1IvOeSoURSgZK/2x SOdYhax1KhdoIveE1+Pt6QLM57kiV8XfRiG8ZVBzo3Etf9WwSTBM8tqaQXXo/2pPvSic BGvvZvi+KhqO63cNquF5BlriUiMmzSb5AXsid2/8VIysfdW97eEIH85pxPaz6jRuDu5D TW6b2IWecKQs/Ex+v74lU5vf5LzSPp1j5HDXBBrfCY7I/33rzwDAdZl+Y/Z3B6RjBCvN RKcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LcahmIPj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si11607413ejm.262.2020.10.12.06.59.57; Mon, 12 Oct 2020 07:00:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LcahmIPj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390464AbgJLN4s (ORCPT + 99 others); Mon, 12 Oct 2020 09:56:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:48360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389426AbgJLNoE (ORCPT ); Mon, 12 Oct 2020 09:44:04 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BC87E221FF; Mon, 12 Oct 2020 13:43:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602510234; bh=3DrKcRe3aNaVQDELlKhC+Gj/MPcIqbyiT/Nvd5WmGew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LcahmIPjOohYYgb4XdUB1/t56U2joXFm6W95d/qheL8/coY563nAx0sN14xlKPvrd Hh9QuSyPYfBTZvVHECtgveu82FKRVFxLmug3JeF4qrfMBdLv2BZfvHDUjvr1frBOGx HOVi2JW4kBqEEC0dDrkwyCmcveh5MlbHJ4hSjDpY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Arnd Bergmann , syzbot+85433a479a646a064ab3@syzkaller.appspotmail.com, Peilin Ye , Jens Axboe Subject: [PATCH 5.8 012/124] block/scsi-ioctl: Fix kernel-infoleak in scsi_put_cdrom_generic_arg() Date: Mon, 12 Oct 2020 15:30:16 +0200 Message-Id: <20201012133147.448170605@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012133146.834528783@linuxfoundation.org> References: <20201012133146.834528783@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peilin Ye commit 6d53a9fe5a1983490bc14b3a64d49fabb4ccc651 upstream. scsi_put_cdrom_generic_arg() is copying uninitialized stack memory to userspace, since the compiler may leave a 3-byte hole in the middle of `cgc32`. Fix it by adding a padding field to `struct compat_cdrom_generic_command`. Cc: stable@vger.kernel.org Fixes: f3ee6e63a9df ("compat_ioctl: move CDROM_SEND_PACKET handling into scsi") Suggested-by: Dan Carpenter Suggested-by: Arnd Bergmann Reported-by: syzbot+85433a479a646a064ab3@syzkaller.appspotmail.com Signed-off-by: Peilin Ye Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- block/scsi_ioctl.c | 1 + 1 file changed, 1 insertion(+) --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c @@ -651,6 +651,7 @@ struct compat_cdrom_generic_command { compat_int_t stat; compat_caddr_t sense; unsigned char data_direction; + unsigned char pad[3]; compat_int_t quiet; compat_int_t timeout; compat_caddr_t reserved[1];