Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp422589img; Mon, 18 Mar 2019 06:17:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzHvM24Mbhg4huPANHmQNw6L0/QY2yZk45/b4Jq/r+N+CWdPCLsrAw6aHOm9vn6mjnn88V X-Received: by 2002:aa7:8251:: with SMTP id e17mr19088587pfn.96.1552915044442; Mon, 18 Mar 2019 06:17:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552915044; cv=none; d=google.com; s=arc-20160816; b=GU0zbf3on94Gw6edE1qUvwtXPWse/Awrg/b5e5AQm82J8Swk7MsKyFCQJsMPsWDMj7 dsUHpLXB6owe15X9tjoF72CL/cUmffdNkqYvkz/t9eNFUT1Cvkr23yQnaN9LqjXZho/s KydGrVRUWtLFHWnpUBwWU/43vpdlTtm34ncpzuH11FIZFhFqza6N9LGCGDf8bo3MSsjD TtfZLEpJYus+qWLEKoPyaMJxNUpRYxeuUb+imDjgfJgmGjn9dl+TtrAJhmpG6/p+zeQh 1zcU0LuGHB1CtV/T19YG9S9rFviogE6Q5XD/7ck3gc2w9P5sE9cBYUHKPB6U1NbZSFCI F2Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=1ivs9Ld1Cr5PW6vV2Rbbcl0Dzr7SZ2d3KOy8/STfF8A=; b=LeNLZOzivy4RTw/xjh5q0CRdQOvQ0KwDGz7U0PGKIA0BY3KTafoBaberWElPEHzxC8 r0gv7ph23JjW59f9ZwbctemwGkclZKXMt2qoBbhk5c4nu/z1rlJur6L/zuK9DmPOOJUo zRvS3dZakTG3Fz7OHmXQdHAlH33+ZJYf2BCpVP1E1a4ZjSRUHizHXhzkx43f7tGkB1At 6CkL3vYzKupbPQOSmUIDeVzikL6MxOW/354J3CoOO7ACrkWY1g5Vo0oHIAa+abm54Zjc 6m+FNo3UKSG32Ij1jdPF3S/4j7nQgwH3Xu0y1BydPeWKA2TmfJXEC09OEc7Zai7uBaHJ WqpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=oBTjxWG0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b13si8571156pgt.374.2019.03.18.06.17.08; Mon, 18 Mar 2019 06:17:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=oBTjxWG0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727656AbfCRNOp (ORCPT + 99 others); Mon, 18 Mar 2019 09:14:45 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:38897 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727257AbfCRNOo (ORCPT ); Mon, 18 Mar 2019 09:14:44 -0400 Received: by mail-pf1-f195.google.com with SMTP id n125so11234091pfn.5 for ; Mon, 18 Mar 2019 06:14:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1ivs9Ld1Cr5PW6vV2Rbbcl0Dzr7SZ2d3KOy8/STfF8A=; b=oBTjxWG0FPo2AisxixE5yc78gPUfLiKvFgiqW/PaDdUDoiy6wl4lIVi3A/mTKnJ0Mi zUOLSVZxC9hW893jS8ZhWErR02LcQZuEwaUehFiokdS3EeaxD01M//0i5N97fYoJ13hs 4G3IljxWh8BwJgGict+arC31MtC27jws/hHnyABdKhWEEiDGh7NKhLigUonEO6+KOlSL 3USQUM4iKqMTMbn2g6Ah+RFkp4aYcCJZ4BS8w7iWOrUqVYcWexIjpGAtdd3efZdlcCUO p7CFeinhJ6NC8l+UdkOHPfrLASSKPleS1Ys2ekWEuevSk7fjYkyy2ScgbpNBmFCOUU6H I79A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1ivs9Ld1Cr5PW6vV2Rbbcl0Dzr7SZ2d3KOy8/STfF8A=; b=HNv3EN4YtgKLgvAiUOu+efdQzcQGpWvzjGmuXC4j8EH2bZXiLk2o6/GYQ+YwxP1tqx dad+2pX1fsuscLyrmJvYfuCyv2Tn5LTyOybp/+2hFB4MatZWWftUS9omw/FJSGF3ot14 CE7ET5C9zDUUnNQ7qyxoATRH6j0ax9VY14gI5k5XkAQQIyk6B7ktn6XjRcabFlZIrXbz EF72XTJ3Vpdz1OCmOk9/BfKPm4QHvHUPKuTV6kF560Kb/HkS8VbmFlWQFGg7vrLmDSqu WeUR3c0EKHF1O5A8fZ27bBcyuweLFby+Cv48FSBeHVPYgBAvAUL4QcLk9fyqd3Cb9IZW zG9w== X-Gm-Message-State: APjAAAWxrSqDzi2BHyHzgUXrYAg84zbvguRxEuzBKQIoBTnG2xHPZRJb gvdpGP5er4e75M12gYorXARAJCiRCDZ4lNdf3zsdMw== X-Received: by 2002:a63:68c9:: with SMTP id d192mr18023180pgc.264.1552914883949; Mon, 18 Mar 2019 06:14:43 -0700 (PDT) MIME-Version: 1.0 References: <56d3373c1c5007d776fcd5de4523f4b9da341fb6.1552679409.git.andreyknvl@google.com> <04c5b2de-7fde-7625-9d42-228160879ea0@gmail.com> In-Reply-To: <04c5b2de-7fde-7625-9d42-228160879ea0@gmail.com> From: Andrey Konovalov Date: Mon, 18 Mar 2019 14:14:33 +0100 Message-ID: Subject: Re: [PATCH v11 08/14] net, arm64: untag user pointers in tcp_zerocopy_receive To: Eric Dumazet Cc: Catalin Marinas , Will Deacon , Mark Rutland , Robin Murphy , Kees Cook , Kate Stewart , Greg Kroah-Hartman , Andrew Morton , Ingo Molnar , "Kirill A . Shutemov" , Shuah Khan , Vincenzo Frascino , Eric Dumazet , "David S. Miller" , Alexei Starovoitov , Daniel Borkmann , Steven Rostedt , Ingo Molnar , Peter Zijlstra , Arnaldo Carvalho de Melo , Linux ARM , "open list:DOCUMENTATION" , Linux Memory Management List , linux-arch , netdev , bpf@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" , LKML , Dmitry Vyukov , Kostya Serebryany , Evgeniy Stepanov , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Chintan Pandya , Luc Van Oostenryck , Dave Martin , Kevin Brodsky , Szabolcs Nagy Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 15, 2019 at 9:03 PM Eric Dumazet wrote: > > > > On 03/15/2019 12:51 PM, Andrey Konovalov wrote: > > This patch is a part of a series that extends arm64 kernel ABI to allow to > > pass tagged user pointers (with the top byte set to something else other > > than 0x00) as syscall arguments. > > > > tcp_zerocopy_receive() uses provided user pointers for vma lookups, which > > can only by done with untagged pointers. > > > > Untag user pointers in this function. > > > > Signed-off-by: Andrey Konovalov > > --- > > net/ipv4/tcp.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c > > index 6baa6dc1b13b..89db3b4fc753 100644 > > --- a/net/ipv4/tcp.c > > +++ b/net/ipv4/tcp.c > > @@ -1758,6 +1758,8 @@ static int tcp_zerocopy_receive(struct sock *sk, > > int inq; > > int ret; > > > > + address = untagged_addr(address); > > + > > if (address & (PAGE_SIZE - 1) || address != zc->address) > > The second test will fail, if the top bits are changed in address but not in zc->address Will fix in v12, thanks Eric! > > > return -EINVAL; > > > > >