mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 13:22:57 +00:00
ipv4: fix a potential use after free in fou.c
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 <therbert@google.com>
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1245dfc8ca
commit
d8f00d2710
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue