On Thu, Jul 09, 2026 at 03:32:25PM +0800, [email protected] wrote:
> From: GuoHan Zhao <[email protected]>
> 
> vhost_vdpa_device_set_config() receives the updated config buffer, but
> forwards s->config to the vhost backend. Since s->config is refreshed by
> get_config(), it may contain stale backend state.
>


could you be a bit more specific pls? a real scenario where you
see an issue? thanks!
 
> Pass the supplied config buffer to vhost_dev_set_config() instead.
> 
> Fixes: b430a2bd2303 ("vdpa: add vdpa-dev support")
> Signed-off-by: GuoHan Zhao <[email protected]>
> ---
>  hw/virtio/vdpa-dev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/virtio/vdpa-dev.c b/hw/virtio/vdpa-dev.c
> index 089a77f4d0b9..6dc684ab096a 100644
> --- a/hw/virtio/vdpa-dev.c
> +++ b/hw/virtio/vdpa-dev.c
> @@ -212,7 +212,7 @@ vhost_vdpa_device_set_config(VirtIODevice *vdev, const 
> uint8_t *config)
>      VhostVdpaDevice *s = VHOST_VDPA_DEVICE(vdev);
>      int ret;
>  
> -    ret = vhost_dev_set_config(&s->dev, s->config, 0, s->config_size,
> +    ret = vhost_dev_set_config(&s->dev, config, 0, s->config_size,
>                                 VHOST_SET_CONFIG_TYPE_FRONTEND);
>      if (ret) {
>          error_report("set device config space failed");
> -- 
> 2.43.0


Reply via email to