]> www.infradead.org Git - users/jedix/linux-maple.git/commit
udp: do not expect udp headers in recv cmsg IP_CMSG_CHECKSUM
authorWillem de Bruijn <willemb@google.com>
Thu, 7 Apr 2016 22:12:59 +0000 (18:12 -0400)
committerDhaval Giani <dhaval.giani@oracle.com>
Mon, 29 May 2017 21:20:42 +0000 (17:20 -0400)
commitaec744990c48a57c04f2f01af61a1d8aefd79066
tree9356839901ba7581e5542d612fba12137572e7de
parente0f4d5231e2cb1d86f8f563c60d0c1349753ccd9
udp: do not expect udp headers in recv cmsg IP_CMSG_CHECKSUM

On udp sockets, recv cmsg IP_CMSG_CHECKSUM returns a checksum over
the packet payload. Since commit e6afc8ace6dd pulled the headers,
taking skb->data as the start of transport header is incorrect. Use
the transport header pointer.

Also, when peeking at an offset from the start of the packet, only
return a checksum from the start of the peeked data. Note that the
cmsg does not subtract a tail checkum when reading truncated data.

Fixes: e6afc8ace6dd ("udp: remove headers from UDP packets before queueing")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 31c2e4926fe912f88388bcaa8450fcaa8f2ece47)

Orabug: 25802576
CVE-2017-6347

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
net/ipv4/ip_sockglue.c
net/ipv4/udp.c