projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b9f1bcb
)
ipv4: fix use-after-free in ip_cmsg_recv_dstaddr()
author
Eric Dumazet
<
[email protected]
>
Sun, 30 Sep 2018 18:33:39 +0000
(11:33 -0700)
committer
David S. Miller
<
[email protected]
>
Wed, 3 Oct 2018 05:32:05 +0000
(22:32 -0700)
Caching ip_hdr(skb) before a call to pskb_may_pull() is buggy,
do not do it.
Fixes: 2efd4fca703a ("ip: in cmsg IP(V6)_ORIGDSTADDR call pskb_may_pull")
Signed-off-by: Eric Dumazet <
[email protected]
>
Cc: Willem de Bruijn <
[email protected]
>
Reported-by: syzbot <
[email protected]
>
Acked-by: Willem de Bruijn <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/ipv4/ip_sockglue.c
patch
|
blob
|
history
diff --git
a/net/ipv4/ip_sockglue.c
b/net/ipv4/ip_sockglue.c
index c0fe5ad996f238091f5b9585adb586a571f653f0..26c36cccabdc2c8cc95cfd609672d412c493fc42 100644
(file)
--- a/
net/ipv4/ip_sockglue.c
+++ b/
net/ipv4/ip_sockglue.c
@@
-149,7
+149,6
@@
static void ip_cmsg_recv_security(struct msghdr *msg, struct sk_buff *skb)
static void ip_cmsg_recv_dstaddr(struct msghdr *msg, struct sk_buff *skb)
{
struct sockaddr_in sin;
- const struct iphdr *iph = ip_hdr(skb);
__be16 *ports;
int end;
@@
-164,7
+163,7
@@
static void ip_cmsg_recv_dstaddr(struct msghdr *msg, struct sk_buff *skb)
ports = (__be16 *)skb_transport_header(skb);
sin.sin_family = AF_INET;
- sin.sin_addr.s_addr = ip
h
->daddr;
+ sin.sin_addr.s_addr = ip
_hdr(skb)
->daddr;
sin.sin_port = ports[1];
memset(sin.sin_zero, 0, sizeof(sin.sin_zero));