Received: by 2002:ac0:a874:0:0:0:0:0 with SMTP id c49csp740785ima; Fri, 15 Mar 2019 13:04:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwF2tX5THY125bnxHVZyg4dUDKRADvHpRaSYd8hTMFAx3Ihx1YXOh0+Md2YXV+S8OEvhmvY X-Received: by 2002:a17:902:f83:: with SMTP id 3mr6315952plz.125.1552680285538; Fri, 15 Mar 2019 13:04:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552680285; cv=none; d=google.com; s=arc-20160816; b=TRp8/GrdzqgJ6epfxKFeivbQvdjlN7cyd9R+rTvpoyoGJwU47LROzOxjNUpF4x9nut n/iBp5z7lpHVJzgH2xqvW92c7pfgL3RqNtThMuSVS27YceRaI6KCJthsV3hEswe7dh8o Ec4LLhDo9G0NUnTh8eXd+AS+90xAZAy7OWJJAqWj46eM3YH48vSEX5L6xJieU43n2fym 7qGqAClSL7dLQ4fsZKi/T4xRhXYFfh9vGkJt1D0TNuMmMwqCVEulQ+e4kX/yHwlCvb4c kXYcBYPCIK8eoX0gtEBHs8RX2BxX2n1nU+FqSpkFCcIgXh2BbeM7tGpNHEEeU0JAqVJ2 UPXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=9AzJNPZrWzBDD4w+YR6o8R1NuHkXmo1ETr66/JW7xLw=; b=ulgeqnpqfoAN3qn+BdMe3Pui2RlSDaNQ1VUzk1VRb1IjY33PicVq5QoJmL6ioVSpxX mDrn8aKx5fqKfF8T51ydthp5LVDRycs3y1mdeeaGEDjwANA9hEg/XwasuV87PlnW2+Tk sZx/SF73oHJIiWAp5n7QNCVmLWClmq3wTJ+vq9Nn1/WFI6zvm0hio5U2Uhid8L8e6BQ6 dRsvqC9MwdMdZPT3wTyMpWJAcPrPvBU9GDQTcqtYf/axJ+JTyBJdetmMjGUZFbD5R0k+ vhHqnlsiBmcs2Sd2nf471ORoPdA4r+rHge0b4l1iQCPT7mnITrV6/PujmLIVzZg/OIQa 0D2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mUxATW68; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n14si2525635pgv.520.2019.03.15.13.04.28; Fri, 15 Mar 2019 13:04:45 -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=@gmail.com header.s=20161025 header.b=mUxATW68; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726418AbfCOUDg (ORCPT + 99 others); Fri, 15 Mar 2019 16:03:36 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:41701 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbfCOUDf (ORCPT ); Fri, 15 Mar 2019 16:03:35 -0400 Received: by mail-pg1-f195.google.com with SMTP id k11so7168679pgb.8; Fri, 15 Mar 2019 13:03:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=9AzJNPZrWzBDD4w+YR6o8R1NuHkXmo1ETr66/JW7xLw=; b=mUxATW68etjE5v8S6J9Jd+3aIJP3RDifB7SRhiyyAe3JOb88DPKvLOvqxA5fJjklUa 0R51CHmyEhXiPvKBm8RTOmSqu9McUlBgo9ESFJeeOk3DFae8iSGVwwpnWkHL5T8LIehE H6aDiOVLZhFjZTl6Lyoxfp6D/MXHg0AlvvGtbOaILc1P4UMi+CnbvjCE9w2Bbb+mndVh HoRoU1W1TqYpdyrIt+3CSbdzFHrAwEv4kdI659SaRSqJ3zauITFYhoUxKS+o+Pa/IK6C O3HS9Q7uE1MPZhMMaTgS0hvmb0iSDSU6rlzoljfH1oI8gX1kjokIbEHdfL8Wq/7KSEZ6 ejYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9AzJNPZrWzBDD4w+YR6o8R1NuHkXmo1ETr66/JW7xLw=; b=j6UodrotZECnNb7Cs4zveubsmCEGRX3Cs6HcPyyb6Y6JFklMYcFeLbvDHu51cquh/j dNLhJMIy2MYLgGHSLcA5WP5Hx4oZAdSiVDTvTzv7KIQlld2i/w6+bSNf3A+ityj4bnX7 zSQQHiMp8th0LSOCx/XvVH3n7GUbxySDQ7Kce13U00qwn6mJEnqkqhJGjiCu20R8NUdy Mn0B8aYxp84sgHdb5kpbrZGdMMZV8NXu90Z2FrhWouThUb0zQTtBJfQ5YOCr9TlJH7pL vN1wvUqtY57gkSq5Z2cvr9JaUE8IL+TM6SdoojTKwHcbpDUa3Xpu2P4uU1IvBHC5JrNr qQUA== X-Gm-Message-State: APjAAAVebYhvFcPdjK6g7LUakaMUH3T3bM978bRw/45M6STI7gLdn1LC BMyhNmdYiTHJ0zZyrBR+Pts= X-Received: by 2002:a63:780e:: with SMTP id t14mr5285862pgc.276.1552680213678; Fri, 15 Mar 2019 13:03:33 -0700 (PDT) Received: from ?IPv6:2620:15c:2c1:200:55c7:81e6:c7d8:94b? ([2620:15c:2c1:200:55c7:81e6:c7d8:94b]) by smtp.gmail.com with ESMTPSA id p34sm4428128pgb.18.2019.03.15.13.03.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Mar 2019 13:03:32 -0700 (PDT) Subject: Re: [PATCH v11 08/14] net, arm64: untag user pointers in tcp_zerocopy_receive To: Andrey Konovalov , 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-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: 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 References: <56d3373c1c5007d776fcd5de4523f4b9da341fb6.1552679409.git.andreyknvl@google.com> From: Eric Dumazet Message-ID: <04c5b2de-7fde-7625-9d42-228160879ea0@gmail.com> Date: Fri, 15 Mar 2019 13:03:30 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <56d3373c1c5007d776fcd5de4523f4b9da341fb6.1552679409.git.andreyknvl@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > return -EINVAL; > >