msm: thermal: validate userspace args to prevent buffer overflow.
Prevent a userspace ioctl variable from accessing an array out of bounds. BUG: 27243728 Change-Id: I43690364273ace4a22e214bab88c76f0749c6d4f
This commit is contained in:
parent
26348f7fa6
commit
78ef5ad5fb
|
@ -100,6 +100,16 @@ static long validate_and_copy(unsigned int *cmd, unsigned long *arg,
|
|||
goto validate_exit;
|
||||
}
|
||||
break;
|
||||
case MSM_THERMAL_GET_CLUSTER_FREQUENCY_PLAN:
|
||||
if (query->clock_freq.cluster_num >= NR_CPUS) {
|
||||
ret = -EINVAL;
|
||||
goto validate_exit;
|
||||
}
|
||||
case MSM_THERMAL_GET_CLUSTER_VOLTAGE_PLAN:
|
||||
if (query->voltage.cluster_num >= NR_CPUS) {
|
||||
ret = -EINVAL;
|
||||
goto validate_exit;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue