diff options
| author | Oleg Nesterov <oleg@redhat.com> | 2016-09-26 18:07:48 +0200 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-11 10:58:22 +0200 |
| commit | 3eef364f71f9792805fd8173e7d9d2e981e13be9 (patch) | |
| tree | a40addbaea962987cff367409ff57171c08fa4d9 /drivers | |
| parent | d41c83046d8cfb1c7c8527f2c75a3731b63af351 (diff) | |
fs/super.c: fix race between freeze_super() and thaw_super()
commit 89f39af129382a40d7cd1f6914617282cfeee28e upstream.
Change thaw_super() to check frozen != SB_FREEZE_COMPLETE rather than
frozen == SB_UNFROZEN, otherwise it can race with freeze_super() which
drops sb->s_umount after SB_FREEZE_WRITE to preserve the lock ordering.
In this case thaw_super() will wrongly call s_op->unfreeze_fs() before
it was actually frozen, and call sb_freeze_unlock() which leads to the
unbalanced percpu_up_write(). Unfortunately lockdep can't detect this,
so this triggers misc BUG_ON()'s in kernel/rcu/sync.c.
Reported-and-tested-by: Nikolay Borisov <kernel@kyup.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions
