From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BF591A9B46 for ; Sun, 8 Mar 2026 23:52:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773013945; cv=none; b=X6uK+/WPf215jrJOTw9rxxwdZhSxoB23zEqPO/Dy0oAkiJsSOaWvlFyhU4NPp1G0jYl2ti4ijgmBvnsDljC3UHvXwv0+8wdsv1TqynQBDQVWp9FdtBjcrJkvJ/OrTh5lu0Uxv8lYmYpn1ML8KVGkqijqGdQmG6DN79nKZ0qbAGg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773013945; c=relaxed/simple; bh=s9I1OauXZI/XpjTTHpWZ4lGwNipgn2AS1TwIZkSBSPg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=o88jPbhH6vjzriFN2/BdbtefSKj4rPzZpExf8KKZjyhCqMBvs6M4IBbAXTs0GbBFJ2HMnbMUog7hPT8oVPVS0UQgN1f1zEQGYZ6wJ004kBpXEfU1YUcFsTLad6EGEqrAWOf6wIVb1d31VyuehacphCkCGUu8BLWzy+NP4dy/Jhk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=KoCP4773; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="KoCP4773" 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=8KFC10ITsr40DiOwH2CX2jApiOfVeGNGtwwFTRVFwlU=; b=KoCP4773ayjdP4D+ufEvjdLn5c 5A5jIUrvGOB65Y9t1JM7K3iQc5FyfCaNnVFknEtPP7Us515SN8F0m9NXDmHZdC/yiRqLDYpjnJKY3 OH4V8PGZ8L7GXaztPiKGiHFwwzLpjHIh7i/AAsq4vSDkRaAqFE0R8AwTzWdQsKrz1xZhSoBdNciGM z4IXFs7HKPvgE4O89AgfBnCjim0mxFUKKjrkuJ7vi2NEh1kb6QsE13zrXKvwjvfhPNvZ5f/GW6KBZ Trn/f74QcoupY5CRDA/zS6XdAsKmxDTbhQf8iWu5wlHZ3LEfH+yNjI/btBQB4u0ONFtSiS1Z3Bors UQ4kysiw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:48294) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vzNun-00000000366-3rQO; Sun, 08 Mar 2026 23:52:05 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1vzNul-000000003km-1qCt; Sun, 08 Mar 2026 23:52:03 +0000 Date: Sun, 8 Mar 2026 23:52:03 +0000 From: "Russell King (Oracle)" To: Maninder Singh Cc: bigeasy@linutronix.de, peterz@infradead.org, kees@kernel.org, ardb@kernel.org, keithpac@amazon.com, linusw@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] arm: get task_stack reference before dump_backtrace Message-ID: References: <20260305070527.719073-1-maninder1.s@samsung.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260305070527.719073-1-maninder1.s@samsung.com> Sender: Russell King (Oracle) On Thu, Mar 05, 2026 at 12:35:27PM +0530, Maninder Singh wrote: > With Support of THREAD_INFO_IN_TASK, stack of task can be > freed earlier than task (even if task's reference is taken), > and it needs separate reference with try_get_task_stack() > before using the stack. > Otherwise if someone calls show_stack() for task, it can oops > the kernel like below: (Tried with normal race of show_stack when > task still exists, but its stack is freed) Looking at x86, it also has THREAD_INFO_IN_TASK, but I see nothing like this in show_stack(). How come x86 isn't similarly buggy? > > 8<--- cut here --- > Unable to handle kernel paging request at virtual address f8aebec4 when read > [f8aebec4] *pgd=83c2c811, *pte=00000000, *ppte=00000000 > Internal error: Oops: 7 [#1] SMP ARM > .. > CPU: 0 UID: 0 PID: 70 Comm: cat Not tainted 7.0.0-rc2-next-20260302+ #26 VOLUNTARY > .. > PC is at __read_once_word_nocheck+0x0/0x8 > LR is at unwind_frame+0x6b0/0xa90 > ... > Call trace: > __read_once_word_nocheck from unwind_frame+0x6b0/0xa90 > unwind_frame from unwind_backtrace+0x178/0x1e0 > unwind_backtrace from show_stack+0x10/0x14 > ... "otherwise if someone calls show_stack() for task" ... and the stack trace given stops at show_stack() and doesn't show the "someone". I'd like to know _how_ this happens, and why ARM64 and now 32-bit ARM are different from x86. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!