Thread (3 messages) flat view 3 messages, 3 authors, 2020-02-19

Re: [PATCH v2] mm: Avoid creating virtual address aliases in brk()/mmap()/mremap()

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2020-02-19 19:40:23
Also in: linux-mm

On Wed, 19 Feb 2020 13:46:03 +0000 Will Deacon [off-list ref] wrote:
On Wed, Feb 19, 2020 at 12:31:56PM +0000, Catalin Marinas wrote:
quoted
Currently the arm64 kernel ignores the top address byte passed to brk(),
mmap() and mremap(). When the user is not aware of the 56-bit address
limit or relies on the kernel to return an error, untagging such
pointers has the potential to create address aliases in user-space.
Passing a tagged address to munmap(), madvise() is permitted since the
tagged pointer is expected to be inside an existing mapping.

The current behaviour breaks the existing glibc malloc() implementation
which relies on brk() with an address beyond 56-bit to be rejected by
the kernel.

Remove untagging in the above functions by partially reverting commit
ce18d171cb73 ("mm: untag user pointers in mmap/munmap/mremap/brk"). In
addition, update the arm64 tagged-address-abi.rst document accordingly.

Link: https://bugzilla.redhat.com/1797052
Fixes: ce18d171cb73 ("mm: untag user pointers in mmap/munmap/mremap/brk")
Cc: <redacted> # 5.4.x-
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Florian Weimer <redacted>
Reported-by: Victor Stinner <redacted>
Acked-by: Will Deacon <will@kernel.org>
Acked-by: Andrey Konovalov <redacted>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
---

Changes in v2:

- Added note to tagged-address-abi.rst that this behaviour changed in v5.6 and
  some older kernel may still have the old behaviour.

- Updated the commit log to make it clearer we broke the user ABI, also adding
  link to the Red Hat bugzilla entry.
Cheers, I'll queue this up as I have a couple of other arm64 fixes pending
now. (Andrew, please shout if you'd prefer to take it).
Please go ahead.

Reviewed-by: Andrew Morton <akpm@linux-foundation.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help