Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6549433ybx; Mon, 11 Nov 2019 10:47:00 -0800 (PST) X-Google-Smtp-Source: APXvYqwix3kHBs9u33iac4ttf0Q+6OX7wmmTkwQSnYtW+FI3U/agVqtmHHKHGssw7O7kZyjd5IO7 X-Received: by 2002:a50:9fa4:: with SMTP id c33mr28038611edf.176.1573498020686; Mon, 11 Nov 2019 10:47:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573498020; cv=none; d=google.com; s=arc-20160816; b=Lz5qAqsUZ7+HfNWbmyxStsaMF/KSdo2r49RStq9kMIFcTq0v94FeCu3bi6paEWqqcV kxyxxvm9w9V6e88yVC8bwMkapkLgoGgK8KFg84uIfBr3yAgb/B3q5+wqaflKMzAkryGP iagfJY3vXcpWRi+IP2kXaNJyU7m36AMuwC7vLMp1lBaLRFT6Af3AiQdZGsGq5y9Rlr4t kY+B9+nRMRKulOzpdBK9kzRdK7++7LGLTnfQMr/pvVRFZbMx/O5s5z8Mg6tdwjJxrr0C B9MhUhI0FsFN1mrsihs4zc26nUDvOwcWosCAdW+k3d5EKFJHIgm+7BkIaWgR6qMvIGSU GEIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FPQYYBnHJFhAWPkPUGTlrs58XLl7b/VGiUkFee/csXU=; b=nRbnxkaMDo/Ro/MHY8DDGdnxqkmK8x3XkHDzmD6Nybtyp/q87b7KcvCtCC4Fta1r2a hkKo1Y8IhStM8NcFo23hoccC2ghUTPhsBEgbjgx9+IBQR8FVg5jg7VoYEz2d3sLH8eat 2Nz3GGFhD2Kc1pQx5OEVBTsF9/LwPTqLAd9BLQ65273dxp/Wn3XZVbqycO2rjHSCKVN2 /2fTV/bdLqwoU5/Hvm3STZMY/w/ebo1CA0RLb6nFvpVN3YYS+l7PFWsZsAPvF7MlIUnP dqm8Voh5gmNUVZ6VDJXGrJM5BjXCeyEEO6G0U6jVa4r1zw3QDa97IZWF+bs2HT4MUM/S Nl2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aTYw4TCR; 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 e47si11405795eda.73.2019.11.11.10.46.36; Mon, 11 Nov 2019 10:47:00 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=aTYw4TCR; 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 S1727543AbfKKSmq (ORCPT + 99 others); Mon, 11 Nov 2019 13:42:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:33970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727520AbfKKSmo (ORCPT ); Mon, 11 Nov 2019 13:42:44 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 7C6D721655; Mon, 11 Nov 2019 18:42:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497763; bh=e5fGjKC5doeQl5lfiI/9I0APVgbO57C6bfP4IPd3Mrw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aTYw4TCRcgKKE5JjUJd1id7AtzFWOYhN/UWBeoIGbcsFiGWPNynZtmc8LJLTmPLhv PtJQH5TjhN98yWApG5t/KBohkNEekYgwVvWNWp3GYWHDm0GPB8uxcx28wqsApm+b4b E+LjfTqMjhm4W3jDyfMeavFE7y/gCL43nwwN+0N0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+863724e7128e14b26732@syzkaller.appspotmail.com, Johan Hovold , Marc Kleine-Budde Subject: [PATCH 4.19 051/125] can: peak_usb: fix slab info leak Date: Mon, 11 Nov 2019 19:28:10 +0100 Message-Id: <20191111181447.158385769@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181438.945353076@linuxfoundation.org> References: <20191111181438.945353076@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold commit f7a1337f0d29b98733c8824e165fca3371d7d4fd upstream. Fix a small slab info leak due to a failure to clear the command buffer at allocation. The first 16 bytes of the command buffer are always sent to the device in pcan_usb_send_cmd() even though only the first two may have been initialised in case no argument payload is provided (e.g. when waiting for a response). Fixes: bb4785551f64 ("can: usb: PEAK-System Technik USB adapters driver core") Cc: stable # 3.4 Reported-by: syzbot+863724e7128e14b26732@syzkaller.appspotmail.com Signed-off-by: Johan Hovold Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- drivers/net/can/usb/peak_usb/pcan_usb_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c @@ -758,7 +758,7 @@ static int peak_usb_create_dev(const str dev = netdev_priv(netdev); /* allocate a buffer large enough to send commands */ - dev->cmd_buf = kmalloc(PCAN_USB_MAX_CMD_LEN, GFP_KERNEL); + dev->cmd_buf = kzalloc(PCAN_USB_MAX_CMD_LEN, GFP_KERNEL); if (!dev->cmd_buf) { err = -ENOMEM; goto lbl_free_candev;