ipv4: fix a potential use after free in fou.c
Subsystems (2)
PATCH 1/1 ipv4: fix a potential use after free in fou.c
From: Li RongQing <[email protected]>
pskb_may_pull() maybe change skb->data and make uh pointer oboslete, so reload uh and guehdr
Fixes 37dd0247 ("gue: Receive side for Generic UDP Encapsulation")
Cc Tom Herbert <[email protected]>
Signed-off-by Li RongQing <[email protected]>
--- net/ipv4/fou.c | 3 +++ 1 file changed, 3 insertions(+)
net/ipv4/fou.c +3 -0
@@ -87,6 +87,9 @@ static int gue_udp_recv(struct sock *sk, struct sk_buff *skb)if (!pskb_may_pull (skb, len)) goto drop; + uh =udp_hdr (skb); + guehdr = (struct guehdr *)&uh[1 ]; +if (guehdr->version !=0 ) goto drop;
Signature · 1 line
1.7.10.4
From: [email protected]
Date: Fri, 17 Oct 2014 16:53:47 +0800
Quoted 8 lines
From: Li RongQing <[email protected]>
pskb_may_pull()maybe changeskb->dataand make uh pointer oboslete, so reload uh and guehdrFixes 37dd0247 ("gue: Receive side for Generic UDP Encapsulation")Cc Tom Herbert <[email protected]>Signed-off-by Li RongQing <[email protected]>
Applied.