]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net/ipv5/tcp: Use vma_lookup() in tcp_zerocopy_receive()
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 8 Apr 2021 17:16:07 +0000 (13:16 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Mon, 10 May 2021 16:39:27 +0000 (12:39 -0400)
Use vma_lookup() to find the VMA at a specific address.  As vma_lookup()
will return NULL if the address is not within any VMA, the start address
no longer needs to be validated.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
net/ipv4/tcp.c

index e14fd0c50c10222b4b6b078b21e0b076343febff..d4781a514012731aacf7aafc19e35d43355bbb25 100644 (file)
@@ -2094,8 +2094,8 @@ static int tcp_zerocopy_receive(struct sock *sk,
 
        mmap_read_lock(current->mm);
 
-       vma = find_vma(current->mm, address);
-       if (!vma || vma->vm_start > address || vma->vm_ops != &tcp_vm_ops) {
+       vma = vma_lookup(current->mm, address);
+       if (!vma || vma->vm_ops != &tcp_vm_ops) {
                mmap_read_unlock(current->mm);
                return -EINVAL;
        }