Bob Peterson 9290a9a7c0 GFS2: Fix use-after-free race when calling gfs2_remove_from_ail
Function gfs2_remove_from_ail drops the reference on the bh via
brelse. This patch fixes a race condition whereby bh is deferenced
after the brelse when setting bd->bd_blkno = bh->b_blocknr;
Under certain rare circumstances, bh might be gone or reused,
and bd->bd_blkno is set to whatever that memory happens to be,
which is often 0. Later, in gfs2_trans_add_unrevoke, that bd fails
the test "bd->bd_blkno >= blkno" which causes it to never be freed.
The end result is that the bd is never freed from the bufdata cache,
which results in this error:
slab error in kmem_cache_destroy(): cache `gfs2_bufdata': Can't free all objects

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2013-12-13 21:42:23 +00:00
..
2011-07-25 14:30:23 -04:00
2010-09-20 11:18:16 +01:00
2013-09-05 16:23:51 -04:00
2013-06-29 12:57:05 +04:00
2008-06-27 09:39:44 +01:00
2013-10-15 15:18:08 +01:00
2013-10-15 15:18:08 +01:00
2011-10-21 12:39:41 +01:00
2013-11-04 11:17:49 +00:00
2013-06-14 11:17:15 +01:00
2013-06-03 14:20:18 -07:00
2013-11-15 22:04:16 -05:00
2013-08-19 17:26:32 +01:00
2013-06-05 09:50:40 +01:00
2013-11-04 11:17:49 +00:00
2011-05-10 13:12:49 +01:00
2013-08-19 17:26:32 +01:00
2013-08-19 17:26:32 +01:00
2013-11-15 22:04:16 -05:00
2013-11-04 11:17:49 +00:00
2013-11-15 22:04:16 -05:00
2013-09-27 12:49:33 +01:00
2013-01-29 10:29:05 +00:00
2013-10-04 09:49:29 +01:00
2012-01-11 09:23:05 +00:00
2013-06-19 21:29:19 +01:00
2009-12-16 12:16:49 -05:00