On 10/26/20 5:39 PM, Adrian Moreno wrote:
> GET/SET STATUS is an optional feature, so it may not be negotiated. In
> that case, the VIRTIO_GET_STATUS call will not update the status (given
> as a pointer argument). Failing to identify this case would lead to
> undefined behavior as the device status will be updated with the value
> of a stack-allocated variable.
>
> To fix this, return ENOTSUP if the feature is not supported and, in that
> case, don't update device status.
>
> Fixes: 44102e6298e7 ("net/virtio: check protocol feature in user backend")
> Cc: maxime.coque...@redhat.com
> Cc sta...@dpdk.org
>
> Signed-off-by: Adrian Moreno <amore...@redhat.com>
> ---
> drivers/net/virtio/virtio_user/vhost_user.c | 4 +--
> .../net/virtio/virtio_user/virtio_user_dev.c | 28 +++++++++----------
> 2 files changed, 15 insertions(+), 17 deletions(-)
>
Reviewed-by: Maxime Coquelin <maxime.coque...@redhat.com>
Thanks,
Maxime