Skip to content

Commit

Permalink
thermal: intel: powerclamp: fix mismatch in get function for max_idle
Browse files Browse the repository at this point in the history
commit fae633c upstream.

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: ebf5197 ("thermal: intel: powerclamp: Add two module parameters")
Cc: 6.3+ <stable@vger.kernel.org> # 6.3+
Signed-off-by: David Arcari <darcari@redhat.com>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
darcari authored and gregkh committed Nov 28, 2023
1 parent 5b2ed3c commit 6a3866d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/thermal/intel/intel_powerclamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6a3866d

Please sign in to comment.