From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D483D3481 for ; Fri, 30 Jul 2021 19:18:28 +0000 (UTC) Received: by mail-pl1-f175.google.com with SMTP id i10so12255442pla.3 for ; Fri, 30 Jul 2021 12:18:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=GxQ+HQk3cdftqAN6ekEINRB7/ckK/Y3btr+5Ktub3O8=; b=WS5dYESChuBnCxT0C846oXNdS39ELe0+GVYff+8CDiB/+f/gvQwIUAsaHdpyWtgQI9 Ksdmzxs2AfVddKWJDuxET2t1XvdH74XtC3HtYpRTl4M2aix9P85mPUTWk0m4skcu2rUY hkzUA5m/uNIuqcBh7EgcpFhsleAuHbj8eKL2s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=GxQ+HQk3cdftqAN6ekEINRB7/ckK/Y3btr+5Ktub3O8=; b=jJjhuvo2dQg51dfHC0TuRzTeAh/njhlF1EjCSPd5+o0/noJ/CSJa80MzZ1lA5uV+gi GWkF39J/4OCxQzvOI4lRW4jZzP6Yjo190qf3mRGCmjd8eWvHrYLqS4SttQxG2M+UJp/E 2nhz3JrVpT1jRM+Zq8UhWOmkd4InTfhSyKmueo2o/Sr7GWMJT7lzplQIjAisrCWurHVM C1W7O3PbgWMOVd5HaaVuXDEz1cGatvPjwHRRagf4JS/8Mc5Ry0W29RFH0MaclJT7plLd ioda1qiTNAk83eZBnk2Flkh0oCfeIV4sa+4ovAiw+ByND3tyE+xSg/evmkGlj1mOSwM2 Zx1w== X-Gm-Message-State: AOAM532kX3COfN+nvB9jzMNjxRyQ3M7SWLIBy2V4VZvh0xl+1DhVC7T7 l8U01u+Pk5d0Ug5Y5vKECZQsXA== X-Google-Smtp-Source: ABdhPJyCK3+AR/s/Pq/itPZjFA3DL77BZcO4l8s7xQqT+jnGem6TdAj1wqpo6cwifM6sSr5c8f1XQQ== X-Received: by 2002:a65:498a:: with SMTP id r10mr500564pgs.7.1627672708339; Fri, 30 Jul 2021 12:18:28 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id 26sm3040727pjj.27.2021.07.30.12.18.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 12:18:27 -0700 (PDT) Date: Fri, 30 Jul 2021 12:18:26 -0700 From: Kees Cook To: Nick Desaulniers Cc: Dan Carpenter , dsterba@suse.cz, Greg Kroah-Hartman , Bart Van Assche , linux-hardening@vger.kernel.org, "Gustavo A. R. Silva" , Keith Packard , Andrew Morton , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-staging@lists.linux.dev, linux-block@vger.kernel.org, linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com, nborisov@suse.com Subject: Re: [PATCH 01/64] media: omap3isp: Extract struct group for memcpy() region Message-ID: <202107301217.46EA9DA@keescook> References: <20210728091434.GQ1931@kadam> <20210728213730.GR5047@suse.cz> <20210729082039.GX25548@kadam> <202107291952.C08EAE039B@keescook> <20210730083845.GD5047@suse.cz> <20210730090054.GX1931@kadam> <202107300937.C7016A82@keescook> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Jul 30, 2021 at 10:08:03AM -0700, Nick Desaulniers wrote: > On Fri, Jul 30, 2021 at 9:44 AM Kees Cook wrote: > > > > On Fri, Jul 30, 2021 at 12:00:54PM +0300, Dan Carpenter wrote: > > > On Fri, Jul 30, 2021 at 10:38:45AM +0200, David Sterba wrote: > > > > Then is explicit memset the only reliable way accross all compiler > > > > flavors and supported versions? > > > > > > > > > > The = { } initializer works. It's only when you start partially > > > initializing the struct that it doesn't initialize holes. > > > > No, partial works. It's when you _fully_ initialize the struct where the > > padding doesn't get initialized. *sob* > > I'm pretty sure that this has more to do with whether or not the > compiler applies SROA then observes uses of the individual members or > not. Ultimately, it's just not consistent, so thank goodness for -ftrivial-auto-var-init=zero. :) -- Kees Cook