All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vhost: fix use after free
@ 2017-04-17  7:27 Yuanhan Liu
  2017-04-18  8:20 ` Maxime Coquelin
  0 siblings, 1 reply; 3+ messages in thread
From: Yuanhan Liu @ 2017-04-17  7:27 UTC (permalink / raw)
  To: dev; +Cc: Maxime Coquelin, 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 <john.mcnamara@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
---
 lib/librte_vhost/socket.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
index 66fd335..c7f99b0 100644
--- a/lib/librte_vhost/socket.c
+++ b/lib/librte_vhost/socket.c
@@ -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);
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] vhost: fix use after free
  2017-04-17  7:27 [PATCH] vhost: fix use after free Yuanhan Liu
@ 2017-04-18  8:20 ` Maxime Coquelin
  2017-04-19  1:05   ` Yuanhan Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Maxime Coquelin @ 2017-04-18  8:20 UTC (permalink / raw)
  To: Yuanhan Liu, dev



On 04/17/2017 09:27 AM, Yuanhan Liu wrote:
> 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 <john.mcnamara@intel.com>
> Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
> ---
>  lib/librte_vhost/socket.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks!
Maxime

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] vhost: fix use after free
  2017-04-18  8:20 ` Maxime Coquelin
@ 2017-04-19  1:05   ` Yuanhan Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Yuanhan Liu @ 2017-04-19  1:05 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: dev

On Tue, Apr 18, 2017 at 10:20:41AM +0200, Maxime Coquelin wrote:
> 
> 
> On 04/17/2017 09:27 AM, Yuanhan Liu wrote:
> >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 <john.mcnamara@intel.com>
> >Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
> >---
> > lib/librte_vhost/socket.c | 1 +
> > 1 file changed, 1 insertion(+)
> 
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Applied to dpdk-next-virtio.

	--yliu

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-19  1:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-17  7:27 [PATCH] vhost: fix use after free Yuanhan Liu
2017-04-18  8:20 ` Maxime Coquelin
2017-04-19  1:05   ` Yuanhan Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.