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 55DF1C6FA86 for ; Tue, 27 Sep 2022 02:31:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229503AbiI0Cbm (ORCPT ); Mon, 26 Sep 2022 22:31:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229804AbiI0Cbi (ORCPT ); Mon, 26 Sep 2022 22:31:38 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32E23D74D9 for ; Mon, 26 Sep 2022 19:31:36 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id d10so7340412pfh.6 for ; Mon, 26 Sep 2022 19:31: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=8nZXIbN6hhSoxeA85jrpj1XqgQtYm90/5xBOIy7XZQw=; b=kymzENvEXSDuONnNcjcukiJE0epNVw/bQHltTEdQQBXfi0YKa5ZgRgei3Ri0QtBvtB gD1KfBc3rHFwsQCh6toHrJDOXtEmj+10BcbZ7I7Ixbfq8axjj4lbm8U5vuQUR2t1wcIz wDpw7A8/1gUHvI7wlATvSLlgDbcLndRLsiqSk= 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=8nZXIbN6hhSoxeA85jrpj1XqgQtYm90/5xBOIy7XZQw=; b=lkMkVnYUB8vq62GE4tdsf/kSlJRB19t2unTnEy0XQHN4N96ygwDU2GRRWr57s3j+vN GxJKVTtbuqiKGwR3j1EJ4pejLbCv7VLGu+Q9gtGJaqznvH+5xFN1icFxfSguTMRO6cCz WVHL+weDhyTOeK2tmaMUCT99g1X+Vw8wC5T6bpt1ItLIz5KRgZptYLo6YWAG4Uw1wn2N SJgbJuTaO5cKX8BD/oL6v/LJR8k4f/s7PgXrX+50v13JtfqXr3Ni06aAeOG1RLp5fAUz qVe2Xi4fctkjJCsMuRCk4iL13JjtQzIygnHBgmz2tn4Z2UnvM3kMLkfTJ0LUE9R7GVd2 FZ2w== X-Gm-Message-State: ACrzQf3wnn0nShBow1DAe0j6oFtTLoAoo9/P+oYrFAwqjX1svUe/E5dB eXBIcYD3rOEeOhOUDKpAl3v6Tg== X-Google-Smtp-Source: AMsMyM6eMvXhe7PCuMmkzb3M2roJ/MH7CLj4Tl0C3ZXBMacwANpDN1xmAMunCUxF+nBSpEERnlWRFQ== X-Received: by 2002:a63:1b4d:0:b0:439:db24:a3a6 with SMTP id b13-20020a631b4d000000b00439db24a3a6mr22845733pgm.539.1664245895671; Mon, 26 Sep 2022 19:31:35 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id mm10-20020a17090b358a00b002005f5ab6a8sm7189316pjb.29.2022.09.26.19.31.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 19:31:35 -0700 (PDT) Date: Mon, 26 Sep 2022 19:31:34 -0700 From: Kees Cook To: "Gustavo A. R. Silva" Cc: "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] netns: Replace zero-length array with DECLARE_FLEX_ARRAY() helper Message-ID: <202209261931.6EECD99EE@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-kernel@vger.kernel.org On Mon, Sep 26, 2022 at 06:02:20PM -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/225 > Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html > Signed-off-by: Gustavo A. R. Silva Thanks! Yeah, I tripped over this one myself while testing -fstrict-flex-arrays. Reviewed-by: Kees Cook -- Kees Cook