Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2499938rdb; Mon, 5 Feb 2024 08:22:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IFHgS1SBfONzTl/ZFGnK8gM86cvqhnKq5pNtu1Vx3xcGgukkBfKGQUTlxC7WOnxtBh22pFx X-Received: by 2002:a62:cd4c:0:b0:6e0:42de:c8d6 with SMTP id o73-20020a62cd4c000000b006e042dec8d6mr18076pfg.14.1707150131238; Mon, 05 Feb 2024 08:22:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707150131; cv=pass; d=google.com; s=arc-20160816; b=y44Y27KBIOcJQUvg8GtPj/fbTDFoS0c0wn8Qo/JaGzrQiTgtxrmKKuCa8BQxl0EDeB YIbf3l9CM5my0R38fQls5C1EI/IcMQM3K+cWOIPJsNPanjDE/IQZp8dLca/GMgmqE4hl 3T1rwebTTa991dscA75zr+W+BrmBUjW6yV5YgH8BeoZTSok4KBI7mhvvv0WEv274a9G+ Rewqaoauk3oJHRQv3xTn/kUNl9RV6x5/y3/ZZ6gxUh2VLxI80DkTYHSzuCabN90r01/y g4LZKswsM491oMImhBfu9pdkC8Mp1wBTz7rjgt5FuumBjnYljLo3wtwB7ieLcgmY0/2d jJbA== 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=YZwZeufc6RF0LGvmSyP+thskIiStXIaE1teIek3hvHg=; fh=tFGxS8Ma5cNIzSFVUNDyu3tXkD+GRYfKGPGpTRiCHSM=; b=igNTveDHJ7CPHKzlXGh6m2HO6kuFAFrvqYiHlUxtENT8sUTg74k0eE3h20bJRTYaOC JihpkVbk9hq/+rJdsDSzmxCAUToHX7nbzHNwFoCpUqJMTz7dnyGmI0D4T6hiSuzjnWFF V50lFYdaQmxebv7FS10vTNVpg2uVne2zTE2XL9pr/pd58/UMB76JmLYPdO5QKs2QzzhJ c5IJmFA+l0I+pgSuhIWSYpRXvx0wnY9CVOww/sHfvw65CB1hV5GXCqJjNhC1zT2z0Hhp zS7mUw3YSWDyNoYqEYYidGjKvuhSq+dLCQJ+xMXvZq2ZkwZHQKXUeDAuDpXLi5SrXvem LmPA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nvybJFVt; 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-53003-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53003-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org X-Forwarded-Encrypted: i=1; AJvYcCXyQYk9op/WBtweBRAFkcUNaTE9wsDqyPFhq3xuh5w9X0gx1nxYN8505EKsSA8VjsxA3PugAxnLaPcEIN9OWD00HxtxqeqbRw0+aYun6g== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id jw11-20020a056a00928b00b006e02d7a2b99si18037pfb.232.2024.02.05.08.22.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 08:22:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-53003-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nvybJFVt; 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-53003-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53003-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 36BE22846C8 for ; Mon, 5 Feb 2024 16:22:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 89E6233CDB; Mon, 5 Feb 2024 16:21:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="nvybJFVt" Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (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 60A923CF5F for ; Mon, 5 Feb 2024 16:21:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707150110; cv=none; b=KJWzxI224U8W0/MyY1hPa85WCs5GxfnSQD6LVQPTYsPS0FSDu+gh8WJrihJdxwNrp/TBtzi9W2ZUqW6FGbtotDp0uCQWV5XGruPjfdeK6E/JEUYInEmCuUotLQVKKelVWIWvG9LKLEXFWahzGMYT7zCRE0bDaGO9G6jABheOnqI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707150110; c=relaxed/simple; bh=IXbS5jwsg2soia7aLFCzN1PxbuLT3Im8P95YoAzLLis=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Q3+9rxZvIx7IPXXK528CRScAswKENaDmNfqP8GVGB0gFhk6OnSPCdEKO+kPo//aN2UALC/mwYy7RPoWkUAsuoGE85vE4virwuzlkAe+HgVyJ1u+llYxthkrxnhzfGL0yFR2V6QKJJuRCRPyuX5xvpIcnyj7ZoQ61Y/FqX8HT5QU= 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=nvybJFVt; arc=none smtp.client-ip=209.85.214.179 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-pl1-f179.google.com with SMTP id d9443c01a7336-1d746ce7d13so37645565ad.0 for ; Mon, 05 Feb 2024 08:21:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1707150108; x=1707754908; 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=YZwZeufc6RF0LGvmSyP+thskIiStXIaE1teIek3hvHg=; b=nvybJFVteIgFCTbRfJdnY04Rd7s+py9FJph9J1Ip1Yg1G8eKhVHc2v8SztDGWYdUiC l3ysn8gAqFgCGrofQ4rRFHfr2apTwq4CeK61G8RFn4fInjlYUcK8lFQPq97+udM7tepz MijKsAAtu/e29FRDISRXAt3LWwEE9VgvW9HnY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707150108; x=1707754908; 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=YZwZeufc6RF0LGvmSyP+thskIiStXIaE1teIek3hvHg=; b=b1CfrVN9IdLLCIfkAJL847sAO4pXYL8EZm8JZnHzmwodpZVBpk/8vttNlJvKBkBMOA /q/KpxaX2gzqjGnkOj3KREA3SIXKrX8W/0/R0ffj3fHozQUuxMt/q3PszE+r0cMVFYtv rGSTVpTfJaU2ZoU5rZGwY1hSAOgur6ImT/Vs3V54996K4lwoEHv1j3PumCluzsHiKgLm c67KJwWbMWiUfdDwMAHBOA5MaR3jYVo/Q0zi80Rl4UW8nCLwiHHGJFbtCR9O12fvbnOj O2oKlbYMPGXfIWKp0v5mnQ8RHRrCqUbpTrADU0rQjAGGz0TMApsy7CqnmDuJUJBwJvlJ v2zw== X-Gm-Message-State: AOJu0Yxt5aUcihxruyx80Z/TRCJTjvgjBGJ/TVvJ1cn1DeFovRCPtGi1 tFHtl94fEKILQ5KS6Z2vgtmH/MZ9Q8+OA5ufblSh/zpReIGdYEPt8+80PJWV+g== X-Received: by 2002:a17:902:d544:b0:1d9:ab92:1550 with SMTP id z4-20020a170902d54400b001d9ab921550mr6160873plf.63.1707150108625; Mon, 05 Feb 2024 08:21:48 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCU6WBBeNWFvorF+DbpeeCWedea/8Hkd20BNUPZaVZN2ePQGBivtHSul7DKIIuJwuuF2cfCRt3rZQEuOU4nr1E091Z3sguDmfGyKCX9U9vDmUvI/9caOUHHvwesqbnybtOo758qz4hn00Rp8Wgs1iXMzkg38eh7if5QgTNZviORqXScYOWUg19rqx7Y3peu4C0l59fwnXixxz0MOLr40N4QoWjp6pJEwQayI3wHJ Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id jz15-20020a170903430f00b001d88d791eccsm46955plb.160.2024.02.05.08.21.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 08:21:48 -0800 (PST) Date: Mon, 5 Feb 2024 08:21:47 -0800 From: Kees Cook To: Heiko Carstens Cc: Nathan Chancellor , Nick Desaulniers , linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Vasily Gorbik , Alexander Gordeev Subject: Re: [PATCH 1/2] Compiler Attributes: Add __uninitialized macro Message-ID: <202402050818.B11CFAD2B@keescook> References: <20240205154844.3757121-1-hca@linux.ibm.com> <20240205154844.3757121-2-hca@linux.ibm.com> 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: <20240205154844.3757121-2-hca@linux.ibm.com> On Mon, Feb 05, 2024 at 04:48:43PM +0100, Heiko Carstens wrote: > With INIT_STACK_ALL_PATTERN or INIT_STACK_ALL_ZERO enabled the kernel will > be compiled with -ftrivial-auto-var-init=<...> which causes initialization > of stack variables at function entry time. > > In order to avoid the performance impact that comes with this users can use > the "uninitialized" attribute to prevent such initialization. > > Therefore provide the __uninitialized macro which can be used for cases > where INIT_STACK_ALL_PATTERN or INIT_STACK_ALL_ZERO is enabled, but only > selected variables should not be initialized. > > Signed-off-by: Heiko Carstens Thanks! We had something similar a while back with syscall entry: efa90c11f62e ("stack: Constrain and fix stack offset randomization with Clang builds") Acked-by: Kees Cook -- Kees Cook