public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
To: David Arcari <darcari@redhat.com>, linux-pm@vger.kernel.org
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Amit Kucheria <amitk@kernel.org>, Zhang Rui <rui.zhang@intel.com>,
	Chen Yu <yu.c.chen@intel.com>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] thermal: intel: powerclamp: fix mismatch in get function for max_idle
Date: Thu, 05 Oct 2023 08:09:34 -0700	[thread overview]
Message-ID: <ff3f7c023d73c2c8216cff2910e4965a026cdd98.camel@linux.intel.com> (raw)
In-Reply-To: <20231005111757.1293740-1-darcari@redhat.com>

On Thu, 2023-10-05 at 07:17 -0400, David Arcari wrote:
> KASAN reported this
> 
>       [ 444.853098] BUG: KASAN: global-out-of-bounds in
> param_get_int+0x77/0x90
>       [ 444.853111] Read of size 4 at addr ffffffffc16c9220 by task
> cat/2105
>       ...
>       [ 444.853442] The buggy address belongs to the variable:
>       [ 444.853443] max_idle+0x0/0xffffffffffffcde0
> [intel_powerclamp]
> 
> There is a mismatch between the param_get_int and the definition of
> max_idle.  Replacing param_get_int with param_get_byte resolves this
> issue.
> 
> Fixes: ebf519710218 ("thermal: intel: powerclamp: Add two module
> parameters")
> 
> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: Amit Kucheria <amitk@kernel.org>
> Cc: Zhang Rui <rui.zhang@intel.com>
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Cc: David Arcari <darcari@redhat.com>
> Cc: Chen Yu <yu.c.chen@intel.com>
> Cc: linux-kernel@vger.kernel.org
> Cc: stable@vger.kernel.org
> Signed-off-by: David Arcari <darcari@redhat.com>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> ---
>  drivers/thermal/intel/intel_powerclamp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/intel/intel_powerclamp.c
> b/drivers/thermal/intel/intel_powerclamp.c
> index 36243a3972fd..5ac5cb60bae6 100644
> --- a/drivers/thermal/intel/intel_powerclamp.c
> +++ b/drivers/thermal/intel/intel_powerclamp.c
> @@ -256,7 +256,7 @@ static int max_idle_set(const char *arg, const
> struct kernel_param *kp)
>  
>  static const struct kernel_param_ops max_idle_ops = {
>         .set = max_idle_set,
> -       .get = param_get_int,
> +       .get = param_get_byte,
>  };
>  
>  module_param_cb(max_idle, &max_idle_ops, &max_idle, 0644);


      reply	other threads:[~2023-10-05 15:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-05 11:17 [PATCH] thermal: intel: powerclamp: fix mismatch in get function for max_idle David Arcari
2023-10-05 15:09 ` srinivas pandruvada [this message]

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=ff3f7c023d73c2c8216cff2910e4965a026cdd98.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=amitk@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=darcari@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=yu.c.chen@intel.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