On Fri, Oct 10, 2025 at 10:41 AM Yunjian Wang <[email protected]> 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: [email protected]
>
> Signed-off-by: Yunjian Wang <[email protected]>
> ---
> 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

Reply via email to