Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp653829lqg; Fri, 1 Mar 2024 17:47:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVksGog7DTDJYacHXiG5gYSdtMPdlwcrhY4DS4yNaZL8Itge5ALFL4yXBJmIfLzvDdwYex0U+2cCnC+vs0lyDwCHTFDiTMONocst6XkcQ== X-Google-Smtp-Source: AGHT+IHVqxQxOgVa3GagG7QJn0/xYh7rR8YJFVKAn9UZxHRISOzBtlf6arX1/U1czbsVw92/BDED X-Received: by 2002:ac8:5f49:0:b0:42e:8a7e:e762 with SMTP id y9-20020ac85f49000000b0042e8a7ee762mr3268006qta.35.1709344026146; Fri, 01 Mar 2024 17:47:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709344026; cv=pass; d=google.com; s=arc-20160816; b=aEPMUg/3A7ZgOfIqCG9sY5xskMpELB+PLvWvOGSZ2wqdqqB5/Zamw3GvvMMJpC95Ls YzsVx4HEQ5dLcmWw4rMuxm7y5a7tQ5i5Ys/5GvJpfpAVlbZemvB5t0uYLhcK5fQkBm15 zfUh59k0v6OPbvRSGedYF0Wn5eRETRjbmKrZesd4Rjxn/2tzDuSvfCuEgnsI+hs246+F 62tReDjzXv9zW8uUWGi7dDGbKdY/MGTU5K+nsoAPIqGdfUmZdHNhhIs82ekxC8A99caK AbGa+GCxj/uzTqzjdIeusJWh4iwbzmyZGAMXjFywERw/tWY7CZV1XuOcMlXwTibNX94P 1hJw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bn1sv4Ad9NlF+2i+d+RVjC+t58fUwFDzcSAxCmkVqVc=; fh=NvNJPc8D3vqDR4zsB2JiWsic4CUmlsMSK6Y4fjrIMmg=; b=BWy05bt84b0qOk/Pmh3xasmUkZPZFS+JDxNyaO9LirmAm5P2FBnttS7B6rYqnth1f7 F60A5k7yNgtfbp2lxW6wnNilxasxbgaprFYqbhW05ET9hG6m2xSzttBRKOhkX4V7ikRJ 9qbclPxgTxApSOr5TGMLODjHEVl1x/PS99NZRW5AH0aYgQWYRBufT/khJNKfl4gg9HTJ U4799SKlRWRuewo9TD1/iPJb2jASPXM42rUnHzO9A0YeBdRLLzt8fZiufeQuAIhoGHST N7acy/W4SxjYpHXPNzfMFMun9Tgfp+My5ZvSoMLT2XT37tO9+BG8CCiJR8+qrwNpmW0F VkqQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YgjFnc9G; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-89300-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89300-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id gm9-20020a056214268900b0068fd9fa7b83si4725281qvb.25.2024.03.01.17.47.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 17:47:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89300-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YgjFnc9G; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-89300-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89300-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DCABA1C2131B for ; Sat, 2 Mar 2024 01:47:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F1ED747F; Sat, 2 Mar 2024 01:47:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="YgjFnc9G" Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3ACD6FCA for ; Sat, 2 Mar 2024 01:46:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709344020; cv=none; b=G//dFTIuQD9x6/EwKzPw0I5AYiTxmhXzxKzCVgia/2r8aekj1D4y6WXOiTarbvGm4FzcGtpIufMHKMJTIwZI3ud1rHGDN+on952KjtlWnqzvgJt/jbLZnRwj239JK4rF78PHBJHTieW9WZz7xp6/wRh5tabWYc2TMxdmSp57UDU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709344020; c=relaxed/simple; bh=f5A0jR9T6V8+dxH3iXe71oqdvNYD79yPpc1mbD2oH6Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ctJOHu2CdkwcN8r4CUX++Q8ZnjUAFutfn2hTIeIWY8pdXqKKbJ3OWxnaoD1eHhcv/erbwwqAQdyYRfWv5EZ+CoQqrOn67/kuoRF7/dXiF8zx1m4xnRGs1a2WhKcS420wKkgqzOcLIDgnRqSqipNlIV9tCxkrRDSPIwSpf1nXUT0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=YgjFnc9G; arc=none smtp.client-ip=209.85.210.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-6e56da425b5so2158857b3a.0 for ; Fri, 01 Mar 2024 17:46:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1709344018; x=1709948818; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=bn1sv4Ad9NlF+2i+d+RVjC+t58fUwFDzcSAxCmkVqVc=; b=YgjFnc9G2i21CmrASd7cTvULfQqJ5lnyj2K5tZNA6x2L8192PjJDp0ZMoeMmuEmt92 FTem8v5JFpoa+r0em6sFzVcK1t55mdCLDQa8y7vlYtc0mg59UepoyuNZVNBnS0NcnkKp HXqYr1yhplYHgACoJPo3YON/n9oMGuad7ZHhs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709344018; x=1709948818; 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 :message-id:reply-to; bh=bn1sv4Ad9NlF+2i+d+RVjC+t58fUwFDzcSAxCmkVqVc=; b=v6OsVRxtUW6y+bA7NH+87c/EyY0ciirB2+/BDI53hZo9+j6FRnhTZV2E9hzy9ghoRx MlFUzMisUAgvB8oSgt7I1NZ4K52uCvSQ+1QPIrn48+wCe3ZrbyTqqDIizyesWHmjYWNQ FORI9GnEXjLmiYiad1w8FCknO5VrYA4ix4u2J7Ni3LkH+ipZJ4O0gzs5mcaw3UHsJ0Lo unjNRgVbUHF1N+BujqM4iSQgLOtEfCTSPYv5TU7eQgAm3osQSM/kvSpa764oD6a6ivyi YYrg2flWqR0Oz1W4D/nY1C0ZN6619NefoVuekS9THbrtpRv03pKqMso+8txeS40T6BaM 9+SA== X-Forwarded-Encrypted: i=1; AJvYcCW8Ox/oZUedZhjo30L2dZDFeHPLyOSfeEc+jJGp1gs6ej2vjDjaTzq6cL89U2lqL0XsHsUJpHb4FjKBttSWFzKYEIt6gmA3kVXvIWQ2 X-Gm-Message-State: AOJu0Yywwx8/lokfYdLF9E1dnB0utk26Fej+HNMvDdaQNALcNxwlof9i xfTfP5nz6/5xbMiXZFFwIEjdS4MswjpRasF+0fslq7KgMCtQr0a+zbQnfJdeDw== X-Received: by 2002:a05:6a00:188b:b0:6e5:9698:7cb9 with SMTP id x11-20020a056a00188b00b006e596987cb9mr4448007pfh.4.1709344018139; Fri, 01 Mar 2024 17:46:58 -0800 (PST) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id a28-20020a62d41c000000b006e555b439c7sm3709005pfh.4.2024.03.01.17.46.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 17:46:56 -0800 (PST) Date: Fri, 1 Mar 2024 17:46:55 -0800 From: Kees Cook To: Andy Shevchenko Cc: Rasmus Villemoes , "Gustavo A . R . Silva" , Miguel Ojeda , Jani Nikula , David Laight , Nick Desaulniers , Martin Uecker , Jonathan Corbet , linux-doc@vger.kernel.org, Miguel Ojeda , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] compiler.h: Explain how __is_constexpr() works Message-ID: <202403011745.C9851C46@keescook> References: <20240301044428.work.411-kees@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sat, Mar 02, 2024 at 03:17:32AM +0200, Andy Shevchenko wrote: > Thu, Feb 29, 2024 at 08:44:37PM -0800, Kees Cook kirjoitti: > > The __is_constexpr() macro is dark magic. Shed some light on it with > > a comment to explain how and why it works. > > I was under impression that somebody did it already once and it fell through > cracks when has been moved (?) to compiler.h. I tried to do it before (see the v1). > > Ah, now I see it, https://lore.kernel.org/all/YKeghxRY4FeOKuwb@smile.fi.intel.com/. > It was asked, but till now never fulfilled (maybe Reported-by:/Closes: tag?). Sure! akpm was hardly the first to ask about it, but yeah, makes for some good tags. Reported-by: Andrew Morton Closes: https://lore.kernel.org/all/20210520134112.ee15f156f1b7dbd3d8f16471@linux-foundation.org/ :) > And explanation before was given here: > https://stackoverflow.com/questions/49481217/linux-kernels-is-constexpr-macro. Sure, but I wanted something that lived with the macro and everyone was happy with the details. -Kees -- Kees Cook