[dpdk-stable] [PATCH v2] examples/vhost: fix use-after-free on drain vhost

Xia, Chenbo chenbo.xia at intel.com
Wed Sep 29 09:23:35 CEST 2021


> -----Original Message-----
> From: Ma, WenwuX <wenwux.ma at intel.com>
> Sent: Saturday, September 25, 2021 1:23 AM
> To: dev at dpdk.org
> Cc: maxime.coquelin at redhat.com; Xia, Chenbo <chenbo.xia at intel.com>; Jiang,
> Cheng1 <cheng1.jiang at intel.com>; Hu, Jiayu <jiayu.hu at intel.com>; Yang, YvonneX
> <yvonnex.yang at intel.com>; Ma, WenwuX <wenwux.ma at intel.com>; stable at dpdk.org
> Subject: [PATCH v2] examples/vhost: fix use-after-free on drain vhost
> 
> When a vdev is removed in destroy_device function,
> the corresponding vhost TX buffer will also be freed,
> but the vhost TX buffer may still be used in the
> drain_vhost function, which will cause an error of
> heap-use-after-free. Therefore, before accessing
> vhost TX buffer, we need to check whether the vdev
> has been removed, if so, let's skip this vdev.
> 
> Fixes: a68ba8e0a6b6 ("examples/vhost: refactor vhost data path")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Wenwu Ma <wenwux.ma at intel.com>
> ---

Reviewed-by: Chenbo Xia <chenbo.xia at intel.com>


More information about the stable mailing list