public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas-5wv7dgnIgG8@public.gmane.org>
To: Andrey Konovalov <andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Kate Stewart
	<kstewart-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>,
	Alexei Starovoitov <ast-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
	Eric Dumazet <edumazet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	linux-kselftest-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Chintan Pandya <cpandya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Vincenzo Frascino
	<vincenzo.frascino-5wv7dgnIgG8@public.gmane.org>,
	Shuah Khan <shuah-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Ingo Molnar <mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	"David \(ChunMing\) Zhou"
	<David1.Zhou-5C7GfCeVMHo@public.gmane.org>,
	Jacob Bramley <Jacob.Bramley-5wv7dgnIgG8@public.gmane.org>,
	Daniel Borkmann <daniel-FeC+5ew28dpmcu3hnIyYJQ@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Szabolcs Nagy <Szabolcs.Nagy-5wv7dgnIgG8@public.gmane.org>,
	Ingo Molnar <mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Dmitry Vyukov <dvyukov-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	Ramana Radhakrishnan
	<Ramana.Radhakrishnan-5wv7dgnIgG8@public.gmane.org>,
	Dave Martin <Dave.Ma
Subject: Re: [PATCH v13 09/20] net, arm64: untag user pointers in tcp_zerocopy_receive
Date: Fri, 22 Mar 2019 12:04:35 +0000	[thread overview]
Message-ID: <20190322120434.GD13384@arrakis.emea.arm.com> (raw)
In-Reply-To: <2280b62096ce1fa5c9e9429d18f08f82f4be1b0b.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>

