linux_dsm_epyc7002/fs/ocfs2/cluster
Dan Carpenter b761fd2821 ocfs2: fix a use after free on error
[ Upstream commit c57d117f2b2f2a19b570c36f2819ef8d8210af20 ]

The error handling in this function frees "reg" but it is still on the
"o2hb_all_regions" list so it will lead to a use after freew.  Joseph Qi
points out that we need to clear the bit in the "o2hb_region_bitmap" as
well

Link: https://lkml.kernel.org/r/YBk4M6HUG8jB/jc7@mwanda
Fixes: 1cf257f511 ("ocfs2: fix memory leak")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-04 11:38:18 +01:00
..
heartbeat.c ocfs2: fix a use after free on error 2021-03-04 11:38:18 +01:00
heartbeat.h ocfs: no need to check return value of debugfs_create functions 2019-07-12 11:05:41 -07:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
masklog.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 145 2019-05-30 11:25:18 -07:00
masklog.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 145 2019-05-30 11:25:18 -07:00
netdebug.c ocfs2: use scnprintf() for avoiding potential buffer overflow 2020-04-02 09:35:26 -07:00
nodemanager.c ocfs: no need to check return value of debugfs_create functions 2019-07-12 11:05:41 -07:00
nodemanager.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 145 2019-05-30 11:25:18 -07:00
ocfs2_heartbeat.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 145 2019-05-30 11:25:18 -07:00
ocfs2_nodemanager.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 145 2019-05-30 11:25:18 -07:00
quorum.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
quorum.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 145 2019-05-30 11:25:18 -07:00
sys.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 275 2019-06-05 17:30:30 +02:00
sys.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 275 2019-06-05 17:30:30 +02:00
tcp_internal.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 145 2019-05-30 11:25:18 -07:00
tcp.c tcp: add tcp_sock_set_user_timeout 2020-05-28 11:11:45 -07:00
tcp.h ocfs2: cluster: replace zero-length array with flexible-array member 2020-04-02 09:35:25 -07:00