]> Git Repo - linux.git/commit
kernel/watchdog.c: avoid races between /proc handlers and CPU hotplug
authorUlrich Obergfell <[email protected]>
Fri, 6 Nov 2015 02:44:50 +0000 (18:44 -0800)
committerLinus Torvalds <[email protected]>
Fri, 6 Nov 2015 03:34:48 +0000 (19:34 -0800)
commit8614ddef82139d08234dbf681188f9bcddae9f03
treedc10d978bad575ec2045f1605084485e95313806
parentee89e71eb091d3ef8ca2be8bd4ec77ccfa91334c
kernel/watchdog.c: avoid races between /proc handlers and CPU hotplug

The handler functions for watchdog parameters in /proc/sys/kernel do not
protect themselves against races with CPU hotplug.  Hence, theoretically
it is possible that a new watchdog thread is started on a hotplugged CPU
while a parameter is being modified, and the thread could thus use a
parameter value that is 'in transition'.

For example, if 'watchdog_thresh' is being set to zero (note: this
disables the lockup detectors) the thread would erroneously use the value
zero as the sample period.

To avoid such races and to keep the /proc handler code consistent,
call
     {get|put}_online_cpus() in proc_watchdog_common()
     {get|put}_online_cpus() in proc_watchdog_thresh()
     {get|put}_online_cpus() in proc_watchdog_cpumask()

Signed-off-by: Ulrich Obergfell <[email protected]>
Acked-by: Don Zickus <[email protected]>
Reviewed-by: Aaron Tomlin <[email protected]>
Cc: Ulrich Obergfell <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
kernel/watchdog.c
This page took 0.054525 seconds and 4 git commands to generate.