From patchwork Tue Jan 10 01:39:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 41246 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2487785wrt; Mon, 9 Jan 2023 17:40:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXu8vF/MZaqL/6NZOC6gVDx++vjD+LODZV5u09UKqRWgjJ0X8+uFb+2gNDrfOrZUuvAvXTlb X-Received: by 2002:a17:90a:7849:b0:226:3a7c:f248 with SMTP id y9-20020a17090a784900b002263a7cf248mr43194547pjl.24.1673314858805; Mon, 09 Jan 2023 17:40:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673314858; cv=none; d=google.com; s=arc-20160816; b=ouZtCdf9s9LhqK7N9+HcDCg/r5yJ4qlOQX6oXOWMjEjOmu8ryGRyqNIaU89ecUpq2y H+5WbZNuGxesNdL6eOC5dfpl1TC0Q52gjkHZzaDQ9qGELL1ZEwFCnDtIS8/IfxJHskOd r58PTG4znC9w4lGepxlOtxtfjYM2cvLadhU9J13Q+OoN2bpucXwQv7oykchN1AWQNxoH VGX/mBloNTPLDa7cjnLfOzQHSrQIjmzYWsUW2wXFpyT1wtOqE2nT7myPYMOv0++nPWd9 6yRo/r2JS+9+7L+fHRm0Lis2fioy2Oitrt9BDi8i0pqjx5PLSoU2MQoGjbM7Qlnmq/vM 963w== 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=uKIUcjrtJhW+vyG7/ZJHXMd9HJQ421n4ETAjfgZxu/p31Vb1xV8aR10t1jglGHR8Bx ZUvph56KMKfAaPTH5R/4Dh+Th9q7vstQMNOsZTzfrLnHT6IiUkMwz/e4iFSa5+ePcAnH dIOzUN0V3aHFr9rg1Lr/zVjfVtCKPhtGrTfSUS1BSDzLtLIH9R6tw6gziOX5f5K3iQZa 1NYesx0j1UeVDsz89maArLTk2SQh5mkCRG/jkOq2GMkZhTii8fCovZ474eAdbmQ0GLCy d+p9xbE+VPg9nFlnkyKNuVwqApirqUELrXXz7xK6WVEc7arIm7MPIpS4HW0zxTLd2AWu 1hTA== 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-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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q4-20020a17090aa00400b0021812e71e68si9830776pjp.84.2023.01.09.17.40.45; Mon, 09 Jan 2023 17:40:58 -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=@kernel.org header.s=k20201202 header.b=s0zcsXJ1; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230256AbjAJBjQ (ORCPT + 99 others); Mon, 9 Jan 2023 20:39:16 -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-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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754597801235180116?= X-GMAIL-MSGID: =?utf-8?q?1754597801235180116?= 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 Reviewed-by: Neal Liu Reviewed-by: Kees Cook --- 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 {