vhost: fix use after free
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
Reported-by John McNamara <[email protected]>
Signed-off-by Yuanhan Liu <[email protected]>
--- lib/librte_vhost/socket.c | 1 + 1 file changed, 1 insertion(+)
lib/librte_vhost/socket.c +1 -0
@@ -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
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
Reported-by John McNamara <[email protected]>Signed-off-by Yuanhan Liu <[email protected]>--- lib/librte_vhost/socket.c | 1 + 1 file changed, 1 insertion(+)
Reviewed-by Maxime Coquelin <[email protected]>
Thanks!
Maxime
Yuanhan Liu
AppliedQuoted 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
Reported-by John McNamara <[email protected]>Signed-off-by Yuanhan Liu <[email protected]>---
lib/librte_vhost/socket.c| 1 +1 file changed, 1 insertion(+)Reviewed-by Maxime Coquelin <[email protected]>
Applied to dpdk-next-virtio.
--yliu