Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2105923ybb; Thu, 2 Apr 2020 13:14:33 -0700 (PDT) X-Google-Smtp-Source: APiQypIs1pmALbM4UO+3Vd8+H2KDzRwIZxgnGhJJX8T9+yM5xfb3vF3zQXRlKClkkzGMX+p/EUZi X-Received: by 2002:aca:3b41:: with SMTP id i62mr582567oia.55.1585858473241; Thu, 02 Apr 2020 13:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585858473; cv=none; d=google.com; s=arc-20160816; b=oF/wwxjFLqcVhhHK+fGlN/vrs+VvMcTX2WEzUSlD3WJvfCAaxqvXiyuTes9esdUDid h0wDADtz8YclhBBmo2CEC8JwLvDgvaVypVwQI6oWWPwsC7l4tio8eCEW+87NyM8PKlIf ibapOM1JTDuhmalbcuQiKsncuGSUCmLSsMPIueXiFXmBeI6A0JHMf+gCwNYKfznodrkF wIiHTfE6t2SqnXquSJfxEw3uh10rc2LyQR/Xojzsvz5N6LkBLobSy2U2Zqe2Q63kUOC0 cgKZKCmshEz9DFTMgj8E4G5pRIxjbyA22SgMu8JX6a0koeg8Q/TH6Ld3oiEnh1uD79Ma hVUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=4vdz7xAqwi74chRFAbVvaOzSXTmAuaXsGQr89Wq5h4Q=; b=xw/zO8LdIWhguil4gUhoYiyruMU15dFWsZTMzEM7ik8/s5npfuEli7anDLPhrhz+Uz hvmVdr8hED5hCKUtSJNmvLjjhL/LnkfhbSIfjtkyTenUsjvvsKHagWFtXqLveCT3KaC9 8vZEEcXfqVUM32vuf0ks6BX9rkdbFySekq1BPZdzsG9WCboxJPifoOhFetjLOUaFK6i1 qU1xsDMjBrWSCvEcPEMAXIg1CRTRI/gZj66NjfOHhUzaNeYfDabC1T5+ofUnK/vreT1c rj/WOhjTyo49PVs2aMSdzpP+s79bamqbB4GCZI4a4RhwuCKZ/42Yi3CPKk06AdAd5z1X Zhdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kS2l3M9Z; 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 q19si2547724otk.11.2020.04.02.13.14.20; Thu, 02 Apr 2020 13:14: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; dkim=pass header.i=@kernel.org header.s=default header.b=kS2l3M9Z; 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 S1730837AbgDBUEn (ORCPT + 99 others); Thu, 2 Apr 2020 16:04:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:58204 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388781AbgDBUEn (ORCPT ); Thu, 2 Apr 2020 16:04:43 -0400 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 D95EC206E9; Thu, 2 Apr 2020 20:04:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585857881; bh=SLau+LKmZYm2Wl1sqETl68Y6B4wiD4ofzcVkxfGGCxg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kS2l3M9Z21CypL26NC8ZFD56/5M2Imd9mOvSze8VhnzIW42lVdcInG0Y6YOLt6o3O X1i7VfWrX0gvQdaL78DUzkqahMxXEfAhTTcrX5sYoL9VmRMtU2WJx120EnX0ZOKHhw B7a2CODcDREViM/pGwbiWjB3Xha/t+WlfXlC2Tao= Date: Thu, 2 Apr 2020 22:04:37 +0200 From: Greg Kroah-Hartman To: Pavel Machek Cc: 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: <20200402200437.GA3251457@kroah.com> References: <20200401161542.669484650@linuxfoundation.org> <20200401161555.630698707@linuxfoundation.org> <20200402185320.GA8077@duo.ucw.cz> <20200402192053.GB3243295@kroah.com> <20200402195324.GB8077@duo.ucw.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200402195324.GB8077@duo.ucw.cz> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 02, 2020 at 09:53:24PM +0200, Pavel Machek wrote: > Hi! > > > > Should we fix gcc, instead? > > > > 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 = {} for > structure init... > > Should we get "= {}" warning for checkpatch? Only if the structure has padding, and it is data to be sent to userspace, or to be intrepreted in a way from userspace. Good luck trying to write a checkpatch rule for that. greg k-h