From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796554431; b=ybFyJT1ydQdOH8SKem1AD1BmWAXnMExCIQx/T977r4yiKqBjhC3Mn88B3u8X8+nIPwFw d/mTgQBmVnZNJbw1w5CJFzaP2gJlRO4ocr3kbP5Bp9Cfn7NoJmc+zBkvnnxpymssi9I8z W8IhceQzTBEg4eigNA3HnTG4KLDGpwgem6K5TRTsgsbnuUYEvPmkA23UeuD596MEeQbox ZKZLzMp2cECtl5hViHSOk8IhyloOOs/47sy5koVwLwGU9pt8ThiROcq5OD84qzeDps/CB RwKKy5Myf0mRa78pnJhd7KJLjr4tGTY58RdiDCgUi/hN1sJno3axjQkzPQLf+oj2e/g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796554431; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=JyX/xj2lUr+lch9IDf/kXmqPHzV8udf5CHF5D30G3OI=; b=ju/mFCffkT2sb8sgZTQ0zmpCoQynqhgh2ykXWGoq2Z3feDLZ7rYMFkhTIr0NE3dRjHsZ XZVILuALfUxNii92XrGe3s1lWxCBqB9kRp2nUpUEmAvC4GU/hPXd9wHsbLcLyYc9r+0YL DH0WhJs8YyRrQiXmI3OyjN0rLq2jCVslWiruqetX7KPiOncR04mkRj2X/dagLlSPrbQ2v qDXFpkbexoxZKJRFxVqBQbapJb+eAFT7ON2JeFGitRCTrpCAQtmhtRYJSS1J2CVtzjYDY E0WrebWv2Rkg9ISbwnakxojO03rpSb615km6JxICT2DfoKFrQ2GHXpR0BZRdz0FZ8Ag== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NV1XgYAZ; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73236606A31F for ; Sun, 6 Dec 2026 10:53:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NV1XgYAZ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63E451F00A07; Sun, 6 Dec 2026 10:53:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796554431; bh=JyX/xj2lUr+lch9IDf/kXmqPHzV8udf5CHF5D30G3OI=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=NV1XgYAZ6oc8VXFe4GjqkN9XBomF+d22RyBYubdUmNCxsG1IPAXuVX6q5UJfa/qTz yokLpKN1yeSH3MsCDS3lXRitx3TTyKjHxMqlIC7Fu5x0In0vYlTyQYzLaF3IhxWNaO nXrIMSqOUMzsG/h9pfqw7e5It3NH4m46Vq60ZslpAZdyBVXE093hv0O2s+Rec3PCfv aI9ZCUcTlEt6pcVBOQIV942NJqHERoYRNz+oUiJB2tRhGhIUxsiKhqH4N719Jd2QfY TFjXzaiSDktH0zLCIbdMf4XwQjHoAn2Aba6co8yFYpIMOImFUjqpxAswL4zKfFuvXU rPF9QefYICr8w== Message-ID: <9097026f-4429-4294-955c-abc6ede5277d@kernel.org> Date: Sun, 6 Dec 2026 11:53:44 +0100 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PREEMPT] Kernel panic - not syncing: stack-protector: Kernel stack is corrupted To: Damien Stewart , Christian Zigotzky , Shrikanth Hegde Cc: Ritesh Harjani , Narayana Murty N , maddy@linux.ibm.com, linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au, npiggin@gmail.com, linux-kernel@vger.kernel.org, msuchanek@suse.de, harshpb@linux.ibm.com, gautam@linux.ibm.com, amachhiw@linux.ibm.com, venkat88@linux.ibm.com, "R.T.Dickinson" , mad skateman , Christian Zigotzky References: <4FED0F6E-890F-4482-99F3-39D7520C48FE@xenosoft.de> <00f8e9aa-c3ec-1911-d81f-291d3c6ae8f0@xenosoft.de> <2abc8e2a-66ad-42ba-8dd5-cf82138b620e@yahoo.com.au> Content-Language: fr-FR From: "Christophe Leroy (CS GROUP)" In-Reply-To: <2abc8e2a-66ad-42ba-8dd5-cf82138b620e@yahoo.com.au> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Damien, Le 06/12/2026 à 07:25, Damien Stewart a écrit : > On 25/11/26 3:28 pm, Christian Zigotzky wrote: >> >> It is very difficult to figure out what the issue is because it occurs >> sporadically. >> >> Cheers, >> Christian > > > So after reading info I've found I'm sure it's due to the same issue > that has plagued PPC64 before. I've examined ASM code and found the > compiler is caching register r13 into r10 in the 7.3.0 kernel build > which I found corrupted the canary. So it's reading off a stale PACA > pointer, yes, that old canard again. > > The cause looks to be no static TLS register on PPC64 so the volatile > PACA is used instead. The problem being the compiler doesn't seem to be > aware the PACA is volatile so any preemptive move switching a task can > change it. In that case I wonder if the current PACA should contain an > extra pointer that is always guaranteed to hold current task context for > that CPU. > > > So GCC version 9.4.0 and GCC version 10.4.0 are known to cause it in > compiled code. The bug is rather annoying as the source code looks fine > but machine code generated by certain compilers producing unstable code. > The GCC option "-mstack-protector-guard-reg=r13" should solve it. Which > option CONFIG_STACKPROTECTOR should enable. But, only for later > compilers. If an earlier compiler must be used, to circumvent any other > build or code issues, then a clean patch to tell the compiler r13 is > volatile looks like one solution. > Can you provide more details, like the disassembly of the function where you suspect the use of r10 being a problem ? What do you mean by "Which option CONFIG_STACKPROTECTOR should enable" ? STACKPROTECTOR cannot be selected if the compiler doesn't support -mstackprotector-guard-reg=r13, see commit bf6cbd0c87f3 ("powerpc: Fix stackprotector detection for non-glibc toolchains") and commit 06ec27aea9fc ("powerpc/64: add stack protector support") So with older compilers you just can't select CONFIG_STACKPROTECTOR because powerpc doesn't select CONFIG_HAVE_STACKPROTECTOR in that case. Christophe