Re: [PATCH v19 04/15] mm: untag user pointers passed to memory syscalls

From: Catalin Marinas
Date: Fri Aug 09 2019 - 12:03:11 EST


On Tue, Jul 23, 2019 at 07:58:41PM +0200, Andrey Konovalov wrote:
> This patch is a part of a series that extends kernel ABI to allow to pass
> tagged user pointers (with the top byte set to something else other than
> 0x00) as syscall arguments.
>
> This patch allows tagged pointers to be passed to the following memory
> syscalls: get_mempolicy, madvise, mbind, mincore, mlock, mlock2, mprotect,
> mremap, msync, munlock, move_pages.
>
> The mmap and mremap syscalls do not currently accept tagged addresses.
> Architectures may interpret the tag as a background colour for the
> corresponding vma.
>
> Reviewed-by: Khalid Aziz <khalid.aziz@xxxxxxxxxx>
> Reviewed-by: Vincenzo Frascino <vincenzo.frascino@xxxxxxx>
> Reviewed-by: Catalin Marinas <catalin.marinas@xxxxxxx>
> Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>
> Signed-off-by: Andrey Konovalov <andreyknvl@xxxxxxxxxx>
> ---
> mm/madvise.c | 2 ++
> mm/mempolicy.c | 3 +++
> mm/migrate.c | 2 +-
> mm/mincore.c | 2 ++
> mm/mlock.c | 4 ++++
> mm/mprotect.c | 2 ++
> mm/mremap.c | 7 +++++++
> mm/msync.c | 2 ++
> 8 files changed, 23 insertions(+), 1 deletion(-)

More back and forth discussions on how to specify the exceptions here.
I'm proposing just dropping the exceptions and folding in the diff
below.

Andrew, if you prefer a standalone patch instead, please let me know:

------------------8<----------------------------