Skip to content

Commit

Permalink
vfs: fix NULL pointer dereference in fsync_buffers_list()
Browse files Browse the repository at this point in the history
Fix NULL pointer dereference in fsync_buffers_list() introduced by recent fix
of races in private_list handling.  Since bh->b_assoc_map has been cleared in
__remove_assoc_queue() we should really use original value stored in the
'mapping' variable.

Signed-off-by: Jan Kara <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
jankara authored and Linus Torvalds committed Mar 5, 2008
1 parent 10ed273 commit e389229
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ static int fsync_buffers_list(spinlock_t *lock, struct list_head *list)
smp_mb();
if (buffer_dirty(bh)) {
list_add(&bh->b_assoc_buffers,
&bh->b_assoc_map->private_list);
&mapping->private_list);
bh->b_assoc_map = mapping;
}
spin_unlock(lock);
Expand Down

0 comments on commit e389229

Please sign in to comment.