From: "yao.zhang1@amlogic.com" <yao.zhang1@amlogic.com>
To: stable <stable@vger.kernel.org>, gregkh <gregkh@linuxfoundation.org>
Cc: tuan.zhang <tuan.zhang@amlogic.com>,
jianxin.pan <jianxin.pan@amlogic.com>
Subject: mm: call the security_mmap_file() LSM hook in remap_file_pages()
Date: Tue, 27 Oct 2026 14:00:20 +0800 [thread overview]
Message-ID: <2026102714001593272722@amlogic.com> (raw)
In-Reply-To: 2026102711371963416812@amlogic.com
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.
Thanks,
yao.zhang1
prev parent reply other threads:[~2026-10-27 6:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2026102711371963416812@amlogic.com>
2026-10-27 5:50 ` mm: call the security_mmap_file() LSM hook in remap_file_pages() gregkh
2026-10-27 6:44 ` 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 [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=2026102714001593272722@amlogic.com \
--to=yao.zhang1@amlogic.com \
--cc=gregkh@linuxfoundation.org \
--cc=jianxin.pan@amlogic.com \
--cc=stable@vger.kernel.org \
--cc=tuan.zhang@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