• Alexey Kodanev's avatar
    udplite: fix partial checksum initialization · 15f35d49
    Alexey Kodanev authored
    Since UDP-Lite is always using checksum, the following path is
    triggered when calculating pseudo header for it:
      udp4_csum_init() or udp6_csum_init()
    The problem can appear if skb->len is less than CHECKSUM_BREAK. In
    this particular case __skb_checksum_validate_complete() also invokes
    __skb_checksum_complete(skb). If UDP-Lite is using partial checksum
    that covers only part of a packet, the function will return bad
    checksum and the packet will be dropped.
    It can be fixed if we skip skb_checksum_init_zero_check() and only
    set the required pseudo header checksum for UDP-Lite with partial
    checksum before udp4_csum_init()/udp6_csum_init() functions return.
    Fixes: ed70fcfc ("net: Call skb_checksum_init in IPv4")
    Fixes: e4f45b7f ("net: Call skb_checksum_init in IPv6")
    Signed-off-by: default avatarAlexey Kodanev <alexey.kodanev@oracle.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
udplite.h 3.83 KB