• Willem de Bruijn's avatar
    udp: segment looped gso packets correctly · 6cd021a5
    Willem de Bruijn authored
    Multicast and broadcast packets can be looped from egress to ingress
    pre segmentation with dev_loopback_xmit. That function unconditionally
    sets ip_summed to CHECKSUM_UNNECESSARY.
    
    udp_rcv_segment segments gso packets in the udp rx path. Segmentation
    usually executes on egress, and does not expect packets of this type.
    __udp_gso_segment interprets !CHECKSUM_PARTIAL as CHECKSUM_NONE. But
    the offsets are not correct for gso_make_checksum.
    
    UDP GSO packets are of type CHECKSUM_PARTIAL, with their uh->check set
    to the correct pseudo header checksum. Reset ip_summed to this type.
    (CHECKSUM_PARTIAL is allowed on ingress, see comments in skbuff.h)
    Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
    Fixes: cf329aa4 ("udp: cope with UDP GRO packet misdirection")
    Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    6cd021a5
udp.h 14.2 KB