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 0B908C32771 for ; Mon, 26 Sep 2022 22:04:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230510AbiIZWEB (ORCPT ); Mon, 26 Sep 2022 18:04:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231327AbiIZWDa (ORCPT ); Mon, 26 Sep 2022 18:03:30 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81B08E11B6 for ; Mon, 26 Sep 2022 15:02:51 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id w2so8072364pfb.0 for ; Mon, 26 Sep 2022 15:02:51 -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=sY+KsQGJ1iMXAjOjVw1pliiFAMGcOcRpi6gEhOuADKk=; b=DO+VvjxJxYw+J2pvHRWSwWtB1yBY2Mmdi1qVoCpjU4583uJZ7ddrLTRMgrBgU5Kr4r hfyWz3zOBUs90gcBvcxgh9LQ1gMevCr740eCA6IikFBANPzNIAVjBSrxn5fO1FiaoEF+ y6iwW1C25zRJpkYlRZY9DTiKVJJD3b2ICIxBg= 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=sY+KsQGJ1iMXAjOjVw1pliiFAMGcOcRpi6gEhOuADKk=; b=eC3p7vJCz9Oq/AyzNHetPxTZ0VvZ/KBo3xn5b45vq9iqdlIWttiEnXtAXxmkgqQXM6 koaTir9Bc3QNgzg2QrBX6CBDAPAXSsqZLDFuW/hO4FmWtP54QnVO749xREdwi3bOnv7Z UdxFcBfugNbt3D4v/3Vdpi/kSw+gN3gE1lKNGsPi9mecDZkWdi1gOywzwPPT0XHDvu89 jdorpMAbpLI+chcO6Wdnhmw/tcS6hRs6OXcU7ECeYeXc2kojj4PDAzhlmh9A0rsSBFmW 4LztxJHu3FagbdonKEDl/jand8NswpITrT0y9m5wJImuhdo3i65QydHwRd2A7EtMIozy 4jDg== X-Gm-Message-State: ACrzQf1OTa16UGK3/VzmtE/Ae9MFGBxLYIRJ8ftO/3PHCSlalL3cNyJ8 DXnRmMVe1gGXqox8xDmlbJevkzgw72MWeg== X-Google-Smtp-Source: AMsMyM6KHWqc+jVfmWDxBXoMckoP74sAo+zxlN+Yx4P2g4UXs1rLUlsR6nrQowXKd+PlonUaXo8PnA== X-Received: by 2002:a63:3e4a:0:b0:439:246d:e681 with SMTP id l71-20020a633e4a000000b00439246de681mr15812528pga.424.1664229770209; Mon, 26 Sep 2022 15:02:50 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id j34-20020a635962000000b00439baadf1dbsm11144144pgm.41.2022.09.26.15.02.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 15:02:49 -0700 (PDT) Date: Mon, 26 Sep 2022 15:02:48 -0700 From: Kees Cook To: "Gustavo A. R. Silva" Cc: Subash Abhinov Kasiviswanathan , Sean Tranchetti , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH][next] net: ethernet: rmnet: Replace zero-length array with DECLARE_FLEX_ARRAY() helper Message-ID: <202209261502.7DB9C7119@keescook> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-hardening@vger.kernel.org On Mon, Sep 26, 2022 at 04:50:03PM -0500, Gustavo A. R. Silva wrote: > Zero-length arrays are deprecated and we are moving towards adopting > C99 flexible-array members, instead. So, replace zero-length arrays > declarations in anonymous union with the new DECLARE_FLEX_ARRAY() > helper macro. > > This helper allows for flexible-array members in unions. > > Link: https://github.com/KSPP/linux/issues/193 > Link: https://github.com/KSPP/linux/issues/221 > Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html > Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook -- Kees Cook