Skip to contentSkip to conversation

ocfs2/dlm: fix a variable overflow problem in dlmdomain.c

PATCH Superseded piaojun 2 participants 3 messages Mar 14, 2016 OCFS2

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

piaojun

author
#0 lore raw

PATCH 1/1 ocfs2/dlm: fix a variable overflow problem in dlmdomain.c

In dlm_send_join_cancels(), unsigned int node is assigned -1, this will lead variable overflow. Although this won't cause any runtime problem, the code looks a little uncoordinated.

---
 dlm/dlmdomain.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
dlm/dlmdomain.c +1 -2
index 2ee7fe7..61bafa7 100644
@@ -1395,8 +1395,7 @@ static int dlm_send_join_cancels(struct dlm_ctxt *dlm,
 				 unsigned long *node_map,
 				 unsigned int map_size)
 {
-	int status, tmpstat;
-	unsigned int node;
+	int status, tmpstat, int node;
 
 	if (map_size != (BITS_TO_LONGS(O2NM_MAX_NODES) *
 			 sizeof(unsigned long))) {
Signature · 1 line
1.8.4.3
#1 lore raw

PATCH 1/1 ocfs2/dlm: fix a variable overflow problem in dlmdomain.c

Quoted 15 lines · piaojun

In dlm_send_join_cancels(), unsigned int node is assigned -1, this will lead variable overflow. Although this won't cause any runtime problem, the code looks a little uncoordinated.

---
 dlm/dlmdomain.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
dlm/dlmdomain.c +0 -0
index 2ee7fe7..61bafa7 100644

dlm/dlmdomain.c static int dlm_send_join_cancels(struct dlm_ctxt *dlm, · line 1398

Quoted 6 lines
dlm/dlmdomain.c +1 -2
@@ -1395,8 +1395,7 @@ static int dlm_send_join_cancels(struct dlm_ctxt *dlm,
 				 unsigned long *node_map,
 				 unsigned int map_size)
 {
-	int status, tmpstat;
-	unsigned int node;
+	int status, tmpstat, int node;

This is not right. NAK.

Quoted 4 lines
dlm/dlmdomain.c +0 -0
 	if (map_size != (BITS_TO_LONGS(O2NM_MAX_NODES) *
 			 sizeof(unsigned long))) {
 
author
#2 lore raw

PATCH 1/1 ocfs2/dlm: fix a variable overflow problem in dlmdomain.c

Quoted 11 lines · Joseph Qi
Quoted 10 lines · piaojun

In dlm_send_join_cancels(), unsigned int node is assigned -1, this will lead variable overflow. Although this won't cause any runtime problem, the code looks a little uncoordinated.

---
 dlm/dlmdomain.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 13 lines

dlm/dlmdomain.c static int dlm_send_join_cancels(struct dlm_ctxt *dlm, · line 1398

Quoted 11 lines
dlm/dlmdomain.c +1 -2
index 2ee7fe7..61bafa7 100644
@@ -1395,8 +1395,7 @@ static int dlm_send_join_cancels(struct dlm_ctxt *dlm,
 				 unsigned long *node_map,
 				 unsigned int map_size)
 {
-	int status, tmpstat;
-	unsigned int node;
+	int status, tmpstat, int node;

This is not right. NAK.

Hi Joseph Qi, Thanks for your prompt, I have sent a V2 patch to fix this.

Quoted 9 lines

dlm/dlmdomain.c static int dlm_send_join_cancels(struct dlm_ctxt *dlm,

Quoted 4 lines
dlm/dlmdomain.c +0 -0
 	if (map_size != (BITS_TO_LONGS(O2NM_MAX_NODES) *
 			 sizeof(unsigned long))) {
 

.