LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] vfs: Fix NULL pointer dereference in fsync_buffers_list()
@ 2008-03-04 19:11 Jan Kara
0 siblings, 0 replies; only message in thread
From: Jan Kara @ 2008-03-04 19:11 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
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 <jack@suse.cz>
---
Hmm, somehow testing of private_list handling patch on ext2 never hit the code path with
the bug :(. UDF did... Please push to Linus. Thanks.
diff --git a/fs/buffer.c b/fs/buffer.c
index 897cd74..ddfdd2c 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -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);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-03-04 19:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-04 19:11 [PATCH] vfs: Fix NULL pointer dereference in fsync_buffers_list() Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).