Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2089030ybb; Thu, 2 Apr 2020 12:54:34 -0700 (PDT) X-Google-Smtp-Source: APiQypIgDLkaymC4h5vXrw5ceSc+9gBoWwEtI8lDtPe1/socdikE0qB9SxJo1aWqJVg9BcWU5q3G X-Received: by 2002:a4a:e08b:: with SMTP id w11mr4170906oos.62.1585857273631; Thu, 02 Apr 2020 12:54:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585857273; cv=none; d=google.com; s=arc-20160816; b=E//zqo/Qi4NqDeGipww6OLtDo+niR4dZ9qH3Ol3ia05kZd+Tv1gEB/sncCndDHBzId xXcXsJFwM04zfchI1P0Zvn+5oA0dehw9hn8fn+PE79BsH98aSxLhFPyXGV0LbZuwiKIP V0wLkpmKzpBQO9az46B674B73p6jXM/UYciH4IJ7lhWNGh9oQS8PXpQtZ68cHrZraNvo zAufsHlYUUks4n+Y8UA7GUnlWCef9H9jFkDVc6yJi1U7EGQlZs0YNOmvqsAsSzQKmXih mBFSzeoIxAVItpIrPO937oP95jJZMG2iusFsMIFUm+pY6G86yYEat8OPOHbf6k+Vkl4h 5dIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=qZDRP8KnKWp42nJM1S+yGrqfBfMHZhDYuAM/slgLwM0=; b=j1vmlDzZCBlTcyO/CkIzgHhKl/15wViLK8UwFVAYS3DWplw8dpTU2VnvWytrzeT2DG c/8JYGDqiVWrBtEV5vnRmy4CBYYamU7p0y3GkF2oLC29CAjahwcz8TNhq2qlzOumEl2/ 55BffUVQ3nHwt7/5TpA4bdCDLDxy7XUOhFzbIOR4CSwYYg5vsNP306iifGmjNzsaNTzP dHG/hSlAQSxJK3nyhOTyqKhnPa6Dj63MQbtZPysELblMZvOr1NBzc7EZNO+xibBPFW/j nfB2hsZR+3CW4douNmZbursO6Hzc6VG+xAleeSYAgkHgUAdhyas8wJpuh3D7pfadWpqD e/+A== ARC-Authentication-Results: i=1; mx.google.com; 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 c19si3517915ots.118.2020.04.02.12.54.20; Thu, 02 Apr 2020 12:54:33 -0700 (PDT) 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; 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 S2388769AbgDBTx0 (ORCPT + 99 others); Thu, 2 Apr 2020 15:53:26 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:49410 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbgDBTx0 (ORCPT ); Thu, 2 Apr 2020 15:53:26 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id A654F1C3115; Thu, 2 Apr 2020 21:53:24 +0200 (CEST) Date: Thu, 2 Apr 2020 21:53:24 +0200 From: Pavel Machek To: Greg Kroah-Hartman Cc: Pavel Machek , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Maciej =?utf-8?Q?=C5=BBenczykowski?= , John Stultz , Alexander Potapenko , Alistair Delva , Daniel Borkmann , Yonghong Song Subject: Re: [PATCH 4.19 105/116] bpf: Explicitly memset the bpf_attr structure Message-ID: <20200402195324.GB8077@duo.ucw.cz> References: <20200401161542.669484650@linuxfoundation.org> <20200401161555.630698707@linuxfoundation.org> <20200402185320.GA8077@duo.ucw.cz> <20200402192053.GB3243295@kroah.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0ntfKIWw70PvrIHh" Content-Disposition: inline In-Reply-To: <20200402192053.GB3243295@kroah.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0ntfKIWw70PvrIHh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > Should we fix gcc, instead? >=20 > Also, this is allowed in the C standard, and both clang and gcc > sometimes emit code that does not clear padding in structures. Changing > the compiler to not do this would be wonderful, but we still have to > live with this for the next 10 years as those older compilers age-out. I agree C standard allows this. It allows to even worse stuff. I was just surprised that gcc does that.. and that I did not know about this trap. I was probably telling people to do =3D {} for structure init... Should we get "=3D {}" warning for checkpatch? Is it fair to replace "=3D {}" with memset() as soon as it is returned to userland, without testing that gcc "miscompiles" this particular example? Best regards, Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --0ntfKIWw70PvrIHh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCXoZCswAKCRAw5/Bqldv6 8ihMAKC1+WCBXYMpLVByngW+zSRcQ6dYTQCgsZPj1kGk3M52HSqBA3cV4hDWyYQ= =ixSY -----END PGP SIGNATURE----- --0ntfKIWw70PvrIHh--