From: Paul Walmsley <pjw@kernel.org>
To: zhang.anmeng@zte.com.cn
Cc: pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
alex@ghiti.fr, qirui.001@bytedance.com, hu.shengming@zte.com.cn,
gao.rui@zte.com.cn, luo.haiyang@zte.com.cn,
zhang.run@zte.com.cn, zhangchunyan@iscas.ac.cn
Subject: Re: [PATCH] riscv: stacktrace: Fix NULL task pointer in^J ftrace_graph_ret_addr()
Date: Mon, 30 Nov 2026 19:09:42 -0700 (MST) [thread overview]
Message-ID: <796fec4e-c5d1-7d96-5166-eb6477e4daf7@kernel.org> (raw)
In-Reply-To: <20260708095046716mVQlEvhyoXko9eueCxict@zte.com.cn>
On Wed, 8 Jul 2026, zhang.anmeng@zte.com.cn wrote:
> When dump_backtrace() is called with a NULL task argument, and the
> call stack contains functions that are being traced,
> walk_stackframe() eventually calls ftrace_graph_ret_addr() with the
> NULL task pointer, which results in a NULL pointer dereference when
> accessing task->curr_ret_stack.
>
> Fix this by assigning the task pointer to the current task in
> walk_stackframe() when it is NULL, keeping the behavior consistent
> with other architectures.
>
> Fixes: ecbf894165a2 ("riscv: Fix ftrace_graph_ret_addr() to use the correct task pointer")
> Reviewed-by: Shengming Hu <hu.shengming@zte.com.cn>
> Reviewed-by: Rui Gao <gao.rui@zte.com.cn>
> Reviewed-by: Luo Haiyang <luo.haiyang@zte.com.cn>
> Reviewed-by: Run Zhang <zhang.run@zte.com.cn>
> Signed-off-by: Anmeng Zhang <zhang.anmeng@zte.com.cn>
Thanks, queued for v7.4-rc with a cc to stable.
- Paul
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
WARNING: multiple messages have this Message-ID (diff)
From: Paul Walmsley <pjw@kernel.org>
To: zhang.anmeng@zte.com.cn
Cc: pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
alex@ghiti.fr, qirui.001@bytedance.com, hu.shengming@zte.com.cn,
gao.rui@zte.com.cn, luo.haiyang@zte.com.cn,
zhang.run@zte.com.cn, zhangchunyan@iscas.ac.cn
Subject: Re: [PATCH] riscv: stacktrace: Fix NULL task pointer in^J ftrace_graph_ret_addr()
Date: Mon, 30 Nov 2026 19:09:42 -0700 (MST) [thread overview]
Message-ID: <796fec4e-c5d1-7d96-5166-eb6477e4daf7@kernel.org> (raw)
In-Reply-To: <20260708095046716mVQlEvhyoXko9eueCxict@zte.com.cn>
On Wed, 8 Jul 2026, zhang.anmeng@zte.com.cn wrote:
> When dump_backtrace() is called with a NULL task argument, and the
> call stack contains functions that are being traced,
> walk_stackframe() eventually calls ftrace_graph_ret_addr() with the
> NULL task pointer, which results in a NULL pointer dereference when
> accessing task->curr_ret_stack.
>
> Fix this by assigning the task pointer to the current task in
> walk_stackframe() when it is NULL, keeping the behavior consistent
> with other architectures.
>
> Fixes: ecbf894165a2 ("riscv: Fix ftrace_graph_ret_addr() to use the correct task pointer")
> Reviewed-by: Shengming Hu <hu.shengming@zte.com.cn>
> Reviewed-by: Rui Gao <gao.rui@zte.com.cn>
> Reviewed-by: Luo Haiyang <luo.haiyang@zte.com.cn>
> Reviewed-by: Run Zhang <zhang.run@zte.com.cn>
> Signed-off-by: Anmeng Zhang <zhang.anmeng@zte.com.cn>
Thanks, queued for v7.4-rc with a cc to stable.
- Paul
next prev parent reply other threads:[~2026-12-01 2:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 1:50 [PATCH] riscv: stacktrace: Fix NULL task pointer in ftrace_graph_ret_addr() zhang.anmeng
2026-07-08 1:50 ` zhang.anmeng
2026-12-01 2:09 ` Paul Walmsley [this message]
2026-12-01 2:09 ` [PATCH] riscv: stacktrace: Fix NULL task pointer in^J ftrace_graph_ret_addr() Paul Walmsley
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=796fec4e-c5d1-7d96-5166-eb6477e4daf7@kernel.org \
--to=pjw@kernel.org \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=gao.rui@zte.com.cn \
--cc=hu.shengming@zte.com.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=luo.haiyang@zte.com.cn \
--cc=palmer@dabbelt.com \
--cc=qirui.001@bytedance.com \
--cc=zhang.anmeng@zte.com.cn \
--cc=zhang.run@zte.com.cn \
--cc=zhangchunyan@iscas.ac.cn \
/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.