Skip to contentSkip to conversation

vhost: fix use after free

PATCH In review Yuanhan Liu 2 participants 3 messages Apr 17, 2017 – Apr 19, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost: fix use after free

A "return" is missing on error, which could lead to a "use after free" issue (about var "conn").

Fixes 65388b43f592 ("vhost: fix fd leaks for vhost-user server mode")

Coverity issue: 143476

---
 lib/librte_vhost/socket.c | 1 +
 1 file changed, 1 insertion(+)
lib/librte_vhost/socket.c +1 -0
index 66fd335..c7f99b0 100644
@@ -242,6 +242,7 @@ struct vhost_user {
 		RTE_LOG(ERR, VHOST_CONFIG,
 			"failed to add fd %d into vhost server fdset\n",
 			fd);
+		return;
 	}
 
 	pthread_mutex_lock(&vsocket->conn_mutex);
Signature · 1 line
1.9.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Yuanhan Liu

A "return" is missing on error, which could lead to a "use after free" issue (about var "conn").

Fixes 65388b43f592 ("vhost: fix fd leaks for vhost-user server mode")

Coverity issue: 143476

---
 lib/librte_vhost/socket.c | 1 +
 1 file changed, 1 insertion(+)

Thanks!
Maxime

author Applied
#2 lore raw
Quoted 9 lines · Maxime Coquelin
Quoted 6 lines · Yuanhan Liu

A "return" is missing on error, which could lead to a "use after free" issue (about var "conn").

Fixes 65388b43f592 ("vhost: fix fd leaks for vhost-user server mode")

Coverity issue: 143476

Quoted 7 lines
Quoted 5 lines

---
lib/librte_vhost/socket.c | 1 +

1 file changed, 1 insertion(+)

Applied to dpdk-next-virtio.

	--yliu