CVE-2026-99732: mm/filemap: read mapping->a_ops->free_folio under i_lock

Published Nov 20, 2026
·
Updated

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

1 affected componentFixes available
linux/kernel>=4.15.0<7.3.5
7.3.5

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 7.3.5

Frequently Asked Questions

1

What conditions are required for this issue to occur?

The vulnerable path requires a folio to be removed from the page cache and the inode to be freed concurrently after i_lock is dropped but before the free_folio callback is read from mapping->a_ops. This can occur in callers that do not hold an inode reference; most callers do hold one.

2

Has this issue been observed in practice?

No. The issue was identified through code inspection and has not been reproduced.

3

Which component behavior is implicated?

The issue involves filesystems' address_space_operations free_folio callback handling. The VFS documentation states that free_folio must not assume that the original address_space mapping still exists.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203