Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp723377pxb; Tue, 2 Feb 2021 16:44:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzagBKWJRD9dfRMsmcQjDAQ8A1xzpcoLHpxZ9i9wAHD6pGOdsdUbt43XTtPLxTbdzSgtYp3 X-Received: by 2002:a17:906:4694:: with SMTP id a20mr564528ejr.201.1612313094063; Tue, 02 Feb 2021 16:44:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612313094; cv=none; d=google.com; s=arc-20160816; b=GKpb9WfvUy124oFmjHSPU3/XpgOtgbh1yq0pHtD7Ym28LM5jCuk5JdD9hl/mFB9Aij FmuN4yEQyPtJ8CeF2WRNNcchCKk+0FCBw3shnfoEjGDMf65Jb2xhaxzVTz9JC5A0i0eo swonj8rTshbtoeesvENeB3uttQTFRv9UwZ4dAjirmKpwerdFvJ3bQFF5m9TriThY5ofp STnM6wIoRQTemRPwibdwY4Q2v1pihJnlgNr2xgn2OSswdm+EqCDSFwDulO39NlV+rCCS Jd2KNmwALXVSHrwQprOQ68kogH2FhXqn5MCE9I22AO8ACbiz4tKuWAaGz8qeJRR29ar+ iNXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=GcmqobQK3cuHcPRjqTAZezriyHEQBE6OTLt7xDBxPu4=; b=OzvbPoWs0wjyFtTErFN2raTgePCGX+idRBud15o5t5Ygocscpt1NCaQyA1ZwXkEQEy NcdOOXIR5aFYPzIqBxj2WiRN0H1cf38Rp7rOT3b3I+34bZdSIK5XIAoZyQTsNjk/ZV6t 9Gk9eFN1B9ZzTtsANgx2qTZ+ctcsH0jIAyosdbwz0yA0Z5vqi8FfVXzLhXukK4AnAa6O TJgVZOqdpwfRfIMjVSUIwH0lRgfrzaUqQdRDjQdc0QZHBii6mvNHcy5rYEdxMFdOrqJh VfvY6if7D50sgInZL0f/AIBjzSvJEjdkcGng4RrNRWPOI4jXKFYLDpq4nSifKlP3EnNh 1UNg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o26si238313edw.74.2021.02.02.16.44.29; Tue, 02 Feb 2021 16:44:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238953AbhBBS42 (ORCPT + 99 others); Tue, 2 Feb 2021 13:56:28 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:38536 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239109AbhBBSyQ (ORCPT ); Tue, 2 Feb 2021 13:54:16 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id E21E11C0B7A; Tue, 2 Feb 2021 19:53:17 +0100 (CET) Date: Tue, 2 Feb 2021 19:53:17 +0100 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Dan Carpenter , Marc Kleine-Budde , Sasha Levin Subject: Re: [PATCH 4.4 24/28] can: dev: prevent potential information leak in can_fill_info() Message-ID: <20210202185317.GB6964@duo.ucw.cz> References: <20210202132941.180062901@linuxfoundation.org> <20210202132942.158736432@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="61jdw2sOBCFtR2d/" Content-Disposition: inline In-Reply-To: <20210202132942.158736432@linuxfoundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --61jdw2sOBCFtR2d/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > From: Dan Carpenter >=20 > [ Upstream commit b552766c872f5b0d90323b24e4c9e8fa67486dd5 ] >=20 > 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. Well, yes... and =3D {} does not neccessarily initialize all of the structure... for example padding. It is really simple struct can_berr_counter { __u16 txerr; __u16 rxerr; }; but maybe something like alpha uses padding in such case, and memset would be better? Best regards, Pavel =09 > +++ b/drivers/net/can/dev.c > @@ -987,7 +987,7 @@ static int can_fill_info(struct sk_buff *skb, const s= truct net_device *dev) > { > struct can_priv *priv =3D netdev_priv(dev); > struct can_ctrlmode cm =3D {.flags =3D priv->ctrlmode}; > - struct can_berr_counter bec; > + struct can_berr_counter bec =3D { }; > enum can_state state =3D priv->state; > =20 > if (priv->do_get_state) --=20 http://www.livejournal.com/~pavelmachek --61jdw2sOBCFtR2d/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCYBmfnQAKCRAw5/Bqldv6 8l+nAKCXX2HX1zDQVMwPfg4kQfgvTPa2MACdFZcCo092ceOgDfdTEFoHc2wmi10= =Ol11 -----END PGP SIGNATURE----- --61jdw2sOBCFtR2d/--