From: Catalin Marinas <catalin.marinas@arm.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
Peter Zijlstra <peterz@infradead.org>,
Will Deacon <will.deacon@arm.com>,
Alexei Starovoitov <ast@kernel.org>,
Linux Memory Management List <linux-mm@kvack.org>,
Eric Dumazet <edumazet@google.com>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
Ingo Molnar <mingo@kernel.org>,
linux-arch <linux-arch@vger.kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Szabolcs Nagy <Szabolcs.Nagy@arm.com>,
Dmitry Vyukov <dvyukov@google.com>,
Dave Martin <Dave.Martin@arm.com>,
Evgeniy Stepanov <eugenis@google.com>,
Kevin Brodsky <kevin.brodsky@arm.com>,
Kees Cook <keescook@chromium.org>,
Ruben Ayrapetyan <Ruben.Ayrapetyan@arm.com>,
Andrey Konovalov <andreyknvl@google.com>,
Ramana Radhakrishnan <Ramana.Radhakrishnan@arm.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Alex Williamson <alex.williamson@redhat.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
Kostya Serebryany <kcc@google.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
LKML <linux-kernel@vger.kernel.org>,
Jens Wiklander <jens.wiklander@linaro.org>,
Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
Lee Smith <Lee.Smith@arm.com>,
Andrew Morton <akpm@linux-foundation.org>,
"David S. Miller" <davem@davemloft.net>,
"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>
Subject: Re: [PATCH v13 04/20] mm, arm64: untag user pointers passed to memory syscalls
Date: Fri, 29 Mar 2019 10:30:40 +0000 [thread overview]
Message-ID: <20190329103039.GA44339@arrakis.emea.arm.com> (raw)
In-Reply-To: <20190328141934.38960af0@gandalf.local.home>
(I trimmed down the cc list a bit since it's always bouncing)
On Thu, Mar 28, 2019 at 02:19:34PM -0400, Steven Rostedt wrote:
> On Thu, 28 Mar 2019 19:10:07 +0100
> Andrey Konovalov <andreyknvl@google.com> wrote:
>
> > > > Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> > > > ---
> > > > ipc/shm.c | 2 ++
> > > > mm/madvise.c | 2 ++
> > > > mm/mempolicy.c | 5 +++++
> > > > mm/migrate.c | 1 +
> > > > mm/mincore.c | 2 ++
> > > > mm/mlock.c | 5 +++++
> > > > mm/mmap.c | 7 +++++++
> > > > mm/mprotect.c | 1 +
> > > > mm/mremap.c | 2 ++
> > > > mm/msync.c | 2 ++
> > > > 10 files changed, 29 insertions(+)
> > >
> > > I wonder whether it's better to keep these as wrappers in the arm64
> > > code.
> >
> > I don't think I understand what you propose, could you elaborate?
>
> I believe Catalin is saying that instead of placing things like:
>
> @@ -1593,6 +1593,7 @@ SYSCALL_DEFINE3(shmat, int, shmid, char __user *, shmaddr, int, shmflg)
> unsigned long ret;
> long err;
>
> + shmaddr = untagged_addr(shmaddr);
>
> To instead have the shmaddr set to the untagged_addr() before calling
> the system call, and passing the untagged addr to the system call, as
> that goes through the arm64 architecture specific code first.
Indeed. For example, we already have a SYSCALL_DEFINE6(mmap, ...) in
arch/arm64/kernel/sys.c, just add the untagging there. We could do
something similar for the other syscalls. I don't mind doing this in the
generic code but if it's only needed for arm64, I'd rather keep the
generic changes to a minimum.
(I had a hack overriding __SC_CAST to do this automatically for pointer
arguments but this wouldn't work on mmap() and friends as the argument
is unsigned long)
--
Catalin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next parent reply other threads:[~2019-03-29 10:30 UTC|newest]
Thread overview: 10+ 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] ` <20190322114357.GC13384@arrakis.emea.arm.com>
[not found] ` <CAAeHK+xE-ywfpVHRhBJVGiqOe0+BYW9awUa10ZP4P6Ggc8nxMg@mail.gmail.com>
[not found] ` <20190328141934.38960af0@gandalf.local.home>
2019-03-29 10:30 ` Catalin Marinas [this message]
2019-04-02 12:47 ` [PATCH v13 04/20] mm, arm64: untag user pointers passed to memory syscalls Andrey Konovalov
2019-04-11 16:40 ` Andrey Konovalov
2019-04-26 14:17 ` Catalin Marinas
2019-04-29 14:22 ` Andrey Konovalov
[not found] ` <1e2824fd77e8eeb351c6c6246f384d0d89fd2d58.1553093421.git.andreyknvl@google.com>
[not found] ` <20190429180915.GZ6705@mtr-leonro.mtl.com>
2019-04-30 11:16 ` [PATCH v13 16/20] IB/mlx4, arm64: untag user pointers in mlx4_get_umem_mr Catalin Marinas
2019-04-30 12:03 ` Leon Romanovsky
2019-05-02 18:44 ` Jason Gunthorpe
2019-05-03 16:28 ` Catalin Marinas
2019-05-03 23:52 ` Jason Gunthorpe
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=20190329103039.GA44339@arrakis.emea.arm.com \
--to=catalin.marinas@arm.com \
--cc=Dave.Martin@arm.com \
--cc=Lee.Smith@arm.com \
--cc=Ramana.Radhakrishnan@arm.com \
--cc=Ruben.Ayrapetyan@arm.com \
--cc=Szabolcs.Nagy@arm.com \
--cc=acme@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=alex.williamson@redhat.com \
--cc=andreyknvl@google.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dvyukov@google.com \
--cc=edumazet@google.com \
--cc=eugenis@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=jens.wiklander@linaro.org \
--cc=kcc@google.com \
--cc=keescook@chromium.org \
--cc=kevin.brodsky@arm.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luc.vanoostenryck@gmail.com \
--cc=mark.rutland@arm.com \
--cc=mchehab@kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincenzo.frascino@arm.com \
--cc=will.deacon@arm.com \
/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;
as well as URLs for NNTP newsgroup(s).