Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp589271pxb; Tue, 19 Oct 2021 08:57:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVHOfHqkPE35NTL+72oCMHe5DVFn79rThIEk8xFvBtfgwv4MfDX2nxPh6nw/8Oo6Ojt6j7 X-Received: by 2002:a17:902:70cb:b0:13e:91f3:641a with SMTP id l11-20020a17090270cb00b0013e91f3641amr33624463plt.13.1634659062362; Tue, 19 Oct 2021 08:57:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634659062; cv=none; d=google.com; s=arc-20160816; b=uE5PelYdFM0i1yD/bLNb2I0Rrv7cf8jZPV7U3BRfhsnPloGVKhWmmZMg+erOds7VN1 KLByOXTAd+MrSgVN36rD7vTnqs6uNqVRtApGXR9qFeLP1z95zpeDfliDplWayXgENOKL N3KMo7KxyjHJ7HXQJtn91ynKLxAEFd3nMHkVF58N5dTIDasKJV69oqNRU58R2ebu/oyh P6pwxrVrfTFHw0T/m7UF6BxvuHHCRgrJ/zFbC0Hmlx3Wv2iw+8uxzuauV/aMV6IXO46f UODf1wdtavFZvrFhXSRmWAMiedYuMHxykvfLTP04pFIfAsuhGQP0YT8nfBdqpRMKR3io 6N1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=Q0wqg1WilDcG0CM6ZfrCSL8XOk8AkPZ5CMcgBwCraMc=; b=OYt/Za48btRJuE51dHJgRewNm66qCYM0beBAaZpiHVBvqL00+//5vETscAEcnI5iM9 mBK2jvCfUPqVia2v3+aucXBMxtWut+T/sMx0oCbIMpIKTtGjgc5OlATaPn/TQpI4iBGt Wd3ODlirJL/fzpHzmAWy3xI15ET815A1u8KBuKrTxzjMDHLmqxUF8NuV1oryyuRSEprJ HYJm9CszD7kNGb13snd4fvD724jnIOAtfoA+wlkxIEedZtCDFGop6bCsQRDCdqUvirgV W5P3Lyzsz9SlF/+V0hmaE2IbSz4jykcUlahZSkaoOxQg91WUeCE8XkeQZY/VES523CyH Zdkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="ZlrL1J/u"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z18si2967853pgv.39.2021.10.19.08.57.29; Tue, 19 Oct 2021 08:57:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="ZlrL1J/u"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232972AbhJSP5Z (ORCPT + 99 others); Tue, 19 Oct 2021 11:57:25 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:46670 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232959AbhJSP5Y (ORCPT ); Tue, 19 Oct 2021 11:57:24 -0400 Date: Tue, 19 Oct 2021 15:55:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1634658910; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q0wqg1WilDcG0CM6ZfrCSL8XOk8AkPZ5CMcgBwCraMc=; b=ZlrL1J/uALw2eZcOqBhTaweZ3K+HZm+zVCgHFvnB9ve6S//rauRyq2udlX6sf346nGsUeC Pa1kibaK4094jS6asUw/NS1Kmw5Yd7GjSHj7rRmfDZr5j0K7ZwV4fy39CIMUVsQgS6mzAI QF5AwsAX3r77Op6iFsvhBenvz8tyu7A4chASNHGL7ywb0/ySYpPrE0dC0YtGe4EwjuRMu5 jiBP/KALUMdUQfXmd7zauVKo96miCRte12/xIbH7pGXAYiR4IGJVpcFQJxROpkhaATGDcN 5toKA2osaVdz/kztZEPSJR9NUfZKrDed2pu2O5U+dJe9HmfZKTetMqxYKcRWmw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1634658910; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q0wqg1WilDcG0CM6ZfrCSL8XOk8AkPZ5CMcgBwCraMc=; b=Bw0/pR8X+Aa9790hHlcIEaT+/gilHZEKw2sAHxqjDELWPeaXQz26ZNkEXoX8ETnyky2tPQ Hq2iIncofEr2mHAQ== From: "tip-bot2 for Woody Lin" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/urgent] sched/scs: Reset the shadow stack when idle_task_exit Cc: Woody Lin , "Peter Zijlstra (Intel)" , Valentin Schneider , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20211012083521.973587-1-woodylin@google.com> References: <20211012083521.973587-1-woodylin@google.com> MIME-Version: 1.0 Message-ID: <163465890918.25758.12684036916050863511.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/urgent branch of tip: Commit-ID: 63acd42c0d4942f74710b11c38602fb14dea7320 Gitweb: https://git.kernel.org/tip/63acd42c0d4942f74710b11c38602fb14dea7320 Author: Woody Lin AuthorDate: Tue, 12 Oct 2021 16:35:21 +08:00 Committer: Peter Zijlstra CommitterDate: Tue, 19 Oct 2021 17:46:11 +02:00 sched/scs: Reset the shadow stack when idle_task_exit Commit f1a0a376ca0c ("sched/core: Initialize the idle task with preemption disabled") removed the init_idle() call from idle_thread_get(). This was the sole call-path on hotplug that resets the Shadow Call Stack (scs) Stack Pointer (sp). Not resetting the scs-sp leads to scs overflow after enough hotplug cycles. Therefore add an explicit scs_task_reset() to the hotplug code to make sure the scs-sp does get reset on hotplug. Fixes: f1a0a376ca0c ("sched/core: Initialize the idle task with preemption disabled") Signed-off-by: Woody Lin [peterz: Changelog] Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Link: https://lore.kernel.org/r/20211012083521.973587-1-woodylin@google.com --- kernel/sched/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 1bba412..f21714e 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -8795,6 +8795,7 @@ void idle_task_exit(void) finish_arch_post_lock_switch(); } + scs_task_reset(current); /* finish_cpu(), as ran on the BP, will clean up the active_mm state */ }