linux-sg2042/fs/ocfs2/cluster
Dan Carpenter c57d117f2b ocfs2: fix a use after free on error
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>
2021-02-24 13:38:26 -08:00
..
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
heartbeat.c ocfs2: fix a use after free on error 2021-02-24 13:38:26 -08:00
heartbeat.h ocfs: no need to check return value of debugfs_create functions 2019-07-12 11:05:41 -07: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.c fs/ocfs2/cluster/tcp.c: remove unneeded break 2020-12-15 12:13:37 -08:00
tcp.h ocfs2: cluster: replace zero-length array with flexible-array member 2020-04-02 09:35:25 -07:00
tcp_internal.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 145 2019-05-30 11:25:18 -07:00