kernel_optimize_test/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
Makefile
masklog.c
masklog.h
netdebug.c ocfs2: use scnprintf() for avoiding potential buffer overflow 2020-04-02 09:35:26 -07:00
nodemanager.c
nodemanager.h
ocfs2_heartbeat.h
ocfs2_nodemanager.h
quorum.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
quorum.h
sys.c
sys.h
tcp_internal.h
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