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 51140C54E94 for ; Wed, 25 Jan 2023 20:27:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236280AbjAYU1w (ORCPT ); Wed, 25 Jan 2023 15:27:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235810AbjAYU1v (ORCPT ); Wed, 25 Jan 2023 15:27:51 -0500 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E21BB7EE3 for ; Wed, 25 Jan 2023 12:27:46 -0800 (PST) Received: by mail-pl1-x62a.google.com with SMTP id be8so760plb.7 for ; Wed, 25 Jan 2023 12:27:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=qs3vFGx5vjVLb7bTaBqnezUzhWCYDXhW7fyeczk+6xY=; b=KqVH0Xk6iVGexG1WZB4xkuFSRHFqib1It4e/xDjyv0qLlogElM6GONXc2aaNDoD5++ CXBrJ8hHi77JNNoPFrdOSizzsGP1hS2TGimuT2Hqwe/wF4gl88xs6ua+gZivMyd4mZbg Jq58DX1Hs32FXKAEcOe7FiDqyGz6Fmeg8snSg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding: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=qs3vFGx5vjVLb7bTaBqnezUzhWCYDXhW7fyeczk+6xY=; b=FTggVlilfVAFCvXSxfx0Jc3FkNa3YsBPKg2ELJwvZ/8p86ab6qbRJEaQFedVm0Jyyi e9hcqLfmMpV2yrfEHE+1524UgQpUtBp11pBLuDI0ZIEZJQ+61dw7AZ89o57gpix6B4Al RcSFUa973qLfGgPkDjXRrtXlCCjpCdRL4fSdgmmE1PTPPvpzSwSRYS18qRZV6V13CnBt yqgY76n2XQ64CaAWqWG8f9iHsge4NYHSR3kohuYV6VczgxQnddpTvDzTJyfDHpA3d32K 47FspP6piCJc6cTrt+FxFDo311bt1OuuTZQBhFbuStAnCZkYnMpd87sbi2nm8U5pufAT 190A== X-Gm-Message-State: AFqh2kr9UHfCNDPw3OJCRC4cmsm0kdSl/+TOjOjL09qBXr6C+l+3KNEV +e055tYALEXd2LoRonRh4idZpQ== X-Google-Smtp-Source: AMrXdXvhIoganfGBKjMxOiJxe35+/ixuy01Fvm5LFKL9CFzcoC4B+HTAInNsHepgE5z+G/tLG7VNUQ== X-Received: by 2002:a17:902:c401:b0:194:dc73:5cf8 with SMTP id k1-20020a170902c40100b00194dc735cf8mr33051142plk.39.1674678466359; Wed, 25 Jan 2023 12:27:46 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id j12-20020a170902c3cc00b00194b3a7853esm4052877plj.181.2023.01.25.12.27.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 12:27:45 -0800 (PST) Date: Wed, 25 Jan 2023 12:27:44 -0800 From: Kees Cook To: =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= Cc: "Gustavo A. R. Silva" , Srinivas Kandagatla , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH][next] nvmem: u-boot-env: replace zero-length array with flexible-array member Message-ID: <202301251227.3A6AAC1B@keescook> References: <494915c85c52e66aa83fce49556ccf3e@milecki.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <494915c85c52e66aa83fce49556ccf3e@milecki.pl> Precedence: bulk List-ID: X-Mailing-List: linux-hardening@vger.kernel.org On Fri, Jan 13, 2023 at 07:41:02AM +0100, Rafał Miłecki wrote: > On 2023-01-10 02:40, 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 u_boot_env_image_broadcom 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]. > > I also handled this issue in my > [PATCH V2 4/6] nvmem: u-boot-env: convert to layout driver > https://lore.kernel.org/linux-arm-kernel/20230111073102.8147-4-zajec5@gmail.com/ Ah-ha, thanks! Looks good. :) -- Kees Cook