mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Damien Stewart <hypexed@yahoo.com.au>
To: Christian Zigotzky <chzigotzky@xenosoft.de>,
	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,
	christophe.leroy@csgroup.eu, 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 17:25:03 +1100	[thread overview]
Message-ID: <2abc8e2a-66ad-42ba-8dd5-cf82138b620e@yahoo.com.au> (raw)
In-Reply-To: <c7636032-b541-4ae9-b3b6-e3bf6fcec143@xenosoft.de>

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.

-- 
My regards,

Damien Stewart.


  reply	other threads:[~2026-12-06  6:25 UTC|newest]

Thread overview: 26+ 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 [this message]
2026-12-06 10:53                       ` Christophe Leroy (CS GROUP)
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=2abc8e2a-66ad-42ba-8dd5-cf82138b620e@yahoo.com.au \
    --to=hypexed@yahoo.com.au \
    --cc=amachhiw@linux.ibm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=chzigotzky@xenosoft.de \
    --cc=gautam@linux.ibm.com \
    --cc=harshpb@linux.ibm.com \
    --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®