summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorDimitris Michailidis <dmichail@google.com>2018-10-19 17:07:13 -0700
committerDavid S. Miller <davem@davemloft.net>2018-10-20 01:13:42 -0700
commitd55bef5059dd057bd077155375c581b49d25be7e (patch)
tree56269ac3365bde89b860aac7f5224e7054c6b226 /usr
parent48995423143a097527802e28d7add20e5a27677a (diff)
downloadlinux-0-day-d55bef5059dd057bd077155375c581b49d25be7e.tar.gz
linux-0-day-d55bef5059dd057bd077155375c581b49d25be7e.tar.xz
net: fix pskb_trim_rcsum_slow() with odd trim offset
We've been getting checksum errors involving small UDP packets, usually 59B packets with 1 extra non-zero padding byte. netdev_rx_csum_fault() has been complaining that HW is providing bad checksums. Turns out the problem is in pskb_trim_rcsum_slow(), introduced in commit 88078d98d1bb ("net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends"). The source of the problem is that when the bytes we are trimming start at an odd address, as in the case of the 1 padding byte above, skb_checksum() returns a byte-swapped value. We cannot just combine this with skb->csum using csum_sub(). We need to use csum_block_sub() here that takes into account the parity of the start address and handles the swapping. Matches existing code in __skb_postpull_rcsum() and esp_remove_trailer(). Fixes: 88078d98d1bb ("net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends") Signed-off-by: Dimitris Michailidis <dmichail@google.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'usr')
0 files changed, 0 insertions, 0 deletions