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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14EB9C433F5 for ; Mon, 15 Nov 2021 13:52:16 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D73C760EBC for ; Mon, 15 Nov 2021 13:52:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D73C760EBC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=eaWNkNwC8uPD0zUkQrW5GaDkl6qOG7OipLVBcaPyEK0=; b=ctTt71F+A2lTFc YX1TuuSKDx8hu1c60BlrkXr40QVHiyoK9Wmo5jCWpoPa5oxgZ/4fw2eMbcxEwL0Ee8U1yKFEelkWL +0K3Nd70B2ECv/D1Jno+V8D6awK2MxBXyx9eOU4OCu/X2V+EWLnPg3zgqKKKaBr54bK8g2T3uwwch 8Xh24F8GbMAC4B4dfH6LsaR8aqL2ePWtD+a3fkDmNCocDmgWkw1fHL1EuLSmzyBaEhSSG0k1YMCr1 pUO+rOCE9+msjAifjL/rczhCQWDGKcaSWB7LlawjBrpsBvT5G5cvVdzFAmHiDHul3Dr0g4HsFOV7g ktrIOLCgVuH0kmM/1uQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mmcNo-00FlQH-QQ; Mon, 15 Nov 2021 13:50:53 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mmcNj-00FlOK-JL for linux-arm-kernel@lists.infradead.org; Mon, 15 Nov 2021 13:50:49 +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 203806D; Mon, 15 Nov 2021 05:50:46 -0800 (PST) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.26.128]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E57CD3F766; Mon, 15 Nov 2021 05:50:44 -0800 (PST) Date: Mon, 15 Nov 2021 13:50:39 +0000 From: Mark Rutland To: Qian Cai , Valentin Schneider Cc: Will Deacon , Catalin Marinas , linux-arm-kernel@lists.infradead.org, Dmitry Vyukov , linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com Subject: Re: KASAN + CPU soft-hotplug = stack-out-of-bounds at cpuinfo_store_cpu Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211115_055047_732061_D8F1C40B X-CRM114-Status: GOOD ( 18.85 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Nov 15, 2021 at 10:44:11AM +0000, Mark Rutland wrote: > Hi, > > On Fri, Nov 12, 2021 at 11:50:16PM -0500, Qian Cai wrote: > > FYI, running CPU soft-hotplug with KASAN on arm64 defconfig will > > always trigger a stack-out-of-bounds below. I am not right sure where > > exactly KASAN pointed at, so I am just doing the brute-force > > bisect. The progress so far: > > From below it looks like this is on linux-next; I can reproduce this on > v5.16-rc1 using your config, when hotplugging CPU0 back in. > > We used to have issues with stale poison being left on the stack across a > hotplug, and we fixed that with commit: > > e1b77c92981a5222 ("sched/kasan: remove stale KASAN poison after hotplug") > > ... but it looks like we no longer call init_idle() for each hotplug since commit: > > f1a0a376ca0c4ef1 ("sched/core: Initialize the idle task with preemption disabled") > > ... and so don't get the kasan_unpoison_task_stack() call which we want when > bringing up a CPU, which we used to get by way of idle_thread_get() calling init_idle(). > > Adding a call to kasan_unpoison_task_stack(idle) within bringup_cpu() gets rid > of that, and I reckon we want that explciitly *somewhere* on the CPU bringup > path. FWIW I sent that out as a patch: https://lore.kernel.org/linux-arm-kernel/20211115113310.35693-1-mark.rutland@arm.com/ Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel