Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7604788rwl; Tue, 10 Jan 2023 03:06:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXtqCSo1+Kvtz1hPo+KtL/nfiIyVhWKV6uW6roERcrjK1ExYUeO3Ud3qkLEZCjghm7K+3io6 X-Received: by 2002:a17:902:b493:b0:191:1fbf:cd4b with SMTP id y19-20020a170902b49300b001911fbfcd4bmr62763045plr.38.1673348780021; Tue, 10 Jan 2023 03:06:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673348780; cv=none; d=google.com; s=arc-20160816; b=JpYxjeZZJ5IoBG5blQO7ukYg9VI64zuONo9tDsO4gAyEXIlkedvRmx6M7hhurGn6oy gqOlVfXuA61q/Z77LT7gLCYi2F3ZeHm0d0rC4yCTPJ3DeufBAAEV0MYX/dmaXi2Wtai3 Z9aFX1K1MnwPRTt2xCslTwJ4tkG1qbcgVrfAUgd5BlbPl9tTgngjZeLlzrlEnJ6j8hOo lhp2i0A7dXagKWohYpHZ+59Jc0tIxe2ejqXLoDsgOJJnrRcjiQ3FbS1239uYkEi7AZIn VyzaoVMpfXoTsrWrTs9cwNpCt35HUcX88RaksQGY986y3sMdnBMLqJtBP+uiGF0M/oZA cX4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=o73mVL8G2zpzvp7VIKZqD/GRCKr/008vl4uPg2mwsUc=; b=LFJK3xiQ28FRbfpri1CvpeDGnhFa0R0J4By8cHRwXxokv4GTBv63JI2zE3UfgGY3gt h5TfJkuXwCPVmTSIlDTYLvAZrH1XngWLnUBuHnawueRe34/oDwmvc40qgbIwSbPXJwmt kYwQM6b8LNWa1f4Ap47P8CCeM8sRA23yi9B/2bw/nMsaLilVpm1c0kt6I4WTqhuQqXTw 7rNdFhMF1zEJ9CwcYkLNFn8XzrcwCSwxFBDlLT1fNewXPdtwj1KZrG5e5gN9PzTyCuvX e468CkU4oEQz56ibP27II67WpYrHFGBO0goQ+cNTrSU2WUxf64W3UsG+4d6aqU1e7xGS pNAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="HxtG2mh/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ik28-20020a170902ab1c00b00193287d238bsi6553281plb.440.2023.01.10.03.06.12; Tue, 10 Jan 2023 03:06:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="HxtG2mh/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238139AbjAJKqa (ORCPT + 53 others); Tue, 10 Jan 2023 05:46:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238086AbjAJKqR (ORCPT ); Tue, 10 Jan 2023 05:46:17 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BF621759B; Tue, 10 Jan 2023 02:46:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673347573; x=1704883573; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=9YZ2PeAZKlHibjJN9Eo/0ObT6UUPozn9XZoXqU5DOpI=; b=HxtG2mh/7cKp64Au7dU5reO+QIIZycNMGpE5gti429ZcuXDSrelEZVzc JUF72CiY4ZHhdYXTjYeciOYCJ+1423/a1jEfTvoMY20ssYZUWQ3O34RjK UIi/D2+s4ZzwPmuKkRD6OJEJj97uxJbkr7l3Z9ZvbUXRor3iq7Qylnwgs MB3aYKS7C8B0OWUebTA2HV8PtGkgdxTdW7WOI3YsAUtAW0gkymBkN5M/R hXsSlEsW2jrMSY4P/DQ+t644QUxDhQ7GHnW6/EzFk0W6ysvL44rLOYTbu DeIEw++huQQdyi521zu/LGf4tpd5oQH3janrYkRH+PWKBE/eLCieu9QgE g==; X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="350336527" X-IronPort-AV: E=Sophos;i="5.96,315,1665471600"; d="scan'208";a="350336527" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2023 02:46:12 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="799386901" X-IronPort-AV: E=Sophos;i="5.96,315,1665471600"; d="scan'208";a="799386901" Received: from joe-255.igk.intel.com (HELO localhost) ([172.22.229.67]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2023 02:46:11 -0800 Date: Tue, 10 Jan 2023 11:46:09 +0100 From: Stanislaw Gruszka To: "Gustavo A. R. Silva" Cc: Oded Gabbay , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH][next] habanalabs: Replace zero-length arrays with flexible-array members Message-ID: <20230110104609.GA1602079@linux.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 09, 2023 at 07:39:47PM -0600, Gustavo A. R. Silva wrote: > Zero-length arrays are deprecated[1] and we are moving towards > adopting C99 flexible-array members instead. So, replace zero-length > arrays in a couple of structures with flex-array members. > > This helps with the ongoing efforts to tighten the FORTIFY_SOURCE > routines on memcpy() and help us make progress towards globally > enabling -fstrict-flex-arrays=3 [2]. > > Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays [1] > Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [2] > Link: https://github.com/KSPP/linux/issues/78 > Signed-off-by: Gustavo A. R. Silva Reviewed-by: Stanislaw Gruszka