Alexey Kodanev 15f35d49c9 udplite: fix partial checksum initialization
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()
    skb_checksum_init_zero_check()
      __skb_checksum_validate_complete()

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: ed70fcfcee95 ("net: Call skb_checksum_init in IPv4")
Fixes: e4f45b7f40bd ("net: Call skb_checksum_init in IPv6")
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-02-16 15:57:42 -05:00
..
2018-02-06 10:32:13 +01:00
2018-02-07 11:33:08 -08:00
2018-02-07 11:22:44 -08:00
2018-02-10 13:16:35 -08:00
2018-02-16 15:52:42 -05:00
2018-02-02 10:01:04 -08:00
2018-02-03 13:07:56 -08:00
2018-02-01 16:35:31 -08:00
2018-02-07 12:11:09 -08:00
2018-02-07 13:10:43 -08:00
2017-12-22 12:30:10 -08:00