Skip to contentSkip to conversation

infiniband-diags/libibnetdisc/ibnetdisc.c: Fix possible overrun of path

PATCH Applied Hal Rosenstock 2 participants 2 messages Jun 8, 2011 – Jun 10, 2011 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 infiniband-diags/libibnetdisc/ibnetdisc.c: Fix possible overrun of path

when path->cnt is 63 in add_port_to_dpath

---

libibnetdisc/src/ibnetdisc.c +1 -1
index 7ba87fd..4a4f33b 100644
@@ -80,7 +80,7 @@ static int query_switch_info(smp_engine_t * engine, ib_portid_t * portid,
 
 static int add_port_to_dpath(ib_dr_path_t * path, int nextport)
 {
-	if (path->cnt > sizeof(path->p) - 1)
+	if (path->cnt > sizeof(path->p) - 2)
 		return -1;
 	++path->cnt;
 	path->p[path->cnt] = (uint8_t) nextport;

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied
#2 lore raw
In reply to a message not in the archive
Quoted 4 lines · On Wed, 8 Jun 2011 05:47:15 -0700 Hal Rosenstock…

when path->cnt is 63 in add_port_to_dpath

Thanks applied,
Ira

Quoted 14 lines

---

libibnetdisc/src/ibnetdisc.c +1 -1
index 7ba87fd..4a4f33b 100644
@@ -80,7 +80,7 @@ static int query_switch_info(smp_engine_t * engine, ib_portid_t * portid,
 
 static int add_port_to_dpath(ib_dr_path_t * path, int nextport)
 {
-	if (path->cnt > sizeof(path->p) - 1)
+	if (path->cnt > sizeof(path->p) - 2)
 		return -1;
 	++path->cnt;
 	path->p[path->cnt] = (uint8_t) nextport;
Signature · 9 lines
Ira Weiny
Math Programmer/Computer Scientist
Lawrence Livermore National Lab
925-423-8008
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html