From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F459C43217 for ; Fri, 18 Nov 2022 22:39:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231443AbiKRWjM (ORCPT ); Fri, 18 Nov 2022 17:39:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229720AbiKRWjK (ORCPT ); Fri, 18 Nov 2022 17:39:10 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCEAED112; Fri, 18 Nov 2022 14:39:08 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 24BB0CE224D; Fri, 18 Nov 2022 22:39:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48F4AC433D6; Fri, 18 Nov 2022 22:39:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668811145; bh=7G8ECLw1ELEqxR6Z8QunxLZvnkLl+Xk4JcotDxWZGTU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MqNvnouuMLsZXAjO0uvS7Uenbre81ICnQjgiFWQrB1S4P4QV5UroFyWsFOR9omKaU FfoR3j0xrx0dXV432YtcMzMicjMJ+QMLDygQqlkFgXa5etVWZUhb3Sshx9uyHyDxan qVti8010/ZiFLOu5kV6rH98JcPZHh+XicKWuEbZdpK349/257mTO/mMH01LaVvWtHR 4oE/WZ5fd00M4qjPRfRCjKBifoKM1v5VcfyUuAIvkmrz4LLw3NfRiNO7f7BsiyGIUv 9w1R0Hb5afE94Nj8iEUWt5kai2gIS4mbuqs3+9ut6MblR3c2XMNauYsemh9kcpFL2g YQcZJsXBui2AA== Date: Fri, 18 Nov 2022 16:38:52 -0600 From: "Gustavo A. R. Silva" To: Kees Cook Cc: Ben Skeggs , Karol Herbst , Lyude Paul , David Airlie , Daniel Vetter , Gourav Samaiya , dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] drm/nouveau/fb/ga102: Replace zero-length array of trailing structs with flex-array Message-ID: References: <20221118211207.never.039-kees@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221118211207.never.039-kees@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 18, 2022 at 01:12:08PM -0800, Kees Cook wrote: > Zero-length arrays are deprecated[1] and are being replaced with > flexible array members in support of the ongoing efforts to tighten the > FORTIFY_SOURCE routines on memcpy(), correctly instrument array indexing > with UBSAN_BOUNDS, and to globally enable -fstrict-flex-arrays=3. > > Replace zero-length array with flexible-array member. > > This results in no differences in binary output. > > [1] https://github.com/KSPP/linux/issues/78 > > Cc: Ben Skeggs > Cc: Karol Herbst > Cc: Lyude Paul > Cc: David Airlie > Cc: Daniel Vetter > Cc: Gourav Samaiya > Cc: "Gustavo A. R. Silva" > Cc: dri-devel@lists.freedesktop.org > Cc: nouveau@lists.freedesktop.org > Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks! -- Gustavo > --- > drivers/gpu/drm/nouveau/include/nvfw/hs.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/include/nvfw/hs.h b/drivers/gpu/drm/nouveau/include/nvfw/hs.h > index 8c4cd08a7b5f..8b58b668fc0c 100644 > --- a/drivers/gpu/drm/nouveau/include/nvfw/hs.h > +++ b/drivers/gpu/drm/nouveau/include/nvfw/hs.h > @@ -52,7 +52,7 @@ struct nvfw_hs_load_header_v2 { > struct { > u32 offset; > u32 size; > - } app[0]; > + } app[]; > }; > > const struct nvfw_hs_load_header_v2 *nvfw_hs_load_header_v2(struct nvkm_subdev *, const void *); > -- > 2.34.1 >