Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp718483pxb; Tue, 2 Feb 2021 16:35:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJy38zbk4mjjjKmw81Z1Pa/1lQ+ovfSGFJ5uqBZs6yyGqLVtkYAfCOlhe+KLx283Q1/SVa6l X-Received: by 2002:a17:907:c08:: with SMTP id ga8mr570512ejc.346.1612312509032; Tue, 02 Feb 2021 16:35:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612312509; cv=none; d=google.com; s=arc-20160816; b=A4zODJgUJbKSLOVUaLYE8K0wytJkQ36r46VxqB9ju9KK275nt/wA2t/9Z3v7wj4A9U MGF9bAEmFG27ffgd1w9fZTBMay24zLs2b0MgB3vBdJckyI95pM8iivBTzfek/fDrQQE6 aNqBiV5nTiGeb7zlV1ett8C1bApQJEdbzIT/JpOI7d9YxdP/LGdlPlZSJDkZUf7WEGpN d+vJesWPuSDyYxqh07yb17KnTboz074drmq098wKH2H/s97lx8d93JQcZP3A3i4tb56z KJhKZoR86ON19lD0HGFMPrebwPx/Fa5nfnjvvzEpvRbZOgfkRvT/Z0qbiC7khByx8O0R qKkA== 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=vfPNx8E782GmP+xSIZpbiYlxUw93vIjboLizZ5eJw1E=; b=ilBSEfXjUxewgHUmLeTx9XtK4OjZY/xUo1nL7tcgJsREf/jWbZ+MZGmqpUdi7fjC88 rB7WPiKfNl819nlHEova6dyygjNh2utVnZhraxV/Jvh715mBORkd9O38in3NhYqhcA9O 1kzqM6WHOpxl+0b9xM99i1RUXmREpkOhqrf+3RfZpiAgNbj5Px0es5s7Njxi6sD0vl1k V3pfBnqzYsvFuMcUhn36/JJIYRU9d+QVEkmmpbC0CzeXL2vwzPzQSTn/8AwdRcGkD6Ei P/w2TuVFDxumceKl4dhC0xXoBtowCwuJzRAIWwl8GuFVrNGJwAlvmWij9tyPmKFizZb1 mZlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yJvD03np; 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=pass (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 a10si218646edv.164.2021.02.02.16.34.44; Tue, 02 Feb 2021 16:35:09 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=yJvD03np; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238355AbhBBSQf (ORCPT + 99 others); Tue, 2 Feb 2021 13:16:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:47580 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233692AbhBBOGl (ORCPT ); Tue, 2 Feb 2021 09:06:41 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 99AB56501F; Tue, 2 Feb 2021 13:49:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612273774; bh=mUM0mgXCHkJNejNNkl1ETLUcnYyoPBasVulZeXoBvXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yJvD03npeoL6hdmhBGEQBTL1sBgJF+V9g4fw3+ykVgFvRakBysdnAvt+h/QF+SX00 8QVD8nqMHUbmrcK9IVgFSG2qSWJSLwfPUqWmUvJrAmz59EIO/w+Y3OlnoFtDfYaTW0 qHKijKoMsQp7qSa+zrD90Y9PDw0yAXI6sydNstLM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 4.4 24/28] can: dev: prevent potential information leak in can_fill_info() Date: Tue, 2 Feb 2021 14:38:44 +0100 Message-Id: <20210202132942.158736432@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210202132941.180062901@linuxfoundation.org> References: <20210202132941.180062901@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: Dan Carpenter [ Upstream commit b552766c872f5b0d90323b24e4c9e8fa67486dd5 ] The "bec" struct isn't necessarily always initialized. For example, the mcp251xfd_get_berr_counter() function doesn't initialize anything if the interface is down. Fixes: 52c793f24054 ("can: netlink support for bus-error reporting and counters") Link: https://lore.kernel.org/r/YAkaRdRJncsJO8Ve@mwanda Signed-off-by: Dan Carpenter Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 45f15ac6b1015..1a79118b008b1 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c @@ -987,7 +987,7 @@ static int can_fill_info(struct sk_buff *skb, const struct net_device *dev) { struct can_priv *priv = netdev_priv(dev); struct can_ctrlmode cm = {.flags = priv->ctrlmode}; - struct can_berr_counter bec; + struct can_berr_counter bec = { }; enum can_state state = priv->state; if (priv->do_get_state) -- 2.27.0