Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [High] um: vector: GSO metadata lost for packets with 
VIRTIO_NET_HDR_F_DATA_VALID
--

commit 7c2ce8bab142738766afdbfe57333f1e8eb84738
Author: Michael S. Tsirkin <[email protected]>

    um: vector: honor virtio net hdr conversion failures
    
    virtio_net_hdr_to_skb() refuses packets whose checksum metadata
    it cannot make sense of, but the vector raw transport ignored
    its return value: rejected packets went on into the stack with
    their metadata unvalidated.
    
    Propagate the failure.

> diff --git a/arch/um/drivers/vector_transports.c 
> b/arch/um/drivers/vector_transports.c
> index e1fb2a76fdff5..8b75484586635 100644
> --- a/arch/um/drivers/vector_transports.c
> +++ b/arch/um/drivers/vector_transports.c
> @@ -210,7 +210,9 @@ static int raw_verify_header(
>               return 1;
>  
>       skb_set_network_header(skb, ETH_HLEN);
> -     virtio_net_hdr_to_skb(skb, vheader, virtio_legacy_is_little_endian());
> +     if (virtio_net_hdr_to_skb(skb, vheader,
> +                     virtio_legacy_is_little_endian()) < 0)
> +             return -1;

[Severity: High]
Does the early return above this block cause GSO packets to lose metadata?

Looking at raw_verify_header(), if VIRTIO_NET_HDR_F_DATA_VALID is set in
the virtio network header, the function returns 1 early:

        if ((vheader->flags & VIRTIO_NET_HDR_F_DATA_VALID) > 0)
                return 1;

This skips the call to virtio_net_hdr_to_skb(), which is responsible for
parsing and populating GSO metadata like gso_size and gso_type.

For large GSO packets that happen to have VIRTIO_NET_HDR_F_DATA_VALID set
(such as fully checksummed GSO frames from host TAP devices), would skipping
this setup cause the SKB to be passed up to the network stack as an
unsegmented giant packet?

The network stack would likely drop these oversized packets since they exceed
the device MTU and lack GSO segmentation metadata, causing silent data loss
and breaking TCP/UDP connectivity for these specific offloaded flows.

>       return 0;
>  }

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=2

Reply via email to