AZL-115615: CVE-2026-99734 affecting package kernel 6.6.161.1-1
In the Linux kernel, the following vulnerability has been resolved:
mm/shmem: make shmemfile() check the file's inode
shmemfile() only checks if file->fmapping is a shmem mapping. This mapping can belong to another file, however, as with a Coda file backed by a tmpfs container after mmap().
So it does not guarantee that the file inode is an actual shmem inode.
Seal handling and memfd preservation use this check before accessing shmem inode state, so they can access an inode of the wrong type.
Let's make shmemfile() check the inode's file operations instead, to identify shmem inodes reliably. This will identify regular shmem inodes, including memfds and ordinary tmpfs files, independently of wrapper file operations.
Use shmemmapping() in collapsefile() instead to not change the behavior of collapsefile(): it operates on the page cache and uses mapping->host for shmem inode operations. Focusing on the file does not seem relevant.