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-02-13 22:15:03 -05:00
2016-10-20 14:32:22 -04:00
2017-01-13 22:37:16 -05:00
2016-04-27 22:48:23 -04:00
2017-02-21 12:23:53 -05:00
2017-01-12 16:48:26 -05:00
2017-02-15 11:04:11 +01:00
2017-02-03 11:19:34 -05:00
2016-06-10 23:07:49 -07:00
2017-02-14 22:19:39 -05:00
2016-09-21 00:23:00 -04:00
2017-01-13 22:37:16 -05:00
2017-02-17 15:31:06 -05:00
2016-10-20 14:32:22 -04:00
2017-02-15 11:04:11 +01:00
2017-01-10 10:57:12 +01:00