Subject: [merged] ocfs2-fix-null-pointer-dereference-when-tranverse-o2hb_all_regions.patch removed from -mm tree To: xuejiufei@xxxxxxxxxx,jeff.liu@xxxxxxxxxx,jiangyiwen@xxxxxxxxxx,jlbec@xxxxxxxxxxxx,mfasheh@xxxxxxxx,sunil.mushran@xxxxxxxxx,mm-commits@xxxxxxxxxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Mon, 08 Jul 2013 12:23:37 -0700 The patch titled Subject: ocfs2: fix NULL pointer dereference when traversing o2hb_all_regions has been removed from the -mm tree. Its filename was ocfs2-fix-null-pointer-dereference-when-tranverse-o2hb_all_regions.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ From: Xue jiufei <xuejiufei@xxxxxxxxxx> Subject: ocfs2: fix NULL pointer dereference when traversing o2hb_all_regions There may exist NULL pointer dereference in config_item_name() when one volume(say Volume A) unmounts while another(say Volume B) mounting. Volume A Volume B already Mounted. Unmounting, call o2hb_heartbeat_group_drop_item() -> config_item_put(item) set reg(A)->item.ci_name to NULL in function config_item_cleanup(). begin mounting, call o2hb_region_pin() and tranverse all regions. When reading reg(A)->item.ci_name, it causes NULL pointer dereference. call o2hb_region_release() and del reg(A) from list. So we should skip accessing regions that is going to release when tranverse o2hb_all_regions. Signed-off-by: Yiwen Jiang <jiangyiwen@xxxxxxxxxx> Signed-off-by: joyce <xuejiufei@xxxxxxxxxx> Acked-by: Joel Becker <jlbec@xxxxxxxxxxxx> Cc: Mark Fasheh <mfasheh@xxxxxxxx> Cc: Sunil Mushran <sunil.mushran@xxxxxxxxx> Cc: Jie Liu <jeff.liu@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/ocfs2/cluster/heartbeat.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff -puN fs/ocfs2/cluster/heartbeat.c~ocfs2-fix-null-pointer-dereference-when-tranverse-o2hb_all_regions fs/ocfs2/cluster/heartbeat.c --- a/fs/ocfs2/cluster/heartbeat.c~ocfs2-fix-null-pointer-dereference-when-tranverse-o2hb_all_regions +++ a/fs/ocfs2/cluster/heartbeat.c @@ -2389,6 +2389,9 @@ static int o2hb_region_pin(const char *r assert_spin_locked(&o2hb_live_lock); list_for_each_entry(reg, &o2hb_all_regions, hr_all_item) { + if (reg->hr_item_dropped) + continue; + uuid = config_item_name(®->hr_item); /* local heartbeat */ @@ -2439,6 +2442,9 @@ static void o2hb_region_unpin(const char assert_spin_locked(&o2hb_live_lock); list_for_each_entry(reg, &o2hb_all_regions, hr_all_item) { + if (reg->hr_item_dropped) + continue; + uuid = config_item_name(®->hr_item); if (region_uuid) { if (strcmp(region_uuid, uuid)) @@ -2654,6 +2660,9 @@ int o2hb_get_all_regions(char *region_uu p = region_uuids; list_for_each_entry(reg, &o2hb_all_regions, hr_all_item) { + if (reg->hr_item_dropped) + continue; + mlog(0, "Region: %s\n", config_item_name(®->hr_item)); if (numregs < max_regions) { memcpy(p, config_item_name(®->hr_item), _ Patches currently in -mm which might be from xuejiufei@xxxxxxxxxx are origin.patch linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html