mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scs: Fix a wrong parameter in __scs_magic
@ 2025-10-11  8:22 Zhichi Lin
  2025-10-11 17:11 ` Andrew Morton
  2025-10-13 22:45 ` Sami Tolvanen
  0 siblings, 2 replies; 7+ messages in thread
From: Zhichi Lin @ 2025-10-11  8:22 UTC (permalink / raw)
  To: elver, akpm, will, andreyknvl, samitolvanen, yee.lee, keescook,
	linux-kernel
  Cc: xiejiyuan, zhichi.lin

__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


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH] scs: Fix a wrong parameter in __scs_magic
@ 2022-07-04  7:04 Wan Jiabing
  2022-07-05  9:58 ` Will Deacon
  0 siblings, 1 reply; 7+ messages in thread
From: Wan Jiabing @ 2022-07-04  7:04 UTC (permalink / raw)
  To: Marco Elver, Andrew Morton, Will Deacon, Andrey Konovalov,
	Sami Tolvanen, Wan Jiabing, Yee Lee, Kees Cook, linux-kernel
  Cc: Xie Jiyuan

__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: Xie Jiyuan <xiejiyuan@vivo.com>
Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
---
 kernel/scs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/scs.c b/kernel/scs.c
index b7e1b096d906..4c1ce6a6172d 100644
--- a/kernel/scs.c
+++ b/kernel/scs.c
@@ -125,7 +125,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.37.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-10-30 13:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-11  8:22 [PATCH] scs: Fix a wrong parameter in __scs_magic Zhichi Lin
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

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®