Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp424637img; Mon, 18 Mar 2019 06:19:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwikyN1orx/h0O143bZuA9ouZ2OwnvIHYnuqshQlX22BOgkJRqwKEwBQ2WbeamW+S3wYsqE X-Received: by 2002:a17:902:2ac3:: with SMTP id j61mr19134394plb.112.1552915180520; Mon, 18 Mar 2019 06:19:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552915180; cv=none; d=google.com; s=arc-20160816; b=lVawOJMqM+YkIZT28PGY53CMZSn/B1u4w+Zb5Q1YmLQYYgM6RlVqjpzd2FqNMZVQpp 6huGcLCp3dU85G//gtt2KTTP/XGM+eHFeSiB4dNCFzyMLGesA4jRfeQC+T+0imMHPkGb SK+FTEVdnhTNb0hsUzpKB/cRWF/vvdVCwfGxyT2F+EHLR1n7BOK+FkGaxXW+6DeqhsOV KYcNd1raVms+P/+M0V0zlivVEb4nSzDOalv/44J3cSg9ONgmXvctMuAf1aYrY/RYS57N PIPlwd9Fq1BbczIEQbasAh7fBcAsE2H2u499Y65i88e4JQ7zGCD4eH/QlFmPORghvOIX 9pLQ== 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=XMsQCnO3d2N5DODeaXx9kIQiZQAAX2gcah3MrcQIGq4=; b=i1GfqFg1SA7mQ0V3dGJNxW4StzEuJxPiTkCu6jGT+xD05iJXiuYmYlD/Ma2Fdk5f8H H0RwrDeJ4uYnJurGp4lrsDfiD5+tl0tdgF83QgflWRXekQrr1QOIEITTnrS5IP69WVXk AvTWvSKTUWlxaxsgYItfILtNTXFW2+aGU0iTwCpvAWGXAgrOtlzVyKjrQoQPimyDbLYL qLQIihgXplGmkNFZfkiiCjwFxSTgrdKvijEia5sr7EruOzPP7NxL4rl1kmIcd0vjjIxC Afzy/ujnqEwbl9iI054C9zbfdByXHOjtuGtNaL3FDW024+7n9coFWa4v0hZUG1rWpT5s lIhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Mz1wBwJj; 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 w26si712147pga.208.2019.03.18.06.19.24; Mon, 18 Mar 2019 06:19:40 -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=Mz1wBwJj; 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 S1727553AbfCRNRH (ORCPT + 99 others); Mon, 18 Mar 2019 09:17:07 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:41491 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727367AbfCRNRG (ORCPT ); Mon, 18 Mar 2019 09:17:06 -0400 Received: by mail-pf1-f193.google.com with SMTP id d25so11228657pfn.8 for ; Mon, 18 Mar 2019 06:17:05 -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=XMsQCnO3d2N5DODeaXx9kIQiZQAAX2gcah3MrcQIGq4=; b=Mz1wBwJj6aCIZctfrRgE6qXPvX+DxKzIewaAWG2rsnRyqxyHSntUGvgMk83TJr4D9R vQY040rQcugdz84sOkhKoPh+5b61cRyUPyZHiun1V7TlGA4yTVG73h6PtP07QDgLiuwE n+Y726W4fhoevokV4KYe1eN7kRnGOw2ACjkFgmQCINLKKX731h86aGsk7vt7KFXu5VD/ IvAIbnkhPmKhNvITYDEkPKJcLWmUjR47kAvs4vZgz0S2NXlFkFNzVMsgyzV5Se0Oxdq4 +rOKDCv24NM7YvtykGdF3O1VGaaySN2ax6qOyIngXLA9yS4tWIS96p9YD5FbV0UfdUAj Rnpg== 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=XMsQCnO3d2N5DODeaXx9kIQiZQAAX2gcah3MrcQIGq4=; b=e8l47UPv4WscbrVi3WDTc9adkdd7ulboqtT95CDSBBF+J5D5PtW1wxPZuT0p9JtBKE OTBwZPgPBQ3QkbxjFib+N6EMBVntmX458BSkEFrAQFW+8TYA9WRGTfkahTZTJaUeBaEi WpdsyJSneGgUjDF9E1p7v5wKRqDszYU+KfUrHhXYHqtfe63SODacVqYoTGZ0XYEGxOnF RbDjOgaibbJ94KZsZ5rKfEQz1w2DAZ83zL9IghQCwqWfcg5zQymnzqu0fck8lr+e1jwr kNskc+vSfBTb2gLrD5RewdHum0EUmxpV+l2/QRil3wejF7Tn+UH0YJXimcTWqpdrZLkC 5d6A== X-Gm-Message-State: APjAAAV80/kLYyo+8JkK6yA6jRZrFeL+tO859WsZ1fpn71nmkwu4SZxt l7IqZLaftHSbI2PqoAsuZ1QL25YBGBX3G5e7+OMkVw== X-Received: by 2002:a62:6383:: with SMTP id x125mr18765188pfb.239.1552915025400; Mon, 18 Mar 2019 06:17:05 -0700 (PDT) MIME-Version: 1.0 References: <56d3373c1c5007d776fcd5de4523f4b9da341fb6.1552679409.git.andreyknvl@google.com> <04c5b2de-7fde-7625-9d42-228160879ea0@gmail.com> In-Reply-To: From: Andrey Konovalov Date: Mon, 18 Mar 2019 14:16:54 +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 Mon, Mar 18, 2019 at 2:14 PM Andrey Konovalov wrote: > > 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! Looking at the code, what's the point of this address != zc->address check? Should I just remove it? > > > > > > return -EINVAL; > > > > > > > >