mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhichi Lin <zhichi.lin@vivo.com>
To: elver@google.com, akpm@linux-foundation.org, will@kernel.org,
	andreyknvl@gmail.com, samitolvanen@google.com,
	yee.lee@mediatek.com, keescook@chromium.org,
	linux-kernel@vger.kernel.org
Cc: xiejiyuan@vivo.com, zhichi.lin@vivo.com
Subject: [PATCH] scs: Fix a wrong parameter in __scs_magic
Date: Sat, 11 Oct 2025 16:22:22 +0800	[thread overview]
Message-ID: <20251011082222.12965-1-zhichi.lin@vivo.com> (raw)

__scs_magic() needs a 'void *' variable, but a 'struct task_struct *'
is given. 'task_scs(tsk)' is the starting address of the task's shadow
call stack, and '__scs_magic(task_scs(tsk))' is the end address of the
task's shadow call stack.
Here should be '__scs_magic(task_scs(tsk))'.

Fixes: 5bbaf9d1fcb9 ("scs: Add support for stack usage debugging")
Signed-off-by: Jiyuan Xie <xiejiyuan@vivo.com>
Signed-off-by: Zhichi Lin <zhichi.lin@vivo.com>
---
 kernel/scs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/scs.c b/kernel/scs.c
index d7809affe..772488afd 100644
--- a/kernel/scs.c
+++ b/kernel/scs.c
@@ -135,7 +135,7 @@ static void scs_check_usage(struct task_struct *tsk)
 	if (!IS_ENABLED(CONFIG_DEBUG_STACK_USAGE))
 		return;
 
-	for (p = task_scs(tsk); p < __scs_magic(tsk); ++p) {
+	for (p = task_scs(tsk); p < __scs_magic(task_scs(tsk)); ++p) {
 		if (!READ_ONCE_NOCHECK(*p))
 			break;
 		used += sizeof(*p);
-- 
2.25.1


             reply	other threads:[~2025-10-11  8:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-11  8:22 Zhichi Lin [this message]
2025-10-11 17:11 ` Andrew Morton
2025-10-13  8:19   ` 林芝驰
2025-10-30 13:10   ` Will Deacon
2025-10-13 22:45 ` Sami Tolvanen
  -- strict thread matches above, loose matches on Subject: below --
2022-07-04  7:04 Wan Jiabing
2022-07-05  9:58 ` Will Deacon

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=20251011082222.12965-1-zhichi.lin@vivo.com \
    --to=zhichi.lin@vivo.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@gmail.com \
    --cc=elver@google.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samitolvanen@google.com \
    --cc=will@kernel.org \
    --cc=xiejiyuan@vivo.com \
    --cc=yee.lee@mediatek.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®