[dpdk-dev] vhost: fix use after free
Checks
Commit Message
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(+)
Comments
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
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
@@ -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);