mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: Wan Jiabing <wanjiabing@vivo.com>
Cc: Marco Elver <elver@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andrey Konovalov <andreyknvl@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Yee Lee <yee.lee@mediatek.com>, Kees Cook <keescook@chromium.org>,
	linux-kernel@vger.kernel.org, Xie Jiyuan <xiejiyuan@vivo.com>
Subject: Re: [PATCH] scs: Fix a wrong parameter in __scs_magic
Date: Tue, 5 Jul 2022 10:58:49 +0100	[thread overview]
Message-ID: <20220705095849.GA608@willie-the-truck> (raw)
In-Reply-To: <20220704070405.2768538-1-wanjiabing@vivo.com>

On Mon, Jul 04, 2022 at 03:04:03PM +0800, Wan Jiabing wrote:
> __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);

Acked-by: Will Deacon <will@kernel.org>

I'm assuming this will go via Andrew or Kees.

Will

  reply	other threads:[~2022-07-05  9:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-04  7:04 Wan Jiabing
2022-07-05  9:58 ` Will Deacon [this message]
2025-10-11  8:22 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

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=20220705095849.GA608@willie-the-truck \
    --to=will@kernel.org \
    --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=wanjiabing@vivo.com \
    --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®