Received: by 2002:a05:6a10:5594:0:0:0:0 with SMTP id ee20csp518519pxb; Mon, 25 Apr 2022 15:24:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1EwLAl0+htbgY1SoMAH/HFSgLYXKaMQhmOou4oFmDRz2btM80+JCZYW5q8CBvFmmUfJ+x X-Received: by 2002:a17:90a:1116:b0:1d9:a41a:d13d with SMTP id d22-20020a17090a111600b001d9a41ad13dmr2188534pja.206.1650925474532; Mon, 25 Apr 2022 15:24:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650925474; cv=none; d=google.com; s=arc-20160816; b=RjaWRrRfNi7gpKw4xtGTD/WYEx7DSpExAKO9Z7+wgVd+/AuG0ij28Zcj76y44GYsL0 mzmGCSy9bkl9jZEFx9m4mc6UciherQ+D01B2Co1tLOG3PV4tzBAGLnDDJ+ahwkhKT1pj xKUFSaPx+XwLhR8EyCI0LfmVwcFi/+qQfwG8g9gtXOFOp//2U/oujprcFh5vbWoKssOR nE9k9Z15vTWvIY7sw3/dCcwMhfOqSwwwmIeGUld7Fc6JNcSgHLLXkA7uslBEeJVXv2nn CiNo5sOBjHbPV9AW+4hzxVuAmm7I7UG/9KLZ9ofVELU/bmeH6wYJ4VZIb5sMpOYJQqNY 6zaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=HTz0KzRVkjj+LRHzvQ4nu3mlrscLpTaY44klLZodsKY=; b=AxTHPokPcZAatXGAUO3zqGkRVPJS+LAm1WR93iNg1ilwFXz/9KsFZbanTWQmRmTCxA Tj4QO3Nuz0D1WVSWw1xw+XZ2EIc8atXd1j5FZCp7tizvaylq9+u/FaiuaQ6nKJXwngoq eTfhn8lzFcRu+oASJsWPF+2ilssNcqOQ1Y1tWxiPUBqbk7h/pYQazg37xRb5cdQDG/eY 8jsduBp3xioQb4gUPeJpq2a3Al47aPxXCpjZwsNtSg33M+J6pt43U5WJ7wkrf1p/xbOv SILqLr3yx1BKcE6MqsZfHkTsngwmSwR9tEdDWONATCepctO/Dnv6P1fK53eIyHtqK+x+ oT1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r3-20020a63fc43000000b0039d98ec6641si17707050pgk.319.2022.04.25.15.24.19; Mon, 25 Apr 2022 15:24:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235666AbiDYMAM (ORCPT + 99 others); Mon, 25 Apr 2022 08:00:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235907AbiDYL7b (ORCPT ); Mon, 25 Apr 2022 07:59:31 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BA0A855A3 for ; Mon, 25 Apr 2022 04:56:26 -0700 (PDT) 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 9A462ED1; Mon, 25 Apr 2022 04:56:26 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5C54E3F73B; Mon, 25 Apr 2022 04:56:25 -0700 (PDT) From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: akpm@linux-foundation.org, alex.popov@linux.com, catalin.marinas@arm.com, keescook@chromium.org, linux-arm-kernel@lists.infradead.org, luto@kernel.org, mark.rutland@arm.com, will@kernel.org Subject: [PATCH 8/8] arm64: entry: use stackleak_erase_on_task_stack() Date: Mon, 25 Apr 2022 12:56:03 +0100 Message-Id: <20220425115603.781311-9-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220425115603.781311-1-mark.rutland@arm.com> References: <20220425115603.781311-1-mark.rutland@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On arm64 we always call stackleak_erase() on a task stack, and never call it on another stack. We can avoid some redundant work by using stackleak_erase_on_task_stack(), telling the stackleak code that it's being called on a task stack. Signed-off-by: Mark Rutland Cc: Alexander Popov Cc: Andrew Morton Cc: Andy Lutomirski Cc: Catalin Marinas Cc: Kees Cook Cc: Will Deacon --- arch/arm64/kernel/entry.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index ede028dee81b0..5b82b92924005 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -596,7 +596,7 @@ SYM_CODE_START_LOCAL(ret_to_user) ldr x19, [tsk, #TSK_TI_FLAGS] // re-check for single-step enable_step_tsk x19, x2 #ifdef CONFIG_GCC_PLUGIN_STACKLEAK - bl stackleak_erase + bl stackleak_erase_on_task_stack #endif kernel_exit 0 SYM_CODE_END(ret_to_user) -- 2.30.2