Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp277191rdh; Sat, 23 Sep 2023 09:54:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEeJ3WFa843v4BRd7JGFz+mymhJvO2e2f5xWgEQwHN+73WZgHD584z62+7kS9LuqEIp+qKg X-Received: by 2002:a17:90a:8005:b0:271:9e59:df28 with SMTP id b5-20020a17090a800500b002719e59df28mr2390413pjn.29.1695488046505; Sat, 23 Sep 2023 09:54:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695488046; cv=none; d=google.com; s=arc-20160816; b=vZaMRNXhzWA5/siKlQ3VuhMvyGzCFQ5tRo47emwVPLTzl7TEcbfVc3B5m+yWxrTMQG T+yRNDdb66uDi43WqNmUYduhgpkOapp+tIGkoKtih68HWaw2IQPHic6Era1kj3xiR8ZL ErZTUsCChZOji6y0XOyvErQZICMCIfVygYmOlE7FiVwyTpUXNMDcs7LweXWVfZK1WNoA X0e+9YWrFr/dFaVK/TA3/FU/py3K4QzUtEnlcuPe/TnY4w1cz8yoKhcGG6H/dReoUxXW /nl+4Bya9As6SIx0y0fnYR2nFlE2RA8DEU6dOKoMUSqjLGAbqwpb+cdc9sPhJCctqSij Klmw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+9idSD5kuTZEOLquvpMoF3lumweU5BKvHfzaz/Vt4ZY=; fh=AhIdT+IaiIJ2mOLwJpqyoIzN9ZVmb3rDszB+LICdqw4=; b=t8+g7aQhL9ik5FCFF3F8sqBGgispLH+IxzEJj3jwH30/+qOGO4QnDkb9KH9uNP8WZz I6uapR2m+cnnR2uGfeEdkI0ocpLFFHxu4l8Gp3Pz4Smq3SG/nwOVha5YyE+16yDHNgp3 Tjxl5T2sUWgqWyCmvZtXjo9ESY3MI6jwQkIa6VOdTNp/h8vVsHWxNkpIY8dz2XhjpWtP GL3VWyk7JlEC8dABfakzuXRRvjcngcede+IThKHG8PwEBi3OaipST0G6mOvw2QaMDhPo TwOzSgLoC/lHB6HG5lzzc5A4GqtrunRk5vxjzHB9C3dtXCgG88jX4euL9ikBu3Hy4OCm c4yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LLlxHN8W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id gx5-20020a17090b124500b002768cfbe6desi8493392pjb.112.2023.09.23.09.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 09:54:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LLlxHN8W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 426E98158EA3; Sat, 23 Sep 2023 09:54:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231993AbjIWQyE (ORCPT + 99 others); Sat, 23 Sep 2023 12:54:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229965AbjIWQyC (ORCPT ); Sat, 23 Sep 2023 12:54:02 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56DB183 for ; Sat, 23 Sep 2023 09:53:56 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-99c3d3c3db9so481579766b.3 for ; Sat, 23 Sep 2023 09:53:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695488035; x=1696092835; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=+9idSD5kuTZEOLquvpMoF3lumweU5BKvHfzaz/Vt4ZY=; b=LLlxHN8WDm0EnNl/A1FambzQIKGwXDsaiDd3Fv9YVhRbP+2ro379fjuL+OZxdwze8C WqsVM6+CuxLaIE7ujB7VCC/3gxthTGiVM2feWD4RVNPm2UWvZAXxcOrCoSqq45KwPvZz hylyR2frh1v/scEnVtYVDKLTaOSSwJashFCaOPWPXbMeVHYQcnyeqJ60zqhFpr7YUfXI bFt9jH/HsP9KE0SMUIJRKIdSd9C7qqHAZNB4RDJw92lycYEsLlR8s43ym609Zb888eFM N4TP8bOLrSR/QVgvWpM/8LkAm2XcwsnomkloT0KY+rAgeN2mlVMczXUVBVxT+LCW9NIv jSRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695488035; x=1696092835; h=in-reply-to:content-transfer-encoding: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=+9idSD5kuTZEOLquvpMoF3lumweU5BKvHfzaz/Vt4ZY=; b=LBHkXXpI3L2JXevU2XBufKNpPdYjR62YVgAOu/uw58ulMy8WcLvrAVoS4BXeLbzJyZ PxDC9XXspQTG+NvLprV5njhiA1zc2+ciqkipzg5u8nytdrKAJfEao9/SkXsFsz4nMxQn s1Bij/xmfv7Iv03bUpoHOA5ljJRi6bbGGPTsUv0kuHo3QQOBO6jiWOrNw7IoaBf0AsZx JonOQ8Kz3r6Ox4j8EMafQukzJifVWu8bnEc/nYGAb4brODFQ3RRDgzhjPC137teueEVr P0vdWKPTipjf0BPSfxzHGUtn2QNqsVuGcsqR1svmtAHbzu3Dt/GJuH1TvTaSoMFZrjR7 yhcA== X-Gm-Message-State: AOJu0YyKs263ase0UcwAaaIXEjT5RxVDoHLQhoM14JMwHn4EFzq+om3s 8Pzg0tSM9x4RKW/83CBBzg== X-Received: by 2002:a17:906:3111:b0:9ae:4f13:e581 with SMTP id 17-20020a170906311100b009ae4f13e581mr2118591ejx.59.1695488034560; Sat, 23 Sep 2023 09:53:54 -0700 (PDT) Received: from p183 ([46.53.250.251]) by smtp.gmail.com with ESMTPSA id lg15-20020a170906f88f00b0099d0a8ccb5fsm4056886ejb.152.2023.09.23.09.53.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 09:53:54 -0700 (PDT) Date: Sat, 23 Sep 2023 19:53:52 +0300 From: Alexey Dobriyan To: Linus Torvalds Cc: Kees Cook , linux-kernel@vger.kernel.org Subject: Re: [GIT PULL] hardening fixes for v6.6-rc3 Message-ID: <2983cda7-f084-4eb2-811d-158f43e99e47@p183> References: <202309220957.927ADC0586@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sat, 23 Sep 2023 09:54:03 -0700 (PDT) X-Spam-Level: ** On Fri, Sep 22, 2023 at 04:55:45PM -0700, Linus Torvalds wrote: > On Fri, 22 Sept 2023 at 09:59, Kees Cook wrote: > > > > - Fix UAPI stddef.h to avoid C++-ism (Alexey Dobriyan) > > Ugh. Did we really have to make two different versions of that define? > > Ok, so C++ did something stupid wrt an empty struct. Fine. > > But I think we could have still shared the same definition by just > using the same 'zero-sized array' trick, regardless of any 'empty > struct has a size in C++'. > > IOW, wouldn't this just work universally, without any "two completely > different versions" hack? > > #define __DECLARE_FLEX_ARRAY(TYPE, NAME) \ > struct { \ > char __empty_ ## NAME[0]; \ > TYPE NAME[]; \ > } This doesn't work with g++ :-( #undef __DECLARE_FLEX_ARRAY #define __DECLARE_FLEX_ARRAY(TYPE, NAME) \ struct { \ char __empty_ ## NAME[0]; \ TYPE NAME[]; \ } struct S1 { __DECLARE_FLEX_ARRAY(int, x); }; main.cc:79:35: error: flexible array member ‘S1::::x’ in an otherwise empty ‘struct S1’ 79 | __DECLARE_FLEX_ARRAY(int, x);