Skip to content

Commit 39a3f23

Browse files
committed
xfrm: ipcomp: Call pskb_may_pull in ipcomp_input
If a malformed packet is received there may not be enough data to pull. This isn't a problem in practice because the caller has already done xfrm_parse_spi which in effect does the same thing. Signed-off-by: Herbert Xu <[email protected]> Acked-by: Steffen Klassert <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 9b00eb9 commit 39a3f23

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/xfrm/xfrm_ipcomp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ int ipcomp_input(struct xfrm_state *x, struct sk_buff *skb)
9797
int err = -ENOMEM;
9898
struct ip_comp_hdr *ipch;
9999

100+
if (!pskb_may_pull(skb, sizeof(*ipch)))
101+
return -EINVAL;
102+
100103
if (skb_linearize_cow(skb))
101104
goto out;
102105

0 commit comments

Comments
 (0)