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 X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1196C433E1 for ; Thu, 25 Mar 2021 22:13:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BAAE061A3C for ; Thu, 25 Mar 2021 22:13:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231181AbhCYWM4 (ORCPT ); Thu, 25 Mar 2021 18:12:56 -0400 Received: from gateway36.websitewelcome.com ([50.116.127.2]:44818 "EHLO gateway36.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230396AbhCYWMb (ORCPT ); Thu, 25 Mar 2021 18:12:31 -0400 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 6AD88402895C4 for ; Thu, 25 Mar 2021 17:12:30 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id PYDOlhth7w11MPYDOlWxQz; Thu, 25 Mar 2021 17:12:30 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=embeddedor.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=7TQTeKIn3sX0KsX2Mb0uRTUpgZvCak4GKsqbc414Wao=; b=pM3ggMFhvLF1rSSPG2yQdv1Gf1 NxC1t9XwOXj0/2/YYBi+vEA/Ev2EUruApSVMDory3nxcvUjnf8jds2BGwgkqXkDNRRnThzGZX9H/W K0PThy6C9tomaK5gJ0yQ8IgIT956p7vP0qQJO7eHH1BXeJmbRbVdDcspBqtxoCskps4+j2Rk5NHdw tCdz7LWXpsW8HVYHbKIdRkMVB0HafwSazDaJfsxgD9cZTh6m+wMABD0hldJFHg9ABOcTbjSzKJp+S xYApizT15wf8vdktx8+BOO9uJCQ7vMOZBdoV/+pQF2gLCjKhMYwo/ufi73PKmsOwVJg9NVr8qkY0X PwBFs7QA==; Received: from 187-162-31-110.static.axtel.net ([187.162.31.110]:49220 helo=[192.168.15.8]) by gator4166.hostgator.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lPYDO-003hVs-2j; Thu, 25 Mar 2021 17:12:30 -0500 Subject: Re: [PATCH][next] UAPI: nfsfh.h: Replace one-element array with flexible-array member To: David Laight , "'Gustavo A. R. Silva'" , "J. Bruce Fields" , Chuck Lever Cc: "linux-nfs@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-hardening@vger.kernel.org" References: <20210323224858.GA293698@embeddedor> <629154ce566b4c9c9b7f4124b3260fc3@AcuMS.aculab.com> <5331b4e2-eeef-1c27-5efe-bf3986fd6683@embeddedor.com> <1efa90cc6bc24cfb860084e0b888cd4b@AcuMS.aculab.com> From: "Gustavo A. R. Silva" Message-ID: Date: Thu, 25 Mar 2021 16:12:28 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <1efa90cc6bc24cfb860084e0b888cd4b@AcuMS.aculab.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 187.162.31.110 X-Source-L: No X-Exim-ID: 1lPYDO-003hVs-2j X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 187-162-31-110.static.axtel.net ([192.168.15.8]) [187.162.31.110]:49220 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 6 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/25/21 10:29, David Laight wrote: >>> >>> Could you use the simpler: >>>> struct nfs_fhbase_new { >>>> __u8 fb_version; >>>> __u8 fb_auth_type; >>>> __u8 fb_fsid_type; >>>> __u8 fb_fileid_type; >>>> union { >>>> __u32 fb_auth[1]; >>>> __u32 fb_auth_flex[0]; >>>> }; >>>> }; >>> >>> Although I'm not certain flexible arrays are supported >>> as the last element of a union. >> >> Nope; this is not allowed: https://godbolt.org/z/14vd4o8na > > Nothing an extra 'struct {__u32 fb_auth_flex[0]; }'; won't solve. We don't want to introduce zero-length arrays [1]. -- Gustavo [1] https://www.kernel.org/doc/html/v5.10/process/deprecated.html#zero-length-and-one-element-arrays