George Cherian
1ecbd7170d
ACPI / CPPC: Fix KASAN global out of bounds warning
...
Default value of pcc_subspace_idx is -1.
Make sure to check pcc_subspace_idx before using the same as array index.
This will avoid following KASAN warnings too.
[ 15.113449] ==================================================================
[ 15.116983] BUG: KASAN: global-out-of-bounds in cppc_get_perf_caps+0xf3/0x3b0
[ 15.116983] Read of size 8 at addr ffffffffb9a5c0d8 by task swapper/0/1
[ 15.116983] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 4.15.0-rc2+ #2
[ 15.116983] Hardware name: Dell Inc. OptiPlex 7040/0Y7WYT, BIOS 1.2.8 01/26/2016
[ 15.116983] Call Trace:
[ 15.116983] dump_stack+0x7c/0xbb
[ 15.116983] print_address_description+0x1df/0x290
[ 15.116983] kasan_report+0x28a/0x370
[ 15.116983] ? cppc_get_perf_caps+0xf3/0x3b0
[ 15.116983] cppc_get_perf_caps+0xf3/0x3b0
[ 15.116983] ? cpc_read+0x210/0x210
[ 15.116983] ? __rdmsr_on_cpu+0x90/0x90
[ 15.116983] ? rdmsrl_on_cpu+0xa9/0xe0
[ 15.116983] ? rdmsr_on_cpu+0x100/0x100
[ 15.116983] ? wrmsrl_on_cpu+0x9c/0xd0
[ 15.116983] ? wrmsrl_on_cpu+0x9c/0xd0
[ 15.116983] ? wrmsr_on_cpu+0xe0/0xe0
[ 15.116983] __intel_pstate_cpu_init.part.16+0x3a2/0x530
[ 15.116983] ? intel_pstate_init_cpu+0x197/0x390
[ 15.116983] ? show_no_turbo+0xe0/0xe0
[ 15.116983] ? __lockdep_init_map+0xa0/0x290
[ 15.116983] intel_pstate_cpu_init+0x30/0x60
[ 15.116983] cpufreq_online+0x155/0xac0
[ 15.116983] cpufreq_add_dev+0x9b/0xb0
[ 15.116983] subsys_interface_register+0x1ae/0x290
[ 15.116983] ? bus_unregister_notifier+0x40/0x40
[ 15.116983] ? mark_held_locks+0x83/0xb0
[ 15.116983] ? _raw_write_unlock_irqrestore+0x32/0x60
[ 15.116983] ? intel_pstate_setup+0xc/0x104
[ 15.116983] ? intel_pstate_setup+0xc/0x104
[ 15.116983] ? cpufreq_register_driver+0x1ce/0x2b0
[ 15.116983] cpufreq_register_driver+0x1ce/0x2b0
[ 15.116983] ? intel_pstate_setup+0x104/0x104
[ 15.116983] intel_pstate_register_driver+0x3a/0xa0
[ 15.116983] intel_pstate_init+0x3c4/0x434
[ 15.116983] ? intel_pstate_setup+0x104/0x104
[ 15.116983] ? intel_pstate_setup+0x104/0x104
[ 15.116983] do_one_initcall+0x9c/0x206
[ 15.116983] ? parameq+0xa0/0xa0
[ 15.116983] ? initcall_blacklisted+0x150/0x150
[ 15.116983] ? lock_downgrade+0x2c0/0x2c0
[ 15.116983] kernel_init_freeable+0x327/0x3f0
[ 15.116983] ? start_kernel+0x612/0x612
[ 15.116983] ? _raw_spin_unlock_irq+0x29/0x40
[ 15.116983] ? finish_task_switch+0xdd/0x320
[ 15.116983] ? finish_task_switch+0x8e/0x320
[ 15.116983] ? rest_init+0xd0/0xd0
[ 15.116983] kernel_init+0xf/0x11a
[ 15.116983] ? rest_init+0xd0/0xd0
[ 15.116983] ret_from_fork+0x24/0x30
[ 15.116983] The buggy address belongs to the variable:
[ 15.116983] __key.36299+0x38/0x40
[ 15.116983] Memory state around the buggy address:
[ 15.116983] ffffffffb9a5bf80: fa fa fa fa 00 fa fa fa fa fa fa fa 00 fa fa fa
[ 15.116983] ffffffffb9a5c000: fa fa fa fa 00 fa fa fa fa fa fa fa 00 fa fa fa
[ 15.116983] >ffffffffb9a5c080: fa fa fa fa 00 fa fa fa fa fa fa fa 00 00 00 00
[ 15.116983] ^
[ 15.116983] ffffffffb9a5c100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 15.116983] ffffffffb9a5c180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 15.116983] ==================================================================
Fixes: 85b1407bf6d2 (ACPI / CPPC: Make CPPC ACPI driver aware of PCC subspace IDs)
Reported-by: Changbin Du <changbin.du@intel.com>
Signed-off-by: George Cherian <george.cherian@cavium.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-12-05 23:25:49 +01:00
..
2017-11-13 01:36:58 +01:00
2017-11-13 20:08:22 -08:00
2017-11-15 10:56:56 -08:00
2017-11-02 11:10:55 +01:00
2017-11-17 09:51:57 -08:00
2017-11-16 09:15:57 -08:00
2017-10-21 13:24:53 +02:00
2017-11-09 00:55:16 +01:00
2016-04-27 23:42:57 +02:00
2017-10-17 23:52:54 +02:00
2016-06-04 00:20:07 +02:00
2017-10-19 16:15:29 +02:00
2017-06-22 02:18:20 +02:00
2017-06-07 12:20:49 +02:00
2017-04-07 12:25:37 -05:00
2017-07-24 22:52:00 +02:00
2017-10-11 15:38:10 +02:00
2017-11-13 20:08:22 -08:00
2015-07-08 02:27:32 +02:00
2017-03-02 08:42:27 +01:00
2017-04-18 16:56:39 +02:00
2016-01-04 22:10:30 +01:00
2017-11-09 00:55:16 +01:00
2017-09-14 11:59:30 +02:00
2017-09-19 01:49:02 +02:00
2017-08-24 03:38:25 +02:00
2017-11-02 11:10:55 +01:00
2017-07-04 22:15:20 +02:00
2017-09-14 11:59:30 +02:00
2017-09-14 11:59:30 +02:00
2017-11-15 13:46:33 -08:00
2015-07-08 02:27:32 +02:00
2015-07-08 02:27:32 +02:00
2017-12-05 23:25:49 +01:00
2015-08-07 02:55:18 +02:00
2017-11-13 01:41:26 +01:00
2017-11-20 23:48:51 +01:00
2017-11-09 00:55:16 +01:00
2016-03-09 23:26:15 +01:00
2017-11-30 13:37:29 +01:00
2017-11-02 11:10:55 +01:00
2016-05-09 22:59:25 +02:00
2016-10-10 02:20:43 +02:00
2017-05-09 15:15:47 -07:00
2015-07-08 02:27:32 +02:00
2017-11-30 13:37:29 +01:00
2017-06-22 02:18:20 +02:00
2017-07-12 13:11:49 +02:00
2017-11-16 09:15:57 -08:00
2017-11-16 09:15:57 -08:00
2017-07-24 22:27:44 +02:00
2017-09-14 11:59:30 +02:00
2017-10-11 15:38:10 +02:00
2016-09-10 02:50:50 +02:00
2016-10-24 14:18:14 +02:00
2017-04-24 11:58:56 -05:00
2017-08-03 23:26:22 +02:00
2017-09-14 11:59:30 +02:00
2017-07-04 22:15:14 +02:00
2017-11-02 11:10:55 +01:00
2017-03-11 14:41:18 +01:00
2017-07-27 01:51:06 +02:00
2017-11-04 15:01:50 +01:00
2017-11-02 11:10:55 +01:00
2017-02-04 00:05:29 +01:00
2016-12-24 11:46:01 -08:00
2017-05-26 10:10:47 +02:00
2017-10-11 21:16:37 +02:00
2017-11-02 11:10:55 +01:00
2017-11-09 00:55:16 +01:00
2017-09-03 23:54:29 +02:00
2015-11-16 23:26:45 +01:00
2017-11-02 11:10:55 +01:00
2017-11-30 13:37:29 +01:00
2017-11-06 23:56:57 +01:00
2017-11-02 11:10:55 +01:00
2017-09-03 23:54:29 +02:00
2017-11-15 13:46:33 -08:00
2017-07-20 16:38:25 +02:00
2017-09-14 11:59:30 +02:00
2017-11-14 12:54:55 +01:00
2017-07-16 02:27:23 +02:00
2017-11-02 11:10:55 +01:00