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: [email protected]
> Cc [email protected]
>
> Signed-off-by: Adrian Moreno <[email protected]>
> ---
> 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 <[email protected]>
Thanks,
Maxime
- [dpdk-dev] [PATCH v3 0/6] net/virtio-user: fix server mode Adrian Moreno
- [dpdk-dev] [PATCH v3 1/6] net/virtio-user: fix backen... Adrian Moreno
- [dpdk-dev] [PATCH v3 2/6] net/virtio-user: don't set/... Adrian Moreno
- [dpdk-dev] [PATCH v3 3/6] net/virtio-user: ignore res... Adrian Moreno
- Re: [dpdk-dev] [PATCH v3 3/6] net/virtio-user: ig... Maxime Coquelin
- [dpdk-dev] [PATCH v3 5/6] net/virtio-user: don't assu... Adrian Moreno
- Re: [dpdk-dev] [PATCH v3 5/6] net/virtio-user: do... Maxime Coquelin
- [dpdk-dev] [PATCH v3 4/6] net/virtio-user: lock-prote... Adrian Moreno
- Re: [dpdk-dev] [PATCH v3 4/6] net/virtio-user: lo... Maxime Coquelin
- [dpdk-dev] [PATCH v3 6/6] net/virtio-user: set status... Adrian Moreno
- Re: [dpdk-dev] [PATCH v3 6/6] net/virtio-user: se... Maxime Coquelin
- Re: [dpdk-dev] [PATCH v3 0/6] net/virtio-user: fix se... Jiang, YuX
- Re: [dpdk-dev] [PATCH v3 0/6] net/virtio-user: fix se... Maxime Coquelin

