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 810FDC63797 for ; Tue, 10 Jan 2023 10:46:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238103AbjAJKqX (ORCPT ); Tue, 10 Jan 2023 05:46:23 -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: Precedence: bulk List-ID: X-Mailing-List: linux-hardening@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 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AC442C54EBE for ; Tue, 10 Jan 2023 10:46:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6DDC210E58E; Tue, 10 Jan 2023 10:46:15 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0B36010E58E for ; Tue, 10 Jan 2023 10:46:12 +0000 (UTC) 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="350336529" X-IronPort-AV: E=Sophos;i="5.96,315,1665471600"; d="scan'208";a="350336529" 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" 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Oded Gabbay , linux-hardening@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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