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 572A0C3DA7F for ; Mon, 5 Aug 2024 01:36:14 +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:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:CC:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yYaT1gAG4bbeK5z/JT6WgOONvQ1Wytqec/WwQ4HsE+E=; b=Naqac1PYVHzVRuH8P4/EhlvtDY 6mRr4kXD7wzEe+FCuJkOsWBtxb/JplAHlJ63muZYmZZIgL6KYkexTKyaHVZvz+gBQglIGArWmX6Va cEfTwNb2FQH0wZftF4d4vXuvlqv5be5IHdlqVAdo8Sb+1hZgk7u6ZxhcV30bGcKquozfcexXC3Ntk F8nIqwMHkn8wj1d67ZGKv7T6Oupz7qgb/2KeM0F/trVq2FOHDcZ+v0ZTjASlOE6WGfaMSz+zvqaDR L+nl1vD1+jnelrAr6JszMR/Fa7sDwf2+UlbFmILsY4zph7Pi8IIyQS8OO9MbwyWKsU2f7eLPyXmCY Z2jQd6Vw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1samdo-0000000EJBM-14mG; Mon, 05 Aug 2024 01:36:04 +0000 Received: from szxga04-in.huawei.com ([45.249.212.190]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1samdI-0000000EJ6w-3Zt9 for linux-arm-kernel@lists.infradead.org; Mon, 05 Aug 2024 01:35:34 +0000 Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Wcf5b6Lx8z2Cc9x; Mon, 5 Aug 2024 09:30:43 +0800 (CST) Received: from kwepemi100008.china.huawei.com (unknown [7.221.188.57]) by mail.maildlp.com (Postfix) with ESMTPS id C368F14037F; Mon, 5 Aug 2024 09:35:23 +0800 (CST) Received: from [10.67.109.254] (10.67.109.254) by kwepemi100008.china.huawei.com (7.221.188.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 5 Aug 2024 09:35:22 +0800 Message-ID: <46dd8990-df35-5044-7ab3-e1acb04de85f@huawei.com> Date: Mon, 5 Aug 2024 09:35:21 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH v2] ARM: Add support for STACKLEAK gcc plugin Content-Language: en-US To: "Russell King (Oracle)" CC: , , , , , , , , , , , , , , , , , References: <20240624023612.2134144-1-ruanjinjie@huawei.com> From: Jinjie Ruan In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.109.254] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi100008.china.huawei.com (7.221.188.57) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240804_183533_092628_18934C9E X-CRM114-Status: UNSURE ( 8.66 ) X-CRM114-Notice: Please train this message. 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 2024/8/2 19:47, Russell King (Oracle) wrote: > 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? Yes, We have ARM32 products internally, and there is a need for security hardening. >