提交 2d2422ae 编写于 作者: C Christoph Hellwig 提交者: Alex Elder

xfs: fix a use after free in xfs_end_io_direct_write

There is a window in which the ioend that we call inode_dio_wake on
in xfs_end_io_direct_write is already free.  Fix this by storing
the inode pointer in a local variable.

This is a fix for the regression introduced in 3.1-rc by
"fs: move inode_dio_done to the end_io handler".
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NAlex Elder <aelder@sgi.com>
上级 003f6c9d
...@@ -1300,6 +1300,7 @@ xfs_end_io_direct_write( ...@@ -1300,6 +1300,7 @@ xfs_end_io_direct_write(
bool is_async) bool is_async)
{ {
struct xfs_ioend *ioend = iocb->private; struct xfs_ioend *ioend = iocb->private;
struct inode *inode = ioend->io_inode;
/* /*
* blockdev_direct_IO can return an error even after the I/O * blockdev_direct_IO can return an error even after the I/O
...@@ -1331,7 +1332,7 @@ xfs_end_io_direct_write( ...@@ -1331,7 +1332,7 @@ xfs_end_io_direct_write(
} }
/* XXX: probably should move into the real I/O completion handler */ /* XXX: probably should move into the real I/O completion handler */
inode_dio_done(ioend->io_inode); inode_dio_done(inode);
} }
STATIC ssize_t STATIC ssize_t
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册