thermal: intel: powerclamp: fix mismatch in get function for max_idle
Subsystems (2)
PATCH 1/1 thermal: intel: powerclamp: fix mismatch in get function for max_idle
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" <[email protected]>
Cc Daniel Lezcano <[email protected]>
Cc Amit Kucheria <[email protected]>
Cc Zhang Rui <[email protected]>
Cc Srinivas Pandruvada <[email protected]>
Cc David Arcari <[email protected]>
Cc Chen Yu <[email protected]>
Signed-off-by David Arcari <[email protected]>
--- drivers/thermal/intel/intel_powerclamp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/intel/intel_powerclamp.c +1 -1
@@ -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 );
Signature · 1 line
2.41.0
Quoted 18 lines · David Arcari
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_intand the definition of max_idle. Replacingparam_get_intwithparam_get_byteresolves this issue.Fixes ebf519710218 ("thermal: intel: powerclamp: Add two moduleparameters")
Quoted 10 lines
Cc "Rafael J. Wysocki" <[email protected]>Cc Daniel Lezcano <[email protected]>Cc Amit Kucheria <[email protected]>Cc Zhang Rui <[email protected]>Cc Srinivas Pandruvada <[email protected]>Cc David Arcari <[email protected]>Cc Chen Yu <[email protected]>Signed-off-by David Arcari <[email protected]>
Reviewed-by Srinivas Pandruvada <[email protected]>
Quoted 19 lines
---
drivers/thermal/intel/intel_powerclamp.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/thermal/intel/intel_powerclamp.c +0
-0@@ -256,7 +256,7 @@ static int max_idle_set(const char *arg, const struct kernel_param *kp)
static const structkernel_param_opsmax_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);