Skip to content

Commit

Permalink
ext4: fix del_timer() misuse for ->s_err_report
Browse files Browse the repository at this point in the history
That thing should be del_timer_sync(); consider what happens
if ext4_put_super() call of del_timer() happens to come just as it's
getting run on another CPU.  Since that timer reschedules itself
to run next day, you are pretty much guaranteed that you'll end up
with kfree'd scheduled timer, with usual fun consequences.  AFAICS,
that's -stable fodder all way back to 2010... [the second del_timer_sync()
is almost certainly not needed, but it doesn't hurt either]

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@vger.kernel.org
  • Loading branch information
Al Viro authored and Theodore Ts'o committed Dec 9, 2013
1 parent 5946d08 commit 9105bb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/ext4/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ static void ext4_put_super(struct super_block *sb)
}

ext4_es_unregister_shrinker(sbi);
del_timer(&sbi->s_err_report);
del_timer_sync(&sbi->s_err_report);
ext4_release_system_zone(sb);
ext4_mb_release(sb);
ext4_ext_release(sb);
Expand Down Expand Up @@ -4184,7 +4184,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
}
failed_mount3:
ext4_es_unregister_shrinker(sbi);
del_timer(&sbi->s_err_report);
del_timer_sync(&sbi->s_err_report);
if (sbi->s_flex_groups)
ext4_kvfree(sbi->s_flex_groups);
percpu_counter_destroy(&sbi->s_freeclusters_counter);
Expand Down

0 comments on commit 9105bb1

Please sign in to comment.