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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 577CFCFA76A for ; Fri, 4 Oct 2024 11:21:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EAtp5Zjhf/KnPu4IWQQsbiMN5c7ms6wQ3A3IPm/BvA4=; b=RsWTESxyw0Uhvs u6qGTIGromLmfLgtrxRzkGMyhR0SEtKjbn0xJolqAIaytIDdzIc/99m2/1P/GFXbHPXKpSGjpqJl7 PoxFgVanyozdvfDXvqgPpxHdeMLFPLmN0/qZqec9uWRhkSbJTMRQxmc2pCeX6adsXM8Cie+Z+CAO4 JizqLT/MAvNIxDADuILwxpFA9y4I4Zp7DAYNRU7DmC5GBZ9Rhef2lWUz/xxIqyPnpx3UYC6c5wa9Z kcOKJ5w92qCzzEmtWYC0znFP1/PCBIGzPyXO1FR8U6FSoxfR2NjZ4TDvwMgcT3Ro+BpZ66QgEDmn3 WbL761bAK0g8h1M6bt0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1swgNJ-0000000C5Za-3GK0; Fri, 04 Oct 2024 11:21:33 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1swgKl-0000000C4ZP-0oR5; Fri, 04 Oct 2024 11:18:56 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8DEE0339; Fri, 4 Oct 2024 04:19:23 -0700 (PDT) Received: from arm.com (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0DE1F3F640; Fri, 4 Oct 2024 04:18:47 -0700 (PDT) Date: Fri, 4 Oct 2024 14:18:45 +0300 From: Catalin Marinas To: Mark Brown Cc: Will Deacon , Jonathan Corbet , Andrew Morton , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Arnd Bergmann , Oleg Nesterov , Eric Biederman , Shuah Khan , "Rick P. Edgecombe" , Deepak Gupta , Ard Biesheuvel , Szabolcs Nagy , Kees Cook , "H.J. Lu" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Florian Weimer , Christian Brauner , Thiago Jung Bauermann , Ross Burton , David Spickett , Yury Khrustalev , Wilco Dijkstra , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v13 22/40] arm64/gcs: Ensure that new threads have a GCS Message-ID: References: <20241001-arm64-gcs-v13-0-222b78d87eee@kernel.org> <20241001-arm64-gcs-v13-22-222b78d87eee@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20241001-arm64-gcs-v13-22-222b78d87eee@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241004_041855_347142_F4A2A683 X-CRM114-Status: GOOD ( 13.96 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Tue, Oct 01, 2024 at 11:59:01PM +0100, Mark Brown wrote: > When a new thread is created by a thread with GCS enabled the GCS needs > to be specified along with the regular stack. > > Unfortunately plain clone() is not extensible and existing clone3() > users will not specify a stack so all existing code would be broken if > we mandated specifying the stack explicitly. For compatibility with > these cases and also x86 (which did not initially implement clone3() > support for shadow stacks) if no GCS is specified we will allocate one > so when a thread is created which has GCS enabled allocate one for it. > We follow the extensively discussed x86 implementation and allocate > min(RLIMIT_STACK/2, 2G). Since the GCS only stores the call stack and not > any variables this should be more than sufficient for most applications. > > GCSs allocated via this mechanism will be freed when the thread exits. I think Szabolcs mentioned a GCS leak with v12: https://lore.kernel.org/r/ZtrihWQFyb2/XrQV@arm.com (and in some private messages IIRC) Has this been identified? The changelog only mentions a leak in v8. -- Catalin _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv