]> git.baikalelectronics.ru Git - kernel.git/commit
reiserfs: Fix use after free in journal teardown
authorJan Kara <jack@suse.cz>
Wed, 6 Aug 2014 17:43:56 +0000 (19:43 +0200)
committerJan Kara <jack@suse.cz>
Tue, 12 Aug 2014 10:46:30 +0000 (12:46 +0200)
commit33cc6135cbf7f1fdbc552482e3e2e92945653c82
tree249981494b2563e689b091fe4e67929e4ddc113c
parentb7c3d3315a2b672ccb4d1a4bae3ed6f3ed8e8112
reiserfs: Fix use after free in journal teardown

If do_journal_release() races with do_journal_end() which requeues
delayed works for transaction flushing, we can leave work items for
flushing outstanding transactions queued while freeing them. That
results in use after free and possible crash in run_timers_softirq().

Fix the problem by not requeueing works if superblock is being shut down
(MS_ACTIVE not set) and using cancel_delayed_work_sync() in
do_journal_release().

CC: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
fs/reiserfs/journal.c
fs/reiserfs/super.c