alistair23-linux/fs/gfs2
Thomas Tai cc1dfa8b75 gfs2: fix slab corruption during mounting and umounting gfs file system
When using cman-3.0.12.1 and gfs2-utils-3.0.12.1, mounting and
unmounting GFS2 file system would cause kernel to hang. The slab
allocator suggests that it is likely a double free memory corruption.
The issue is traced back to v3.9-rc6 where a patch is submitted to
use kzalloc() for storing a bitmap instead of using a local variable.
The intention is to allocate memory during mount and to free memory
during unmount. The original patch misses a code path which has
already freed the memory and caused memory corruption. This patch sets
the memory pointer to NULL after the memory is freed, so that double
free memory corruption will not happen.

gdlm_mount()
  '-- set_recover_size() which use kzalloc()
  '-- if dlm does not support ops callbacks then
          '--- free_recover_size() which use kfree()

gldm_unmount()
  '-- free_recover_size() which use kfree()

Previous patch which introduced the double free issue is
commit 57c7310b8e ("GFS2: use kmalloc for lvb bitmap")

Signed-off-by: Thomas Tai <thomas.tai@oracle.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
2017-08-15 11:54:09 -05:00
..
acl.c gfs2: Don't clear SGID when inheriting ACLs 2017-07-19 10:58:54 -05:00
acl.h gfs2: Switch to generic xattr handlers 2016-05-12 22:28:05 -04:00
aops.c gfs2: forcibly flush ail to relieve memory pressure 2017-08-10 10:51:03 -05:00
bmap.c gfs2: add flag REQ_PRIO for metadata I/O 2017-07-21 07:48:22 -05:00
bmap.h GFS2: Clean up journal extent mapping 2014-03-03 13:50:12 +00:00
dentry.c gfs2: Lock holder cleanup 2016-06-27 09:47:09 -05:00
dir.c gfs2: add flag REQ_PRIO for metadata I/O 2017-07-21 07:48:22 -05:00
dir.h GFS2: Make rename not save dirent location 2014-10-01 14:06:15 +01:00
export.c gfs2: Get rid of gfs2_ilookup 2016-06-27 09:47:08 -05:00
file.c gfs2: Lock holder cleanup (fixup) 2017-07-17 13:39:15 -05:00
gfs2.h [GFS2] Remove remote lock dropping code 2008-06-27 09:39:44 +01:00
glock.c gfs2: Clean up waiting on glocks 2017-08-10 10:51:02 -05:00
glock.h gfs2: gfs2_evict_inode: Put glocks asynchronously 2017-08-10 10:45:21 -05:00
glops.c gfs2: Get rid of gfs2_set_nlink 2017-08-10 10:42:11 -05:00
glops.h GFS2: update freeze code to use freeze/thaw_super on all nodes 2014-11-17 10:36:39 +00:00
incore.h gfs2: forcibly flush ail to relieve memory pressure 2017-08-10 10:51:03 -05:00
inode.c gfs2: Fix trivial typos 2017-08-09 09:36:39 -05:00
inode.h GFS2: use BIT() macro 2016-08-02 12:05:27 -05:00
Kconfig Finally eradicate CONFIG_HOTPLUG 2013-06-03 14:20:18 -07:00
lock_dlm.c gfs2: fix slab corruption during mounting and umounting gfs file system 2017-08-15 11:54:09 -05:00
log.c gfs2: forcibly flush ail to relieve memory pressure 2017-08-10 10:51:03 -05:00
log.h GFS2: remove transaction glock 2014-05-14 10:04:34 +01:00
lops.c Writeback error handling fixes (pile #2) 2017-07-07 19:38:17 -07:00
lops.h gfs2: use bio op accessors 2016-06-07 13:41:38 -06:00
main.c GFS2: Remove gl_list from glock structure 2017-06-12 14:39:12 -05:00
Makefile GFS2: Rename ops_inode.c to inode.c 2011-05-10 13:12:49 +01:00
meta_io.c gfs2: add flag REQ_PRIO for metadata I/O 2017-07-21 07:48:22 -05:00
meta_io.h GFS2: Refactor gfs2_remove_from_journal 2016-05-06 11:27:27 -05:00
ops_fstype.c GFS2: Delete debugfs files only after we evict the glocks 2017-08-09 09:36:39 -05:00
quota.c gfs2: add flag REQ_PRIO for metadata I/O 2017-07-21 07:48:22 -05:00
quota.h GFS2: Make rgrp reservations part of the gfs2_inode structure 2015-12-14 12:16:38 -06:00
recovery.c GFS2: Fix gfs2_replay_incr_blk for multiple journal sizes 2016-07-21 13:02:44 -05:00
recovery.h GFS2: Fix gfs2_replay_incr_blk for multiple journal sizes 2016-07-21 13:02:44 -05:00
rgrp.c GFS2: Don't bother trying to add rgrps to the lru list 2017-08-09 09:36:38 -05:00
rgrp.h GFS2: Non-recursive delete 2017-04-19 08:25:43 -04:00
super.c gfs2: Defer deleting inodes under memory pressure 2017-08-10 10:49:13 -05:00
super.h GFS2: update freeze code to use freeze/thaw_super on all nodes 2014-11-17 10:36:39 +00:00
sys.c We've got eight GFS2 patches for this merge window: 2017-07-05 16:57:08 -07:00
sys.h GFS2: dlm based recovery coordination 2012-01-11 09:23:05 +00:00
trace_gfs2.h gfs2: Make statistics unsigned, suitable for use with do_div() 2015-09-03 13:33:32 -05:00
trans.c GFS2: Reduce contention on gfs2_log_lock 2017-01-30 12:10:25 -05:00
trans.h GFS2: Split gfs2_trans_add_bh() into two 2013-01-29 10:28:04 +00:00
util.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
util.h GFS2: Make rgrp reservations part of the gfs2_inode structure 2015-12-14 12:16:38 -06:00
xattr.c gfs2: Protect gl->gl_object by spin lock 2017-07-05 07:20:52 -05:00
xattr.h gfs2: Remove gfs2_xattr_acl_chmod 2015-12-06 21:25:17 -05:00