Received: by 2002:ac8:1418:0:b0:3ab:920c:4c8b with SMTP id k24csp42991qtj; Thu, 12 Jan 2023 15:02:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXueOBYjVRHJiIGhpgPg8gFYUioH1P/3Wh//OQ6Eip1VJnBND0ji9CsKYvpgDAqXWpsrybrL X-Received: by 2002:a05:6402:541b:b0:499:b672:ee30 with SMTP id ev27-20020a056402541b00b00499b672ee30mr13702540edb.11.1673564547091; Thu, 12 Jan 2023 15:02:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673564547; cv=none; d=google.com; s=arc-20160816; b=VvvG0+VfVKEwdjRz3okatfT/owC2XDXY2ow87a520E8r1zEM9Ttb2ZDoL79/fnaoPw gNkkrfV+qTnMjLDiawY54QVpuJ6tGOdwYp9x05m0YThWJFR9HluClWyVhGG+jskaNLI5 Zikcv2H0LD9dE5ETmtT2o11uoA0CzqgzD4hRq8vYdGl0MmtFR3xx5kgYvjaDQC0Ic5FB biMHvNDE2TWCHV77lnaoZjKuMeh7vrMYQ1ERBEosy3JRnOaC4ckKjAP3cHpa4jsObB/D ZvkHR5xsMWAk1o+54HAtmxrEuRDSbrt0+/PdUcasTXn2xJF8WZOZPDfo3ZLeN/N4BOzK B3MA== 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=kKQGCZPzZbd3ZAVje9DUWvZ/4P5iphI9r4/knWYs2KI=; b=zPJkVs1/z3rIj7mPcPwZKnX0KwQ3rtFZ/Glmlk8rh3nhSRgOVCo6VEeaFfDjpJ/V/6 xwJcjvBUzzc0RCP15/XcUCWO8p4urZirQtAoVOcztvCiH+GrHjWHHmKunMP6xEui9f3q a+fbqDCXt4l1fGaRLex8gNUXXXXKgLHh65pUHblNay5KlRjxeKdadOdL8ITtYxvKOOdX baG9cFo/xRNS+uDmlufoIv3cQyfVftL08x5KCPvDaOu3x5ireOSer6+N4gCSLG+BaAZ/ 5wi6ldxn8RiqcTlRmYN8Z5TfBMRu/w6eoII87Cp8jmzYSEiViJb4zIxAg0JyQfvShJL+ zzjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="DqAvkM/R"; 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 en14-20020a056402528e00b00499e590d47esi6339666edb.36.2023.01.12.15.02.14; Thu, 12 Jan 2023 15:02:27 -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=@chromium.org header.s=google header.b="DqAvkM/R"; 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 S232888AbjALWtX (ORCPT + 50 others); Thu, 12 Jan 2023 17:49:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238392AbjALWtS (ORCPT ); Thu, 12 Jan 2023 17:49:18 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21F815E644 for ; Thu, 12 Jan 2023 14:49:18 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id d10so13772967pgm.13 for ; Thu, 12 Jan 2023 14:49:18 -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=kKQGCZPzZbd3ZAVje9DUWvZ/4P5iphI9r4/knWYs2KI=; b=DqAvkM/R4fERKLDz4NsatM9cNHz4ENrtbMNuDlDhe6+SGgtZcJOpGDV1NtZy8D6g11 OG5MQlC4G4CQtZ+DZ+a8I3j4rQU+HtZiuJn5XS2rsQaIq1AajCNHB56JdLJjBsPKSLRB fZEngltDARzgtGJ4/vaZiCTBMTQBVOED+B2RU= 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=kKQGCZPzZbd3ZAVje9DUWvZ/4P5iphI9r4/knWYs2KI=; b=WQv4IGZOFN1Hc56VL0el/FdKgyeZbc2k8BF1yKAuTb5C3KZGa3BNl2P41kC4s+dXSb NehtrL2cgcI4OM3kzXXOOsWSlWRQ7JYHYCpWpFyfmcC14HY63qr7wFsv0JPOLrdIoMCV phUuTzw1s79VCU+E/vNllrBDuGisqfx98Uhx4kv3tzgoOjNj/8k8h6w2NoxhHtFfF+2w /wqaijPBsgNnp9p+aAQMB8nI9fO2DPYpZGS0+ktT4p2kjFZ2fv6CTyyzn64huHImvzp3 ikla9v9RHVJL6jpZfldCnJYm0mflj4iKl4ppm+k34+kA7CbT5yUw96HTR4vcdF6hFBeo Mskg== X-Gm-Message-State: AFqh2kpNMOOPYAVNcCFH/ceZFxFYLnAjAB4o6o/+sHP/iDYzBa8rYGbN YO2Mr0QyXoTY+6R2rrUZThGgWg== X-Received: by 2002:aa7:8599:0:b0:588:eac0:b05b with SMTP id w25-20020aa78599000000b00588eac0b05bmr14527982pfn.27.1673563757683; Thu, 12 Jan 2023 14:49:17 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id h19-20020aa796d3000000b005825b8e0540sm12371171pfq.204.2023.01.12.14.49.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 14:49:17 -0800 (PST) Date: Thu, 12 Jan 2023 14:49:16 -0800 From: Kees Cook To: "Gustavo A. R. Silva" Cc: Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH][next] cifs: Replace zero-length arrays with flexible-array members Message-ID: <202301121449.1C2AEFC2E7@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=unavailable 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 Mon, Jan 09, 2023 at 07:39:00PM -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 > arrays in a couple of structures with flex-array members. > > 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