AZL-115612: CVE-2026-99732 affecting package kernel 6.6.161.1-1
In the Linux kernel, the following vulnerability has been resolved:
mm/filemap: read mapping->aops->freefolio under ilock
memoryfailure() -> ... -> filemapremovefolio() can read mapping->aops after the inode has been freed. Once the folio is deleted from the pagecache it no longer pins the mapping, so after ilock is dropped e.g., a concurrent final iput() can evict and free the inode before filemapfreefolio() looks up mapping->aops->freefolio.
Most callers hold a reference on the inode, but not all.
Documentation/filesystems/vfs.rst explicitly states that ->freefolio() must not assume the original addressspace mapping still exists.
Fix it by loading ->freefolio while ilock is still held, similar to what foliounmapinvalidate() does.
Inline filemapfreefolio() into its remaining caller such that deletefrompagecachebatch() also just loads the callback before dropping the ilock.
The bug was found by code inspection and has not been reproduced.
Fix generated by an LLM and sent by Josef Bacik in private.
[ david: get rid of filemapfreefolio() entirely; improve patch description ]
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Load mapping->a_ops->free_folio while i_lock is still held, before dropping the lock.