RE: [EXT] [PATCH net v2] ipv4: ip_gre: Avoid skb_pull() failure in ipgre_xmit()

From: Suman Ghosh
Date: Sun Dec 03 2023 - 10:19:13 EST


>In ipgre_xmit(), skb_pull() may fail even if pskb_inet_may_pull()
>returns true. For example, applications can use PF_PACKET to create a
>malformed packet with no IP header. This type of packet causes a problem
>such as uninit-value access.
>
>This patch ensures that skb_pull() can pull the required size by
>checking the skb with pskb_network_may_pull() before skb_pull().
>
>Fixes: c54419321455 ("GRE: Refactor GRE tunneling code.")
>Signed-off-by: Shigeru Yoshida <syoshida@xxxxxxxxxx>
>---
Reviewed-by: Suman Ghosh <sumang@xxxxxxxxxxx>

>v1 -> v2:
>- Change the title
>- Update the code with Eric's suggestion
>