Patch "inet: fix IP(V6)_RECVORIGDSTADDR for udp sockets" has been added to the 4.9-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
inet: fix IP(V6)_RECVORIGDSTADDR for udp sockets
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
inet-fix-ip-v6-_recvorigdstaddr-for-udp-sockets.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Thu Jan 12 21:37:26 CET 2017
From: Willem de Bruijn <[email protected]>
Date: Thu, 22 Dec 2016 18:19:16 -0500
Subject: inet: fix IP(V6)_RECVORIGDSTADDR for udp sockets
From: Willem de Bruijn <[email protected]>
[ Upstream commit 39b2dd765e0711e1efd1d1df089473a8dd93ad48 ]
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.
--- net/ipv4/ip_sockglue.c | 2 +- net/ipv6/datagram.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
net/ipv4/ip_sockglue.c +1 -1
@@ -137,7 +137,7 @@ static void ip_cmsg_recv_dstaddr(structconst struct iphdr *iph =ip_hdr (skb);__be16 *ports = (__be16 *)skb_transport_header (skb); -if (skb_transport_offset (skb) +4 > skb->len) +if (skb_transport_offset (skb) +4 > (int )skb->len)return ;/* All current transport protocols have the port numbers in the
net/ipv6/datagram.c +1 -1
@@ -700,7 +700,7 @@ void ip6_datagram_recv_specific_ctl(strustruct sockaddr_in6 sin6;__be16 *ports = (__be16 *)skb_transport_header (skb); -if (skb_transport_offset (skb) +4 <= skb->len) { +if (skb_transport_offset (skb) +4 <= (int )skb->len) {/* All current transport protocols have the port numbers in the * first four bytes of the transport header and this function is * written with this assumption in mind.
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/inet-fix-ip-v6-_recvorigdstaddr-for-udp-sockets.patch