Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7075825rwl; Mon, 9 Jan 2023 17:41:05 -0800 (PST) X-Google-Smtp-Source: AMrXdXvY58xP2Zbtdr88m1EN8wo8VxqrhWTG8y3/fO/MVOnPvKWXWBUtjvcvrgwX7TR+nwlcFeWS X-Received: by 2002:a17:90a:bd11:b0:225:b29f:42 with SMTP id y17-20020a17090abd1100b00225b29f0042mr72545356pjr.14.1673314864900; Mon, 09 Jan 2023 17:41:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673314864; cv=none; d=google.com; s=arc-20160816; b=HXcuc3dzpkFhgqt+HcrGv39Lz41o7cQp1A17hUo2XfTaS2ytys7lkc29s2SdnaZ+4A OJAvZfQXDPEZPG09DykheCMKQ4R07EYc+h3bfYeHmZWTH9O96dvBQc9M7pQOTZYD+K2D JfIV3CUqhFC+6GSSdclDdSTFKO8rnRS7xUNBG9V8SKtNHq5aJamAtqdrGQeuHzQAfG2g mkNlJ2lfvNsyU0XlNaTcWY4MOGmiw4nQYBV4Di9I1mJwyLPB8bYMfEWDE6CmHXHc7mzy XkTpPetQzkQ5TKwmIRGx76teNChQLdDupQt+9/yn8S9B6dAp4grUmVHhh1k4BdczKTVI 1JIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=Kf66HkhGYKuFNhIoW7EMcRlNd8Mq3RR/L451cSmYOu8=; b=bx6/Zc1GCaUUA0JPigekW0P9w1s7rwagncHJbiaFSbSc0g/mi5M9tVY+7sI9lYJPmE bDDHcM6DcDA0kTsqs87oGkAfcPz9kfQEoK48jHcp+bRlLm3660YC6NkD5gFwibVxkRJD N1i5wRi9yWZszXh59Jami30IY2Tls1o4hhkMNuJWhP7UZFTVJR6WfEtWUA+fLFElByMj 6zCYb2IbFUQtVQzROPZsWPUwS9u6qtgRLtHTMfjExSXVC7JwBwhKPLmd40Q1kRhDYLUD zoH0pygrGXIBUGy9rASJRapU2Mx+lw9hCNPxJmfEpfGyuAzwaceWx9LaT6XNK7GvxlKq B5/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s0zcsXJ1; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lr18-20020a17090b4b9200b00228cb3af4aasi776704pjb.99.2023.01.09.17.40.44; Mon, 09 Jan 2023 17:41:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-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=@kernel.org header.s=k20201202 header.b=s0zcsXJ1; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230179AbjAJBjO (ORCPT + 99 others); Mon, 9 Jan 2023 20:39:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230317AbjAJBjN (ORCPT ); Mon, 9 Jan 2023 20:39:13 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 578211AA1A; Mon, 9 Jan 2023 17:39:11 -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 dfw.source.kernel.org (Postfix) with ESMTPS id DE787614A3; Tue, 10 Jan 2023 01:39:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8EACC433EF; Tue, 10 Jan 2023 01:39:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673314750; bh=2kOxmVscJ0t8ceI4B5aGjHT1LyF2wAdxmeKbbucTgVM=; h=Date:From:To:Cc:Subject:From; b=s0zcsXJ1bYO8TaF0VS1YgBT615bIXmHXZD4oEytBCR1eBws6SdPfRKfb8iCQy2bwi owhRi/eU+e6OrfUiuL2KvlT9gPe2e84ZwDdTAgXGaJRJqaZ+3zYlII7zET63AuuacT OOLOQ5vkrHKQ+qCH5knAXbqMsy8ANjQm+QP7HRZ8bGYHHAu0TPQk7gdLxl8bsPX+d9 7Kl6R4WnMAEbXJE6xSR3P2eLOirCsBz8gUBHRq+0oN+5DNjocpnMFuTpR/zSs8yyuB 7hTz7g6pKLdX3dp9DEPrlcEIS7JV4OTc869bVmm5Jluoh6O0akYlKjOhE+gq9/w2Cn LDLPR+Yi6q1kg== Date: Mon, 9 Jan 2023 19:39:17 -0600 From: "Gustavo A. R. Silva" To: Neal Liu , Herbert Xu , "David S. Miller" , Joel Stanley , Andrew Jeffery Cc: linux-aspeed@lists.ozlabs.org, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org Subject: [PATCH][next] crypto: aspeed - Replace zero-length array with flexible-array member Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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-crypto@vger.kernel.org Zero-length arrays are deprecated[1] and we are moving towards adopting C99 flexible-array members instead. So, replace zero-length array declaration in struct aspeed_sham_ctx with flex-array member. 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 --- drivers/crypto/aspeed/aspeed-hace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/aspeed/aspeed-hace.h b/drivers/crypto/aspeed/aspeed-hace.h index f2cde23b56ae..05d0a15d546d 100644 --- a/drivers/crypto/aspeed/aspeed-hace.h +++ b/drivers/crypto/aspeed/aspeed-hace.h @@ -183,7 +183,7 @@ struct aspeed_sham_ctx { struct aspeed_hace_dev *hace_dev; unsigned long flags; /* hmac flag */ - struct aspeed_sha_hmac_ctx base[0]; + struct aspeed_sha_hmac_ctx base[]; }; struct aspeed_sham_reqctx { -- 2.34.1