[PATCH v3] vhost: fix a double fetch when dequeue offloading
Maxime Coquelin
mcoqueli at redhat.com
Wed Oct 15 13:47:12 CEST 2025
On Fri, Oct 10, 2025 at 10:41 AM Yunjian Wang <wangyunjian at huawei.com> wrote:
>
> The hdr->csum_start does two successive reads from user space to read a
> variable length data structure. The result overflow if the data structure
> changes between the two reads.
>
> To fix this, we can prevent double fetch issue by copying virtio_hdr to
> the temporary variable.
>
> Fixes: 4dc4e33ffa10 ("net/virtio: fix Rx checksum calculation")
> Cc: stable at dpdk.org
>
> Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
> ---
> v3: update code styles suggested by Stephen Hemminger
> ---
> lib/vhost/virtio_net.c | 50 ++++++++++++++++++++++--------------------
> 1 file changed, 26 insertions(+), 24 deletions(-)
>
Applied to next-virtio/for-next-net.
Thanks,
Maxime
More information about the dev
mailing list