[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 9 Oct 2019 18:07:50 -0700
From: Yizhuo <yzhai003@....edu>
To: unlisted-recipients:; (no To-header on input)
Cc: Yizhuo <yzhai003@....edu>, Mark Fasheh <mark@...heh.com>,
Joel Becker <jlbec@...lplan.org>,
Joseph Qi <joseph.qi@...ux.alibaba.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
ChenGang <cg.chen@...wei.com>,
Richard Fontana <rfontana@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Jia Guo <guojia12@...wei.com>, ocfs2-devel@....oracle.com,
linux-kernel@...r.kernel.org
Subject: [PATCH] ocfs2:fix potential Null Ptr Dereference
Inside function o2hb_region_blocks_store(), to_o2hb_region()
could return NULL but there's no check before its dereference,
which is potentially unsafe.
Signed-off-by: Yizhuo <yzhai003@....edu>
---
fs/ocfs2/cluster/heartbeat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index a368350d4c27..93f2b540f245 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -1628,7 +1628,7 @@ static ssize_t o2hb_region_blocks_store(struct config_item *item,
unsigned long tmp;
char *p = (char *)page;
- if (reg->hr_bdev)
+ if (!reg || reg->hr_bdev)
return -EINVAL;
tmp = simple_strtoul(p, &p, 0);
--
2.17.1
Powered by blists - more mailing lists