]> git.baikalelectronics.ru Git - kernel.git/commit
[XFS] Fix use-after-free with buffers
authorLachlan McIlroy <lachlan@sgi.com>
Wed, 17 Sep 2008 06:52:13 +0000 (16:52 +1000)
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>
Wed, 17 Sep 2008 06:52:13 +0000 (16:52 +1000)
commit0af926218c4b34609a3259b5f3850af32b3304df
tree6419e5089f94ef8cb10ab49ac3f66b2d67afd40c
parent7508ab40e9e35c4b7c3a5ea60ef88cd06851eda5
[XFS] Fix use-after-free with buffers

We have a use-after-free issue where log completions access buffers via
the buffer log item and the buffer has already been freed. Fix this by
taking a reference on the buffer when attaching the buffer log item and
release the hold when the buffer log item is detached and we no longer
need the buffer. Also create a new function xfs_buf_item_free() to combine
some common code.

SGI-PV: 985757

SGI-Modid: xfs-linux-melb:xfs-kern:32025a

Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
fs/xfs/xfs_buf_item.c