Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp931254rwb; Thu, 12 Jan 2023 14:28:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXve0m+E9WJJlQZiLkC82uCCcdAt3FcmpjhUPhzc4CnoLTq9jBXkDNsC1L1XOdrAREQ027Yg X-Received: by 2002:a17:902:7d94:b0:194:6432:f15f with SMTP id a20-20020a1709027d9400b001946432f15fmr2700029plm.48.1673562497071; Thu, 12 Jan 2023 14:28:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673562497; cv=none; d=google.com; s=arc-20160816; b=BwjZvbZCBiCl6StUWpmzYmrZfkoPGU1CwEtTC6O/2kBb6WuuBxGfgrAodbcGTta6aB UyYhtKvGvmYPYNXC9ASXDNvNMD4VcqCkm5ybHs43zbIrIDsaFneFPxLg3vjv3/YrotZa Edsha5LG4fdT/3BwXk1Z6uxdSh3ESK4Trel9ncS+EKXtWsEa5NzIYD06lPH5NQFsSghM 5xHLhuIL3/nZ4+HO4kjaUnm7tpgz88ZeUh9nVA4NEv/3UXFB/Bkh4/mYs0th2n+pTUSB ehqU6sikhZ3aOo8rfV9Ie+TDrkbQqm1u59s79yOIGvt2jT1OhS/2jpyjYr5koLt/rdlW qLUw== 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=duA6Un7MMHsWwDUG6Y+g/Vg750sAKeltAfxhDAJWOzI=; b=tiqN6udDW7ewrsNPhGEr8/JD9jjfZLomoRhuNQcqvnR/CjmiHwd4yVRRNz4kpgfYZO q76sUltvr3aCtifm8w+sfjuCoKW8NcPETJmpC883aDIt1+FEYzVayLzerSHnbK4iBDjW Fr+ryB5XPyNYtOVsaDNN+B6EMoTcfhzXsxzikcqDnTDdi1gm1SYe71/XZDFkI5gDhNgG TS7AMC0crS4hmXwpruv+7OCmftfPD/l4l5DLOgGEHJF3erzxLrjvp2ULbBqZuoHKo3ZC IlKXX9LICscoPKfm1x3F5kw0uJjAWBjXrpuwRxhsd3q8Y6oV6y2gJKILowe+DApDe4bd cekw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=esi4sIDL; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c7-20020a170902724700b001926fc5007bsi16863525pll.506.2023.01.12.14.27.55; Thu, 12 Jan 2023 14:28:17 -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=@chromium.org header.s=google header.b=esi4sIDL; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232083AbjALWXi (ORCPT + 99 others); Thu, 12 Jan 2023 17:23:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240081AbjALWW6 (ORCPT ); Thu, 12 Jan 2023 17:22:58 -0500 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69D2B1DF0D for ; Thu, 12 Jan 2023 14:17:38 -0800 (PST) Received: by mail-pl1-x62b.google.com with SMTP id d3so21586051plr.10 for ; Thu, 12 Jan 2023 14:17:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=duA6Un7MMHsWwDUG6Y+g/Vg750sAKeltAfxhDAJWOzI=; b=esi4sIDLgCeEJk+u0yjNbzcOwnXIyrdFqNgIf/C/hPkZydzpXkwVQAN68jczLwo5Vy DjaWv1FKrmoOVsI/0IYwX7hEP8bcbjLX9gMOv2qJZ01Sb6xTbGwFMOr7weCr1vnx3hO8 JxqhFjo+y4XHo7VkWAHe0Pp4x16s1XVBDAvHI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=duA6Un7MMHsWwDUG6Y+g/Vg750sAKeltAfxhDAJWOzI=; b=uXxU/Z7z4i2l7DeADMNW1yqEMhZ8cH4lYtr4P12yS4Du797n/Ao1QYVTqMttdqW49o tGzBuFBuCBVh5Ez7s4pQFI8R9HLbUB+2e5bBaYS3Iu5pFei/jiH03s+9k1sPR+Shm8Kq r+ytQELGg9G7yxZO7umrTPJNgB/H1oTsaOMhzQVj9ubLXkVQYA0YBgEsbGQ4Yp8plfIg iUEqeH6lb+QcQrsQkw8K2W6FP8c0lKu41yjRAQnyNtXTNDA+3PYZU13fBej+peYH1306 oOFAJ+j0CKZUiAuOgToqlyMFjWoLz/d7vhSuljWRi+G5xjU9wBtzYPETAI9lqv++25Ms UjHA== X-Gm-Message-State: AFqh2kqENtmbUTuVzMCGv15RuyvHuD7i/9KKc8Ne3sQRQqAxQ4kYXqV5 FI+jWTXzcN6lGgjMLZSckgRiQg== X-Received: by 2002:a17:902:9685:b0:192:f5a8:3099 with SMTP id n5-20020a170902968500b00192f5a83099mr26592237plp.5.1673561857844; Thu, 12 Jan 2023 14:17:37 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z9-20020a170903018900b00189db296776sm12808100plg.17.2023.01.12.14.17.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 14:17:37 -0800 (PST) Date: Thu, 12 Jan 2023 14:17:36 -0800 From: Kees Cook To: "Gustavo A. R. Silva" Cc: Neal Liu , Herbert Xu , "David S. Miller" , Joel Stanley , Andrew Jeffery , linux-aspeed@lists.ozlabs.org, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH][next] crypto: aspeed - Replace zero-length array with flexible-array member Message-ID: <202301121417.EE86BDD5C@keescook> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 On Mon, Jan 09, 2023 at 07:39:17PM -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 > 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: Kees Cook -- Kees Cook