Commit 82106056 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] reiserfs: fix null pointer deref

From: Chris Mason <mason@suse.com>

From: Jeff Mahoney <jeffm@suse.de>

fsstress manages to setup a sequence of events that allow an attempt to
perform direct-io on a tail.  bh_result->b_page == NULL, which causes the
PageLocked and PageWriteback checks to perform a NULL deref, causing the
oops.
parent d41853b1
...@@ -444,7 +444,7 @@ static int reiserfs_get_blocks_direct_io(struct inode *inode, ...@@ -444,7 +444,7 @@ static int reiserfs_get_blocks_direct_io(struct inode *inode,
/* make sure future calls to the direct io funcs for this offset /* make sure future calls to the direct io funcs for this offset
** in the file fail by unmapping the buffer ** in the file fail by unmapping the buffer
*/ */
reiserfs_unmap_buffer(bh_result); clear_buffer_mapped(bh_result);
ret = -EINVAL ; ret = -EINVAL ;
} }
/* Possible unpacked tail. Flush the data before pages have /* Possible unpacked tail. Flush the data before pages have
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment