Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13468952ybl; Sun, 29 Dec 2019 12:37:39 -0800 (PST) X-Google-Smtp-Source: APXvYqyPpUh9OqjflRjjr0s575IQlS+6PqonwSJuCZCZux3EUD/JsE8gCAONIo0xHhBDf5JT05nW X-Received: by 2002:a9d:3f61:: with SMTP id m88mr53286217otc.56.1577651859626; Sun, 29 Dec 2019 12:37:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577651859; cv=none; d=google.com; s=arc-20160816; b=ctgR1W6LH/hHLenky5fu+ShkvK7mO0JGu0nCVkE/55vG1vhp7UchACgE3BkCi09d+9 QPNcMHzR2U8F2OEAVuFOq7wjVyn7eHD41aYFKiP1ERzS3QCJZTTwfnxClrkmiug0HVs+ qDKbZSqkXQKIbcvgxB5n0T0ceT3D1ieV8nCVXS8sBxg9I/RLf6DC7yYCGJYXygYcO6JH XlsS+QpbViGjqUbwkCcBYCq/nAJvmE/5ylxBvZ4SzHUUw/q6LT9srVcWOjmmXZRDedjd Vv7LSMfHwvb61SCq9lKcoQBuKl+d8cqyv48f4lHrgJbMw3PbyqlnP45Z8kYMYcWgm18f iCvg== 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=ZOSGrLv0ZizBuKtZunVZ+JPcugXpXie1opKJ26y62zY=; b=ylNxWnVLzraN8ctad9+cofSO3IG7/atM7L+gWEiZuuC7Ewh2ID8koRCVy1ZYnFobl2 VXBXya0padBsV2PSIqx8zjeHq6Wx9uwU6q8P5vfLShxF/XfqPVRA2qi7IAr34LpemDwn g90VjJBqqciNtRqnnXpTOIOcY4cm6HfjsOiuxC2xLV/Kw04zZGSG7WtxOAlAIQhXC5uT +yTRqrW+lZmckH/+qSJkVAGX2UuriwcIoIinZJb1tr36eVbYO74uVpYiLgVMzoU0gqH8 25q9+82cGEKAnVL1mb+GOav4GRB9qqM/wZOrFiZ3Qm/d95NbQN8Q3PHGJRhehwNb38jj c/sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i8tmatJ2; 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 j18si22399004otq.275.2019.12.29.12.37.28; Sun, 29 Dec 2019 12:37:39 -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=i8tmatJ2; 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 S1729846AbfL2RfW (ORCPT + 99 others); Sun, 29 Dec 2019 12:35:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:39516 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729362AbfL2RfR (ORCPT ); Sun, 29 Dec 2019 12:35:17 -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 D7332207FF; Sun, 29 Dec 2019 17:35:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640917; bh=nFsxqlSW5MdU86iOP42+FaKJBOzsfHU8mpAvyNypAEk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i8tmatJ2ULk4TpY7w12TeOL0OPljzGbhyhrdSxnaFhAfBSCD2aPSEJ3uMTbCQMe6j BVoIay4iHghN0YCmzDi7bwuUiJkPSVqwA1CGazpzLwpuriyyaGI2yoneozkF+mPlbZ BVQ/RxITy2o3c8CL0QG0Khz/Ov6b9NDDHNrXWWuM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiaolong Huang , Marc Kleine-Budde Subject: [PATCH 4.19 192/219] can: kvaser_usb: kvaser_usb_leaf: Fix some info-leaks to USB devices Date: Sun, 29 Dec 2019 18:19:54 +0100 Message-Id: <20191229162538.700059491@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162508.458551679@linuxfoundation.org> References: <20191229162508.458551679@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: Xiaolong Huang commit da2311a6385c3b499da2ed5d9be59ce331fa93e9 upstream. Uninitialized Kernel memory can leak to USB devices. Fix this by using kzalloc() instead of kmalloc(). Signed-off-by: Xiaolong Huang Fixes: 7259124eac7d ("can: kvaser_usb: Split driver into kvaser_usb_core.c and kvaser_usb_leaf.c") Cc: linux-stable # >= v4.19 Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c @@ -608,7 +608,7 @@ static int kvaser_usb_leaf_simple_cmd_as struct kvaser_cmd *cmd; int err; - cmd = kmalloc(sizeof(*cmd), GFP_ATOMIC); + cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC); if (!cmd) return -ENOMEM; @@ -1140,7 +1140,7 @@ static int kvaser_usb_leaf_set_opt_mode( struct kvaser_cmd *cmd; int rc; - cmd = kmalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -1206,7 +1206,7 @@ static int kvaser_usb_leaf_flush_queue(s struct kvaser_cmd *cmd; int rc; - cmd = kmalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); if (!cmd) return -ENOMEM;