CVE-2026-89643: audit: avoid dropping live tree ref on fsnotify rule autoremove
In the Linux kernel, the following vulnerability has been resolved:
audit: avoid dropping live tree ref on fsnotify rule autoremove
auditdelrule() is used for both netlink deletion templates and internal fsnotify autoremove. The former passes a parsed template which owns a temporary tree reference; the latter passes the installed entry itself.
The unconditional auditputtree() at the end of auditdelrule() assumes the template case. For mixed AUDITDIR plus AUDITEXE rules, an fsnotify autoremove event therefore drops the installed rule's live tree reference. Repeating this across rules sharing the same tree can free the tree while another rule still references it, and a later autoremove dereferences the freed pathname while comparing rules.
Move the temporary-tree put to auditrulechange(), the caller that owns deletion templates. Keep it in the AUDITDELRULE cleanup so both successful deletion and -ENOENT still release the parser-owned tree.
[PM: dropped unnecessary comment for line length reasons]
Event History
Frequently Asked Questions
Which audit rule setups are exposed to this issue?
The issue affects installed audit rules that combine AUDIT_DIR and AUDIT_EXE and share the same audit tree with other rules. It is triggered when fsnotify internally autoremoves one of those installed rules.
Does a single autoremove immediately create the use-after-free condition?
An autoremove can drop a live tree reference from the installed rule. Repeated autoremoves across rules sharing that tree can free the tree while another rule still holds a reference, allowing a later autoremove to dereference the freed pathname.
What change resolves the reference-handling problem?
The fix moves the temporary tree-reference release from audit_del_rule() to audit_rule_change(), which owns netlink deletion templates. The cleanup also retains the release for AUDIT_DEL_RULE requests that return -ENOENT.