linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org,
	Szabolcs Nagy <szabolcs.nagy@arm.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Florian Weimer <fweimer@redhat.com>,
	Victor Stinner <vstinner@redhat.com>,
	Andrey Konovalov <andreyknvl@google.com>
Subject: Re: [PATCH v2] mm: Avoid creating virtual address aliases in brk()/mmap()/mremap()
Date: Wed, 19 Feb 2020 11:40:20 -0800	[thread overview]
Message-ID: <20200219114020.0d6c730abce1cdd77e4e5487@linux-foundation.org> (raw)
In-Reply-To: <20200219134602.GB21366@willie-the-truck>

On Wed, 19 Feb 2020 13:46:03 +0000 Will Deacon <will@kernel.org> wrote:

> On Wed, Feb 19, 2020 at 12:31:56PM +0000, Catalin Marinas wrote:
> > 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: <stable@vger.kernel.org> # 5.4.x-
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: Florian Weimer <fweimer@redhat.com>
> > Reported-by: Victor Stinner <vstinner@redhat.com>
> > Acked-by: Will Deacon <will@kernel.org>
> > Acked-by: Andrey Konovalov <andreyknvl@google.com>
> > 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>


      reply	other threads:[~2020-02-19 19:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-19 12:31 [PATCH v2] mm: Avoid creating virtual address aliases in brk()/mmap()/mremap() Catalin Marinas
2020-02-19 13:46 ` Will Deacon
2020-02-19 19:40   ` Andrew Morton [this message]

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=20200219114020.0d6c730abce1cdd77e4e5487@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=andreyknvl@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=fweimer@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=szabolcs.nagy@arm.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vstinner@redhat.com \
    --cc=will@kernel.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;
as well as URLs for NNTP newsgroup(s).