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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C91D8C07E9D for ; Tue, 27 Sep 2022 02:34:13 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C69A43E8; Tue, 27 Sep 2022 04:33:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C69A43E8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1664246051; bh=bh/r0SZwdGbwaiAw/XjSxGOZLqQ5vJFv/Fjiypnl6Ts=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=sCYrQ0IXR8vzt24DnQxg34/vIHKlwAotWIjrxT5dsGlqI6LE+lsv+Jy5VemjnJ1yN aaYjVB+G4LSJIRoOEhBvBFnGj1M2pKV5SORsJhPzqIZm5BuFi3zxVbeXDWBZ+qkAHK usAUtiuRmZNh9yDfxFTwBYidMOdOf2Rpo9Upkk/4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 72433F8024C; Tue, 27 Sep 2022 04:33:21 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 11070F8025E; Tue, 27 Sep 2022 04:33:20 +0200 (CEST) Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0C19BF80166 for ; Tue, 27 Sep 2022 04:33:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0C19BF80166 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="GgaqksQN" Received: by mail-pj1-x102b.google.com with SMTP id i15-20020a17090a4b8f00b0020073b4ac27so8746586pjh.3 for ; Mon, 26 Sep 2022 19:33:13 -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=beHOJoLMzhtQvwqCVFQE08wvFbsVkqCmgSaQLkojE3Q=; b=GgaqksQNT7cicjmr8VgOSy18SzVIWhA+3pfG4AqV2d7ivrbRQA9jxsvP1pfBShGzj/ OvNqU5NPFlK+0R9qj3ayrs9rJ3IpaxXlAFgu1tPwntOP5mXcOTCS+Eh7FGqrCC7D5LcR 2mrrZL+fahvKy6IbegfbZ4MQ1qtychGvEdPHo= 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=beHOJoLMzhtQvwqCVFQE08wvFbsVkqCmgSaQLkojE3Q=; b=CuGFFtotds4yXbS/XkLIBVGp+RT/YN/KcshhIY+GIHR4uwe2DWdeKk2PCaKWcdxGo1 ujdc26IWYhyz7Ctj4CkSFE0c2Dp9uMXkeTQ9UJ3wlBEQMAi9Z/0ogxZwYw8lCM4cgI8K Tz37MNGJPN4EW0y9flHSxcA54y+++buC/JHa6uRO+K18bWfaUauIn239CMw5vZhPe6Kf npvkqAFMtj12P03B0BXsku6cXTBrGFEJbhWY0i8qxC5nA/L+rlAK+7fd9u9XonlUII4s xqVzf2DqHGh/jjQxGKgoLbjjcXcjL2/5yhPNguYQLHW3QKFTxZkzm3CDhb4vuHUpAKHB coyA== X-Gm-Message-State: ACrzQf26KC4/N+Jtd5G2tOd5pUTedx21DYwVhe+WUX8PkaASFvYkN922 fxF2gcX4Pz6PJpPngL9rm2bfzHZIwmCArg== X-Google-Smtp-Source: AMsMyM5NGw1Q0GfafCgkdr3TRCr4jnFSRQlgeAjDLSIqENbtY3Pu0+GX+M5Sea67UDU9T9u8oKayRQ== X-Received: by 2002:a17:902:9006:b0:178:b494:c15a with SMTP id a6-20020a170902900600b00178b494c15amr25467224plp.37.1664245991191; Mon, 26 Sep 2022 19:33:11 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id f9-20020a170902f38900b001783f964fe3sm155268ple.113.2022.09.26.19.33.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 19:33:10 -0700 (PDT) Date: Mon, 26 Sep 2022 19:33:09 -0700 From: Kees Cook To: "Gustavo A. R. Silva" Subject: Re: [PATCH][next] ASoC: uapi: Replace zero-length arrays with __DECLARE_FLEX_ARRAY() helper Message-ID: <202209261932.F68BBD85@keescook> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-hardening@vger.kernel.org, Takashi Iwai X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Mon, Sep 26, 2022 at 06:18:42PM -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/227 > Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html > Signed-off-by: Gustavo A. R. Silva Some day after the __element_count__ attribute exists, we might want to consider a __type_select__ attribute to tie union members to a variable outside the union (like the "type" member here). Reviewed-by: Kees Cook -- Kees Cook