diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2008-11-27 03:27:28 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2009-01-05 02:39:14 -0500 |
commit | 3af165ac4d099385b12e3e75a9ee3ffd02da33e0 (patch) | |
tree | b90552f6ac8db316c05d5f3246366cfa09cc7473 /fs/gfs2/glock.c | |
parent | 2e204703a1161e9bae38ba0d3d0df04a679e6f4f (diff) |
GFS2: Fix use-after-free bug on umount
There was a use-after-free with the GFS2 super block during
umount. This patch moves almost all of the umount code from
->put_super into ->kill_sb, the only bit that cannot be moved
being the glock hash clearing which has to remain as ->put_super
due to umount ordering requirements. As a result its now obvious
that the kfree is the final operation, whereas before it was
hidden in ->put_super.
Also gfs2_jindex_free is then only referenced from a single file
so thats moved and marked static too.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/glock.c')
-rw-r--r-- | fs/gfs2/glock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 6e298b070117..5eae62e7f778 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c | |||
@@ -1547,8 +1547,9 @@ static void clear_glock(struct gfs2_glock *gl) | |||
1547 | * Called when unmounting the filesystem. | 1547 | * Called when unmounting the filesystem. |
1548 | */ | 1548 | */ |
1549 | 1549 | ||
1550 | void gfs2_gl_hash_clear(struct gfs2_sbd *sdp) | 1550 | void gfs2_gl_hash_clear(struct super_block *sb) |
1551 | { | 1551 | { |
1552 | struct gfs2_sbd *sdp = sb->s_fs_info; | ||
1552 | unsigned long t; | 1553 | unsigned long t; |
1553 | unsigned int x; | 1554 | unsigned int x; |
1554 | int cont; | 1555 | int cont; |