diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index fb2b55894b8dc007c1eb60f27042b9b01643e158..4416d1c24dbbe1b1e8574e1e1628fcd86d7d0301 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -1810,6 +1810,8 @@ static int tcp_zerocopy_receive(struct sock *sk, zc->recv_skip_hint = 0; ret = 0; while (length + PAGE_SIZE <= zc->length) { + struct page *page; + if (zc->recv_skip_hint < PAGE_SIZE) { if (skb) { skb = skb->next; @@ -1830,7 +1832,9 @@ static int tcp_zerocopy_receive(struct sock *sk, frags++; } } - if (frags->size != PAGE_SIZE || frags->page_offset) + page = skb_frag_page(frags); + if (frags->size != PAGE_SIZE || frags->page_offset || + PageCompound(page) || page->mapping) break; ret = vm_insert_page(vma, address + length, skb_frag_page(frags));