On Wed, Mar 20, 2019 at 03:51:23PM +0100, 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 <andreyknvl@google.com>
> ---
>  net/ipv4/tcp.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> index 6baa6dc1b13b..855a1f68c1ea 100644
> --- a/net/ipv4/tcp.c
> +++ b/net/ipv4/tcp.c
> @@ -1761,6 +1761,8 @@ static int tcp_zerocopy_receive(struct sock *sk,
>  	if (address & (PAGE_SIZE - 1) || address != zc->address)
>  		return -EINVAL;
>  
> +	address = untagged_addr(address);
> +
>  	if (sk->sk_state == TCP_LISTEN)
>  		return -ENOTCONN;

I don't think we need this patch if we stick to Vincenzo's ABI
restrictions. Can zc->address be an anonymous mmap()? My understanding
of TCP_ZEROCOPY_RECEIVE is that this is an mmap() on a socket, so user
should not tag such pointer.

We want to allow tagged pointers to work transparently only for heap and
stack, hence the restriction to anonymous mmap() and those addresses
below sbrk(0).

-- 
Catalin
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2019-03-22 12:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1553093420.git.andreyknvl@google.com>
     [not found] ` <44ad2d0c55dbad449edac23ae46d151a04102a1d.1553093421.git.andreyknvl@google.com>
     [not found]   ` <44ad2d0c55dbad449edac23ae46d151a04102a1d.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 11:43     ` [PATCH v13 04/20] mm, arm64: untag user pointers passed to memory syscalls Catalin Marinas
     [not found]       ` <20190322114357.GC13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
2019-03-28 18:10         ` Andrey Konovalov
2019-03-28 18:19           ` Steven Rostedt
     [not found] ` <2280b62096ce1fa5c9e9429d18f08f82f4be1b0b.1553093421.git.andreyknvl@google.com>
     [not found]   ` <2280b62096ce1fa5c9e9429d18f08f82f4be1b0b.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 12:04     ` Catalin Marinas [this message]
     [not found]       ` <20190322120434.GD13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
2019-03-25 13:54         ` [PATCH v13 09/20] net, arm64: untag user pointers in tcp_zerocopy_receive Kevin Brodsky
     [not found]           ` <e5ed4fff-acf6-7b85-bf8f-df558a9cd33f-5wv7dgnIgG8@public.gmane.org>
2019-04-01 16:04             ` Andrey Konovalov
     [not found] ` <76f96eb9162b3a7fa5949d71af38bf8fdf6924c4.1553093421.git.andreyknvl@google.com>
     [not found]   ` <76f96eb9162b3a7fa5949d71af38bf8fdf6924c4.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 15:41     ` [PATCH v13 10/20] kernel, arm64: untag user pointers in prctl_set_mm* Catalin Marinas
     [not found]       ` <20190322154136.GP13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
2019-04-01 16:44         ` Andrey Konovalov
     [not found] ` <c9553c3a4850d43c8af0c00e97850d70428b7de7.1553093421.git.andreyknvl@google.com>
     [not found]   ` <c9553c3a4850d43c8af0c00e97850d70428b7de7.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 15:45     ` [PATCH v13 11/20] tracing, arm64: untag user pointers in seq_print_user_ip Catalin Marinas
     [not found]       ` <20190322154513.GQ13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
2019-04-01 15:38         ` Andrey Konovalov
     [not found] ` <88d5255400fc6536d6a6895dd2a3aef0f0ecc899.1553093421.git.andreyknvl@google.com>
     [not found]   ` <88d5255400fc6536d6a6895dd2a3aef0f0ecc899.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 15:46     ` [PATCH v13 12/20] uprobes, arm64: untag user pointers in find_active_uprobe Catalin Marinas
     [not found] ` <09d6b8e5c8275de85c7aba716578fbcb3cbce924.1553093421.git.andreyknvl@google.com>
     [not found]   ` <09d6b8e5c8275de85c7aba716578fbcb3cbce924.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 15:52     ` [PATCH v13 13/20] bpf, arm64: untag user pointers in stack_map_get_build_id_offset Catalin Marinas
     [not found]       ` <20190322155227.GS13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
2019-04-01 16:00         ` Andrey Konovalov
     [not found] ` <017804b2198a906463d634f84777b6087c9b4a40.1553093421.git.andreyknvl@google.com>
     [not found]   ` <017804b2198a906463d634f84777b6087c9b4a40.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 15:59     ` [PATCH v13 14/20] drm/amdgpu, arm64: untag user pointers in amdgpu_ttm_tt_get_user_pages Catalin Marinas
     [not found]       ` <20190322155955.GT13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
2019-03-25 14:02         ` Kevin Brodsky
     [not found]   ` <574648a3-3a05-bea7-3f4e-7d71adedf1dc@amd.com>
     [not found]     ` <574648a3-3a05-bea7-3f4e-7d71adedf1dc-5C7GfCeVMHo@public.gmane.org>
2019-04-02 14:37       ` Andrey Konovalov
2019-04-02 17:52         ` Kuehling, Felix
     [not found] ` <038360a0a9dc0abaaaf3ad84a2d07fd544abce1a.1553093421.git.andreyknvl@google.com>
     [not found]   ` <038360a0a9dc0abaaaf3ad84a2d07fd544abce1a.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 16:00     ` [PATCH v13 15/20] drm/radeon, arm64: untag user pointers in radeon_ttm_tt_pin_userptr Catalin Marinas
     [not found]       ` <20190322160057.GU13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
2019-04-02 14:17         ` Andrey Konovalov
     [not found] ` <ae6961bcdd82e529c76d0747abd310546f81e58e.1553093421.git.andreyknvl@google.com>
     [not found]   ` <ae6961bcdd82e529c76d0747abd310546f81e58e.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 16:07     ` [PATCH v13 17/20] media/v4l2-core, arm64: untag user pointers in videobuf_dma_contig_user_get Catalin Marinas
     [not found]       ` <20190322160726.GV13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
2019-03-25 14:08         ` Kevin Brodsky
     [not found]           ` <bfaae923-98aa-63e7-c50b-8649dc5fe2bb-5wv7dgnIgG8@public.gmane.org>
2019-04-01 16:13             ` Andrey Konovalov
     [not found] ` <665632a911273ab537ded9acb78f4bafd91cbc19.1553093421.git.andreyknvl@google.com>
     [not found]   ` <665632a911273ab537ded9acb78f4bafd91cbc19.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 16:22     ` [PATCH v13 18/20] tee/optee, arm64: untag user pointers in check_mem_type Catalin Marinas
     [not found]       ` <20190322162223.GW13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
2019-04-01 16:31         ` Andrey Konovalov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190322120434.GD13384@arrakis.emea.arm.com \
    --to=catalin.marinas-5wv7dgnigg8@public.gmane.org \
    --cc=David1.Zhou-5C7GfCeVMHo@public.gmane.org \
    --cc=Jacob.Bramley-5wv7dgnIgG8@public.gmane.org \
    --cc=Ramana.Radhakrishnan-5wv7dgnIgG8@public.gmane.org \
    --cc=Szabolcs.Nagy-5wv7dgnIgG8@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=ast-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=cpandya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=daniel-FeC+5ew28dpmcu3hnIyYJQ@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=dvyukov-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=edumazet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=kstewart-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kselftest-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=shuah-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=vincenzo.frascino-5wv7dgnIgG8@public.gmane.org \
    --cc=will.deacon-5wv7dgnIgG8@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox