From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 3E1BA58FE for ; Mon, 17 Apr 2017 09:30:07 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Apr 2017 00:30:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,213,1488873600"; d="scan'208";a="1136634069" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by fmsmga001.fm.intel.com with ESMTP; 17 Apr 2017 00:30:05 -0700 From: Yuanhan Liu To: dev@dpdk.org Cc: Maxime Coquelin , Yuanhan Liu Date: Mon, 17 Apr 2017 15:27:04 +0800 Message-Id: <1492414024-18413-1-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 Subject: [dpdk-dev] [PATCH] vhost: fix use after free X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Apr 2017 07:30:08 -0000 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 Signed-off-by: Yuanhan Liu --- 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