summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/log.c
diff options
context:
space:
mode:
authorTejun Heo2011-11-21 21:32:22 +0100
committerTejun Heo2011-11-21 21:32:22 +0100
commit50fb4f7fc907efff65eadb0b74387a9ffed6e849 (patch)
treee3392afa49a97c187d7e63f3fee862aef9e342ed /fs/gfs2/log.c
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (diff)
downloadkernel-qcow2-linux-50fb4f7fc907efff65eadb0b74387a9ffed6e849.tar.gz
kernel-qcow2-linux-50fb4f7fc907efff65eadb0b74387a9ffed6e849.tar.xz
kernel-qcow2-linux-50fb4f7fc907efff65eadb0b74387a9ffed6e849.zip
freezer: fix current->state restoration race in refrigerator()
refrigerator() saves current->state before entering frozen state and restores it before returning using __set_current_state(); however, this is racy, for example, please consider the following sequence. set_current_state(TASK_INTERRUPTIBLE); try_to_freeze(); if (kthread_should_stop()) break; schedule(); If kthread_stop() races with ->state restoration, the restoration can restore ->state to TASK_INTERRUPTIBLE after kthread_stop() sets it to TASK_RUNNING but kthread_should_stop() may still see zero ->should_stop because there's no memory barrier between restoring TASK_INTERRUPTIBLE and kthread_should_stop() test. This isn't restricted to kthread_should_stop(). current->state is often used in memory barrier based synchronization and silently restoring it w/o mb breaks them. Use set_current_state() instead. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'fs/gfs2/log.c')
0 files changed, 0 insertions, 0 deletions