mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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: e6afc8ace6 ("udp: remove headers from UDP packets before queueing")
Reported-by: Nisar Jagabar <[email protected]>
Signed-off-by: Willem de Bruijn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
9aa340a5c3
commit
39b2dd765e
2 changed files with 2 additions and 2 deletions
|
|
@ -148,7 +148,7 @@ static void ip_cmsg_recv_dstaddr(struct msghdr *msg, struct sk_buff *skb)
|
|||
const 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
|
||||
|
|
|
|||
Loading…
Reference in a new issue