Re: [PATCH v2] riscv: stacktrace: fix stack-out-of-bounds in walk_stackframe()
From: Jiakai Xu
Date: Mon Jun 22 2026 - 08:18:21 EST
Thanks for the review!
> I am concerned when CONFIG_IRQ_STACKS=y and we are on the irq stack,
> wouldn't this "high" be the wrong one?
>
> I haven't validated it, we probably need something like
>
> if (on_thread_stack()) {
> if (!task)
> task = current;
> high = (unsigned long)task_pt_regs(task);
> } else {
> high = per_cpu(irq_stack_ptr, smp_processor_id()) + IRQ_STACK_SIZE/sizeof(ulong);
> }
I agree with you. Let's see if anyone else has suggestions.
If not, I will send a v3 patch in a few days.
Regards,
Jiakai