DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vhost: use after free
@ 2016-10-19 16:09 Chas Williams
  2016-10-19 20:21 ` Mcnamara, John
  0 siblings, 1 reply; 2+ messages in thread
From: Chas Williams @ 2016-10-19 16:09 UTC (permalink / raw)
  To: dev; +Cc: Chas Williams

Don't dereference freed memory.

Fixes: a277c7159876 ("vhost: refactor code structure")

Signed-off-by: Chas Williams <3chas3@gmail.com>
---
 lib/librte_vhost/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
index 967cb65..aaa9c27 100644
--- a/lib/librte_vhost/socket.c
+++ b/lib/librte_vhost/socket.c
@@ -250,8 +250,8 @@ vhost_user_read_cb(int connfd, void *dat, int *remove)
 		vsocket->connfd = -1;
 		close(connfd);
 		*remove = 1;
-		free(conn);
 		vhost_destroy_device(conn->vid);
+		free(conn);
 
 		if (vsocket->reconnect)
 			vhost_user_create_client(vsocket);
-- 
2.7.4

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

end of thread, other threads:[~2016-10-19 20:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-19 16:09 [dpdk-dev] [PATCH] vhost: use after free Chas Williams
2016-10-19 20:21 ` Mcnamara, John

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).