All of lore.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: stable@vger.kernel.org, yang@os.amperecomputing.com,
	Naresh Kamboju <naresh.kamboju@linaro.org>
Subject: Re: [PATCH stable 5.10.y-6.12.y] arm64: mte: Do not allow PROT_MTE on MAP_HUGETLB user mappings
Date: Fri, 21 Feb 2025 15:36:58 +0000	[thread overview]
Message-ID: <Z7idmpkLyNWgMkb3@arm.com> (raw)
In-Reply-To: <2025022102-scabbed-jinx-5f61@gregkh>

On Fri, Feb 21, 2025 at 04:17:09PM +0100, Greg Kroah-Hartman wrote:
> On Thu, Feb 20, 2025 at 03:58:01PM +0000, Catalin Marinas wrote:
> > PROT_MTE (memory tagging extensions) is not supported on all user mmap()
> > types for various reasons (memory attributes, backing storage, CoW
> > handling). The arm64 arch_validate_flags() function checks whether the
> > VM_MTE_ALLOWED flag has been set for a vma during mmap(), usually by
> > arch_calc_vm_flag_bits().
> > 
> > Linux prior to 6.13 does not support PROT_MTE hugetlb mappings. This was
> > added by commit 25c17c4b55de ("hugetlb: arm64: add mte support").
> > However, earlier kernels inadvertently set VM_MTE_ALLOWED on
> > (MAP_ANONYMOUS | MAP_HUGETLB) mappings by only checking for
> > MAP_ANONYMOUS.
> > 
> > Explicitly check MAP_HUGETLB in arch_calc_vm_flag_bits() and avoid
> > setting VM_MTE_ALLOWED for such mappings.
> > 
> > Fixes: 9f3419315f3c ("arm64: mte: Add PROT_MTE support to mmap() and mprotect()")
> > Cc: <stable@vger.kernel.org> # 5.10.x-6.12.x
> > Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> > Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> > ---
> > 
> > Hi Greg,
> > 
> > This patch applies cleanly on top of the stable-rc/linux-6.12.y to
> > 5.10.y LTS, so I'm only sending it once. It's not for 6.13 onwards since
> > those kernels support hugetlbfs with MTE.
> 
> Now queued up, thanks.

Thanks Greg.

-- 
Catalin

      reply	other threads:[~2025-02-21 15:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-20 15:58 [PATCH stable 5.10.y-6.12.y] arm64: mte: Do not allow PROT_MTE on MAP_HUGETLB user mappings Catalin Marinas
2025-02-20 16:39 ` Greg Kroah-Hartman
2025-02-20 17:52 ` Sasha Levin
2025-02-21 15:17 ` Greg Kroah-Hartman
2025-02-21 15:36   ` Catalin Marinas [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=Z7idmpkLyNWgMkb3@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=naresh.kamboju@linaro.org \
    --cc=stable@vger.kernel.org \
    --cc=yang@os.amperecomputing.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.