inet: fix IP(V6)_RECVORIGDSTADDR for udp sockets
authorWillem de Bruijn <willemb@google.com>
Thu, 22 Dec 2016 23:19:16 +0000 (18:19 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Dec 2016 17:19:18 +0000 (12:19 -0500)
commit39b2dd765e0711e1efd1d1df089473a8dd93ad48
treee95a7c908c2bb7140aa16cbbbf4fb74af41085ed
parent9aa340a5c36eafa847861336db446886a5ed1962
inet: fix IP(V6)_RECVORIGDSTADDR for udp sockets

Socket cmsg IP(V6)_RECVORIGDSTADDR checks that port range lies within
the packet. For sockets that have transport headers pulled, transport
offset can be negative. Use signed comparison to avoid overflow.

Fixes: e6afc8ace6dd ("udp: remove headers from UDP packets before queueing")
Reported-by: Nisar Jagabar <njagabar@cloudmark.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_sockglue.c
net/ipv6/datagram.c