From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Maninder Singh <maninder1.s@samsung.com>
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
Date: Sun, 8 Mar 2026 23:52:03 +0000 [thread overview]
Message-ID: <aa4Lo30Nq_t7qDqK@shell.armlinux.org.uk> (raw)
In-Reply-To: <20260305070527.719073-1-maninder1.s@samsung.com>
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!
next prev parent reply other threads:[~2026-03-08 23:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20260305070534epcas5p378bb22ef9f1a895d7736ed2272c19ec6@epcas5p3.samsung.com>
2026-03-05 7:05 ` [PATCH 1/1] arm: get task_stack reference before dump_backtrace Maninder Singh
2026-03-08 23:39 ` Linus Walleij
2026-03-08 23:52 ` Russell King (Oracle) [this message]
2026-03-09 5:53 ` Maninder Singh
2026-03-09 5:55 ` Maninder Singh
2026-03-31 6:52 ` bigeasy
2026-03-31 12:16 ` Maninder Singh
2026-03-31 2:59 ` Maninder Singh
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=aa4Lo30Nq_t7qDqK@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=ardb@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=kees@kernel.org \
--cc=keithpac@amazon.com \
--cc=linusw@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maninder1.s@samsung.com \
--cc=peterz@infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.