aboutsummaryrefslogtreecommitdiff
path: root/arch/avr32
diff options
context:
space:
mode:
authorSilas Boyd-Wickizer <sbw@mit.edu>2012-08-03 12:33:27 -0700
committerViresh Kumar <viresh.kumar@linaro.org>2012-10-03 14:19:35 +0530
commitf7210fc689de3ce5c3384591afeb54ead0f28699 (patch)
treeda975282c7ba23db77357c0c009cbd3a7998c233 /arch/avr32
parenta0d271cbfed1dd50278c6b06bead3d00ba0a88f9 (diff)
Use get_online_cpus to avoid races involving CPU hotplug
If arch/x86/kernel/msr.c is a module, a CPU might offline or online between the for_each_online_cpu(i) loop and the call to register_hotcpu_notifier in msr_init or the call to unregister_hotcpu_notifier in msr_exit. The potential races can lead to leaks/duplicates, attempts to destroy non-existant devices, or random pointer dereferences. For example, in msr_init if: for_each_online_cpu(i) { err = msr_device_create(i); if (err != 0) goto out_class; } <----- CPU offlines register_hotcpu_notifier(&msr_class_cpu_notifier); and the CPU never onlines before msr_exit, then the module will never call msr_device_destroy for the associated CPU. This fix surrounds for_each_online_cpu and register_hotcpu_notifier or unregister_hotcpu_notifier with get_online_cpus+put_online_cpus. Tested on a VM. Signed-off-by: Silas Boyd-Wickizer <sbw@mit.edu>
Diffstat (limited to 'arch/avr32')
0 files changed, 0 insertions, 0 deletions