Message ID | 20211111232429.2604394-1-arjunroy.kdev@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] tcp: Fix uninitialized access in skb frags array for Rx 0cp. | expand |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index bc7f419184aa..ef896847f190 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -1741,6 +1741,9 @@ static skb_frag_t *skb_advance_to_frag(struct sk_buff *skb, u32 offset_skb, { skb_frag_t *frag; + if (unlikely(offset_skb >= skb->len)) + return NULL; + offset_skb -= skb_headlen(skb); if ((int)offset_skb < 0 || skb_has_frag_list(skb)) return NULL;