From: gregkh <gregkh@linuxfoundation.org>
To: "yao.zhang1@amlogic.com" <yao.zhang1@amlogic.com>
Cc: stable <stable@vger.kernel.org>,
"tuan.zhang" <tuan.zhang@amlogic.com>,
"jianxin.pan" <jianxin.pan@amlogic.com>
Subject: Re: mm: call the security_mmap_file() LSM hook in remap_file_pages()
Date: Tue, 27 Oct 2026 06:50:01 +0100 [thread overview]
Message-ID: <2026102700-astonish-whenever-37b4@gregkh> (raw)
In-Reply-To: <2026102711371963416812@amlogic.com>
On Tue, Oct 27, 2026 at 11:37:21AM +0800, yao.zhang1@amlogic.com wrote:
> Dear 5.15.y maintainers,
>
> An mm patch should be backported from upstream mainline to the stable
> 5.15.y branch. The patch's information is shown as below:
>
> [Subject]
> mm: call the security_mmap_file() LSM hook in remap_file_pages()
>
> [Upstream commit ID]
> 0f910dbf2f2a4a7820ba4bac7b280f7108aa05b1
>
> [Kernel version]
> 5.15.y
>
> [Why]
> The remap_file_pages syscall handler calls do_mmap() directly, which
> doesn't contain the LSM security check. And if the process has called
> personality(READ_IMPLIES_EXEC) before and remap_file_pages() is called for
> RW pages, this will actually result in remapping the pages to RWX,
> bypassing a W^X policy enforced by SELinux.
> So we should check prot by security_mmap_file LSM hook in the
> remap_file_pages syscall handler before do_mmap() is called. Otherwise, it
> potentially permits an attacker to bypass a W^X policy enforced by
> SELinux.
Please provide a working backport that you have tested for this, as it
does not apply cleanly on its own.
Also note that 5.15.y will only be alive for one more month, so why
aren't you moving off of this kernel version already instead of wanting
to add a new bugfix to it when there are already 2000+ unfixed CVEs in
that tree?
thanks,
greg k-h
next parent reply other threads:[~2026-10-27 5:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2026102711371963416812@amlogic.com>
2026-10-27 5:50 ` gregkh [this message]
2026-10-27 6:44 ` mm: call the security_mmap_file() LSM hook in remap_file_pages() yao.zhang1
2026-10-27 6:50 ` gregkh
2026-10-27 8:56 ` yao.zhang1
2026-10-27 19:10 ` Sasha Levin
2026-10-28 8:31 ` yao.zhang1
2026-10-27 6:00 ` yao.zhang1
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=2026102700-astonish-whenever-37b4@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=jianxin.pan@amlogic.com \
--cc=stable@vger.kernel.org \
--cc=tuan.zhang@amlogic.com \
--cc=yao.zhang1@amlogic.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox