Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1916541rwb; Fri, 23 Sep 2022 22:50:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7XlEgKIZ7KUzeUVvmozADIUnZrqBEEYUfHWlZ3WeTkDCtOAWqaV6Qr0eVYg7EjFY+f0AxC X-Received: by 2002:a17:907:7d8b:b0:782:e9ed:88d7 with SMTP id oz11-20020a1709077d8b00b00782e9ed88d7mr1872400ejc.186.1663998628176; Fri, 23 Sep 2022 22:50:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663998628; cv=none; d=google.com; s=arc-20160816; b=EfhtVmbZITeJMM2nr5LuwwGopb9x6c+H10W8oRlLY4soh/H9Xa4gSKf+8oj9yHF2cM fVEQE9/XUQTxERCTuS+eFnTOmz0vsjbnvFYBvlhNiVk4LkyUZsTyptHFrtkRqQJdkoWq CMD4IaVgEaTXiXEC+sKIY6ta7JA3ddDItAaXA1+djRWvhN571cctRFeh/EgorBxzuGm1 8eA1acV7dDAE8G4ef8J0ijjd1M2u86/7dq9iMaH0Uu56lthcflc5qCN9K2IYf3OT74JI tTefKDtYWA9rUe88T7tDnNatWQnT7aLmtgD5UA4JIpifa6Fk+V28qy6DvDyIWsIc81PE WUDA== 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=PPRXlLTYZ3zKwK3ad/AozhJnwUlEmFf37ZAwcK6Vux0=; b=ckOHatlM+Baw06nU/Weo8/SuOmJOv3nKmuejPMZGzlY0A7Dl02na56BsCpSGn+LmpF PeiTBbYy9eWWky2g9cBv6taoHZ/79yfMjm4tC5JGflimHcTjkyyikhfSO8JSPvyvfRG0 quLYW8Gf1BaFsVoDGntXUcLX1Ncdnm8CTgQERBKa6edRKlUDq2GMBcXSl/9InDoHIXcc a6IMgNk75b1z/yWsypONr89F+qCPJq3du+x+nuPkqKYftxQZQhUw5lNoAso8qPT/gyMP mbXOw7fM3NM4Rj/Vga+eCsjs1TvwDthMgrO7rG2GZw2yzGbIlnqWb5XKbJx3sflvguc/ xbKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bRJXy8HI; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s9-20020a056402520900b0044eb3af536bsi12018375edd.160.2022.09.23.22.50.02; Fri, 23 Sep 2022 22:50:28 -0700 (PDT) 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=@chromium.org header.s=google header.b=bRJXy8HI; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233237AbiIXFVk (ORCPT + 99 others); Sat, 24 Sep 2022 01:21:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232992AbiIXFVi (ORCPT ); Sat, 24 Sep 2022 01:21:38 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B2F0139F6E for ; Fri, 23 Sep 2022 22:21:36 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id 129so581351pgc.5 for ; Fri, 23 Sep 2022 22:21:36 -0700 (PDT) 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; bh=PPRXlLTYZ3zKwK3ad/AozhJnwUlEmFf37ZAwcK6Vux0=; b=bRJXy8HIQ7D6BUQDEqhfdStJXXZPFcATdYsA3rCgRlPoLjgYgY5pIsXL1oREfpTrlq r+HKkeru+wwduG9JSy6j462a31Q+ODUAvGRE0Nzs/yT/tmihFFPGrSRBuAng65iiMuzv Ys9IftdSKHBvGu0i0NGbCSw0nd2mCLt5qQj5o= 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; bh=PPRXlLTYZ3zKwK3ad/AozhJnwUlEmFf37ZAwcK6Vux0=; b=zzMh4b8eqmjp4NfGe0iZQ1YtXA9ZEmhLWatukWb9yqSr2sLC3ZZJYjR3oD8GM3lSS8 ShrvRuD7a8RWzx4NguWx7hsaf8/AP337PEPUWE4bEXgf1f2yueFKr0dsHro++0CUwOWk vqW6vVTlt3LI6aXZoORdkosAJPzK5qO2Pb45DyUxW4onzUfbu4ChGLwLcOI2IBhZ1A0D uxKWo/nJPiFLSX7naDIoxwDh8sbaOFQc1PcIviJKjmWsXREElC2U34Sa+DRx8mSU0Kck wQAByuOn8/hs7pYPzFGMX+p5wcEgneI7HtuYlw07Yh3g6Y/f8F8r+pRhLDQ/OeBbcPMp UTcw== X-Gm-Message-State: ACrzQf3CxIIPtnEtcDoVZIlLUCrl2YPkY6BmC7d1kT8c92dR3Mkt51uW rQCUtO6cbuyMY/XqHOMHqROigw== X-Received: by 2002:a05:6a00:2409:b0:54e:a3ad:d32d with SMTP id z9-20020a056a00240900b0054ea3add32dmr12611930pfh.70.1663996895927; Fri, 23 Sep 2022 22:21:35 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id w16-20020a170902e89000b00176d8e33601sm6937804plg.203.2022.09.23.22.21.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Sep 2022 22:21:35 -0700 (PDT) Date: Fri, 23 Sep 2022 22:21:34 -0700 From: Kees Cook To: "Gustavo A. R. Silva" Cc: Jack Wang , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] scsi: pm8001: Replace one-element array with flexible-array member Message-ID: <202209232203.2F77ADD1CA@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-kernel@vger.kernel.org On Thu, Sep 22, 2022 at 02:30:28PM -0500, Gustavo A. R. Silva wrote: > One-element arrays are deprecated, and we are replacing them with flexible > array members instead. So, replace one-element array with flexible-array > member in struct fw_control_info. I think this changelog should include some explanation of why this change is safe. As far as I can see, it would be: This is the only change needed; struct fw_control_info is only ever used for casting to existing allocations. No sizeof() is used on any of the resulting variables. > 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 [1]. > > Link: https://github.com/KSPP/linux/issues/79 > Link: https://github.com/KSPP/linux/issues/207 > Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101836 [1] > Signed-off-by: Gustavo A. R. Silva Another one down! :) Reviewed-by: Kees Cook -- Kees Cook