Paolo Abeni ca4ef4574f ip: fix IP_CHECKSUM handling
The skbs processed by ip_cmsg_recv() are not guaranteed to
be linear e.g. when sending UDP packets over loopback with
MSGMORE.
Using csum_partial() on [potentially] the whole skb len
is dangerous; instead be on the safe side and use skb_checksum().

Thanks to syzkaller team to detect the issue and provide the
reproducer.

v1 -> v2:
 - move the variable declaration in a tighter scope

Fixes: ad6f939ab193 ("ip: Add offset parameter to ip_cmsg_recv")
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-02-21 12:23:53 -05:00
..
2017-01-22 16:46:13 -05:00
2017-02-21 12:23:53 -05:00
2016-12-25 17:21:22 +01:00
2017-02-10 14:31:51 -05:00
2017-02-20 11:13:37 -05:00
2017-01-24 11:07:35 +01:00
2017-02-20 10:26:09 -05:00
2017-02-10 14:31:51 -05:00