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 A42EFC3DA4A for ; Fri, 2 Aug 2024 11:48:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BmhN0+wpI6L4vTvyz8ph0NLVfTqswy6p5ftY8fHzRww=; b=SPMLn1Rm9hrMkL4kQDmMqQoYDO oWuASUSZUr9gRBJg/Jcv6flm89MvrbBprxyUdb3MVVXtHYKbX7DpkzdeUmqK9SGwOvO94hwxt0Ndx +5ZiO8CqSYlnSuJAJ4/LKhDaJNWzH01h8QzyUL3Y1K3oSbASndYhYbrovVeupyWU0zUkr4WP4ewrk fIpJ/v0WWvrdj4PyXe+JyLNnVHj4t494YwQgq+Vz2j5s+Kqe3SHmc8v3jlQntgh7iP4fUZGG4ar5F CxjzT2yUuU9FWbK5s0JylQa8OFVSluc1W794F0kcqXrejZDI/xhG/Q+j9pCsiBiqGg3BLCEuGnzf4 9iuRWUhg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZqlH-00000008ite-0YYU; Fri, 02 Aug 2024 11:47:55 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZqkl-00000008il8-1zRs for linux-arm-kernel@lists.infradead.org; Fri, 02 Aug 2024 11:47:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=BmhN0+wpI6L4vTvyz8ph0NLVfTqswy6p5ftY8fHzRww=; b=mREUOL5U5K9EpWl79M33tWiLwB y6fMilzj4UtNKSPbdPqOteOfejqkylm3Z8gqvkxbzYnzE/2BSqFt25qzcUUEshSiT6yK9zaE1tCn7 3NHpz4lIIRtGf5CceloVEFg7EFAiRicOPx1SgesFO/ML7xQTxbT3Nxr8UhbQuLM4oG8XitFPAEcnJ zjIWP1hBswBr2eLTGIH5NTxBUFuY5t15tuCelJVkhbwVZ2pnSaL2eChhAm44rnnjrqJOClXb3ZOXn Q256mNVW4dRpB6fZH+XIDioNSfAY+K6dBLR3OuWiVUfkUy03LCv33+p+OH5webHCY+wrMLg/ysjpM gGujWshA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:48660) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sZqkM-0006d3-21; Fri, 02 Aug 2024 12:46:58 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1sZqkO-00080n-GF; Fri, 02 Aug 2024 12:47:00 +0100 Date: Fri, 2 Aug 2024 12:47:00 +0100 From: "Russell King (Oracle)" To: Jinjie Ruan Cc: ardb@kernel.org, arnd@arndb.de, afd@ti.com, akpm@linux-foundation.org, linus.walleij@linaro.org, eric.devolder@oracle.com, robh@kernel.org, kees@kernel.org, masahiroy@kernel.org, palmer@rivosinc.com, samitolvanen@google.com, xiao.w.wang@intel.com, alexghiti@rivosinc.com, nathan@kernel.org, jan.kiszka@siemens.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org Subject: Re: [PATCH v2] ARM: Add support for STACKLEAK gcc plugin Message-ID: References: <20240624023612.2134144-1-ruanjinjie@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240802_044723_536224_E03F5C6D X-CRM114-Status: GOOD ( 14.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jul 22, 2024 at 10:53:10AM +0800, Jinjie Ruan wrote: > Gentle ping. > > On 2024/6/24 10:36, Jinjie Ruan wrote: > > Add the STACKLEAK gcc plugin to arm32 by adding the helper used by > > stackleak common code: on_thread_stack(). It initialize the stack with the > > poison value before returning from system calls which improves the kernel > > security. Additionally, this disables the plugin in EFI stub code and > > decompress code, which are out of scope for the protection. > > > > Before the test on Qemu versatilepb board: > > # echo STACKLEAK_ERASING > /sys/kernel/debug/provoke-crash/DIRECT > > lkdtm: Performing direct entry STACKLEAK_ERASING > > lkdtm: XFAIL: stackleak is not supported on this arch (HAVE_ARCH_STACKLEAK=n) > > > > After: > > # echo STACKLEAK_ERASING > /sys/kernel/debug/provoke-crash/DIRECT > > lkdtm: Performing direct entry STACKLEAK_ERASING > > lkdtm: stackleak stack usage: > > high offset: 80 bytes > > current: 280 bytes > > lowest: 696 bytes > > tracked: 696 bytes > > untracked: 192 bytes > > poisoned: 7220 bytes > > low offset: 4 bytes > > lkdtm: OK: the rest of the thread stack is properly erased > > > > Signed-off-by: Jinjie Ruan > > Acked-by: Ard Biesheuvel Is this a feature that you have a use case for? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!