mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Zigotzky <chzigotzky@xenosoft.de>
To: "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
	Damien Stewart <hypexed@yahoo.com.au>,
	Shrikanth Hegde <sshegde@linux.ibm.com>
Cc: Ritesh Harjani <ritesh.list@gmail.com>,
	Narayana Murty N <nnmlinux@linux.ibm.com>,
	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" <rtd2@xtra.co.nz>,
	mad skateman <madskateman@gmail.com>,
	Christian Zigotzky <info@xenosoft.de>
Subject: Re: [PREEMPT] Kernel panic - not syncing: stack-protector: Kernel stack is corrupted
Date: Sun, 6 Dec 2026 15:32:07 +0100	[thread overview]
Message-ID: <fcd40e50-2734-0661-8e2c-454af41bbe2c@xenosoft.de> (raw)
In-Reply-To: <9097026f-4429-4294-955c-abc6ede5277d@kernel.org>

On 06/12/26 11:53, Christophe Leroy (CS GROUP) wrote:
> 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
>
Hi all,

Should I compile the RC6 with GCC11?

CONFIG_STACKPROTECTOR was already enabled in RC5. Or should I try 
disabling CONFIG_STACKPROTECTOR_STRONG?

What should I do?

Thanks,
Christian

-- 
Sent with Warpzilla 35.0.3 (https://github.com/chzigotzky/Web-Browsers-and-Suites-for-Linux-PPC/releases/tag/Warpzilla_35.0.3)


  reply	other threads:[~2026-12-06 14:32 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 11:04 [PATCH 0/2] KVM: PPC: BookE: Fix boot hang on preemptible kernels Shrikanth Hegde
2026-09-28 11:04 ` [PATCH 1/2] KVM: PPC: BookE: Disable preemption before loading guest FP and Altivec Shrikanth Hegde
2026-10-01 11:26   ` Narayana Murty N
2026-10-01 11:53     ` Shrikanth Hegde
2026-10-30 16:21       ` Ritesh Harjani
2026-11-01  8:28         ` Christian Zigotzky
2026-11-02 13:07           ` Shrikanth Hegde
2026-11-05  9:06             ` Christian Zigotzky
2026-11-06  5:07               ` [PREEMPT] Kernel panic - not syncing: stack-protector: Kernel stack is corrupted Christian Zigotzky
2026-11-06  6:09                 ` Shrikanth Hegde
2026-11-25  4:28                   ` Christian Zigotzky
2026-12-06  6:25                     ` Damien Stewart
2026-12-06 10:53                       ` Christophe Leroy (CS GROUP)
2026-12-06 14:32                         ` Christian Zigotzky [this message]
2026-11-01 11:35         ` [PATCH] powerpc/pasemi: Defer Nemo IRQ initialization Christian Zigotzky
2026-09-28 11:04 ` [PATCH 2/2] KVM: PPC: Replay pending interrupts before entering the guest Shrikanth Hegde
2026-10-01 11:28   ` Narayana Murty N
2026-10-01 11:57     ` Shrikanth Hegde
2026-10-06 15:37   ` Gautam Menghani
2026-10-30 16:30   ` Ritesh Harjani
2026-11-04 15:46     ` Mukesh Kumar Chaurasiya
2026-09-29 15:51 ` [PATCH 0/2] KVM: PPC: BookE: Fix boot hang on preemptible kernels Christian Zigotzky
2026-10-22 16:42   ` Christian Zigotzky
2026-11-07 15:10 ` Shrikanth Hegde
     [not found] <D0ECD6B8-7F15-48C8-87A4-DFE5F35A42D8@xenosoft.de>
2026-11-25  8:46 ` [PREEMPT] Kernel panic - not syncing: stack-protector: Kernel stack is corrupted Christian Zigotzky
2026-11-25  8:50   ` Shrikanth Hegde
2026-11-26  5:32     ` Christian Zigotzky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fcd40e50-2734-0661-8e2c-454af41bbe2c@xenosoft.de \
    --to=chzigotzky@xenosoft.de \
    --cc=amachhiw@linux.ibm.com \
    --cc=chleroy@kernel.org \
    --cc=gautam@linux.ibm.com \
    --cc=harshpb@linux.ibm.com \
    --cc=hypexed@yahoo.com.au \
    --cc=info@xenosoft.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=madskateman@gmail.com \
    --cc=mpe@ellerman.id.au \
    --cc=msuchanek@suse.de \
    --cc=nnmlinux@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=ritesh.list@gmail.com \
    --cc=rtd2@xtra.co.nz \
    --cc=sshegde@linux.ibm.com \
    --cc=venkat88@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®