]> git.baikalelectronics.ru Git - kernel.git/commit
mm/mremap: Add comment explaining the untagging behaviour of mremap()
authorWill Deacon <will@kernel.org>
Wed, 25 Mar 2020 11:13:46 +0000 (11:13 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 26 Mar 2020 11:28:57 +0000 (11:28 +0000)
commit4c568f1bf4b34e6f80f83265434a8a9de85b356a
tree4a15584ff90c52f6b69f1b930f9dcbf90fa4cc75
parent4d29ae3b2674f4157ab722c77127516ee5a3b3f1
mm/mremap: Add comment explaining the untagging behaviour of mremap()

Commit dddd68ab6b6c ("mm: Avoid creating virtual address aliases in
brk()/mmap()/mremap()") changed mremap() so that only the 'old' address
is untagged, leaving the 'new' address in the form it was passed from
userspace. This prevents the unexpected creation of aliasing virtual
mappings in userspace, but looks a bit odd when you read the code.

Add a comment justifying the untagging behaviour in mremap().

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
mm/mremap.c