Linux kernel execution restriction bypass in memfd ACL handling
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
mm/shmem: honour F_SEAL_EXEC when an ACL is set
The owner of a memfd sealed with F_SEAL_EXEC can still change its execute bits by setting a POSIX access ACL. With CONFIG_TMPFS_POSIX_ACL, this lets an unprivileged owner make a non-executable memfd executable, bypassing vm.memfd_noexec=2.
simple_set_acl() updates i_mode directly, bypassing the seal check in shmem_setattr(). Add shmem_set_acl() to check the resulting mode. Share the F_SEAL_EXEC check with shmem_setattr() using memfd_check_seals_mode() in include/linux/memfd.h.
Fix generated by an LLM and sent by Chris Mason in private.
[ david: use common helper; simplify description ]
From the CVE record · Linux
With CONFIG_TMPFS_POSIX_ACL enabled, the owner of a memfd sealed with F_SEAL_EXEC can change its execute bits by setting a POSIX access ACL. A local unprivileged owner can thereby make a non-executable memfd executable despite vm.memfd_noexec=2; this requires ownership of the memfd, not other user interaction.
Anyone running a Linux kernel with CONFIG_TMPFS_POSIX_ACL enabled should check whether their kernel is affected; affected versions were not provided.