In the Linux kernel, the following vulnerability has been resolved:
audit: avoid dropping live tree ref on fsnotify rule autoremove
audit_del_rule() 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 audit_put_tree() at the end of audit_del_rule() assumes
the template case. For mixed AUDIT_DIR plus AUDIT_EXE 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 audit_rule_change(), the caller that owns
deletion templates. Keep it in the AUDIT_DEL_RULE cleanup so both
successful deletion and -ENOENT still release the parser-owned tree.
[PM: dropped unnecessary comment for line length reasons]
CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS Score: 9.8
AV:N - audit_autoremove_mark_rule() runs from fsnotify FS_MOVE_SELF/FS_DELETE_SELF/FS_UNMOUNT on the AUDIT_EXE parent directory; nfsd and ksmbd vfs_rename/vfs_rmdir of that directory reach the same path over the network, not only local renameat/rmdir.
AC:L - Each EXE fsnotify autoremove deterministically extra-puts the live shared audit_tree; the attacker issues sequential directory renames/rmdirs they fully control and needs no race or memory layout beyond their influence.
PR:N - Triggering requires only renaming or rmdir'ing the parent directory of an audited executable on a local or NFS/SMB-exported path; a remote client needs no local account, CAP_AUDIT_CONTROL, or init-namespace root beyond export write access.
UI:N - The attacker triggers autoremove with their own rename/rmdir (local or via nfsd/ksmbd); no other user must open files, mount a filesystem, or otherwise interact.
S:U - The use-after-free corrupts host kernel heap (struct audit_tree) and stays within the same kernel security authority; it is not a VM escape, IOMMU bypass, or other documented cross-boundary impact.
C:H - Use-after-free of the shared audit_tree lets a later audit_compare_rule() strcmp the freed pathname and remaining rules dereference attacker-reclaimed tree objects, enabling arbitrary kernel reads.
I:H - The dangling tree is then used in audit_remove_tree_rule() list_del/list_move and prune_one() after extra puts free it, enabling heap spraying, list corruption, arbitrary writes, and control-flow hijack.
A:H - Dereferencing the freed audit_tree pathname or underflowing its refcount during prune oopses/panics the kernel; the UAF can be triggered repeatedly for denial of service.
| Attack Vector |
Network |
Scope |
Unchanged |
| Attack Complexity |
Low |
Confidentiality Impact |
High |
| Privileges Required |
None |
Integrity Impact |
High |
| User Interaction |
None |
Availability Impact |
High |
AV:N - audit_autoremove_mark_rule() runs from fsnotify FS_MOVE_SELF/FS_DELETE_SELF/FS_UNMOUNT on the AUDIT_EXE parent directory; nfsd and ksmbd vfs_rename/vfs_rmdir of that directory reach the same path over the network, not only local renameat/rmdir.
AC:L - Each EXE fsnotify autoremove deterministically extra-puts the live shared audit_tree; the attacker issues sequential directory renames/rmdirs they fully control and needs no race or memory layout beyond their influence.
PR:N - Triggering requires only renaming or rmdir'ing the parent directory of an audited executable on a local or NFS/SMB-exported path; a remote client needs no local account, CAP_AUDIT_CONTROL, or init-namespace root beyond export write access.
UI:N - The attacker triggers autoremove with their own rename/rmdir (local or via nfsd/ksmbd); no other user must open files, mount a filesystem, or otherwise interact.
S:U - The use-after-free corrupts host kernel heap (struct audit_tree) and stays within the same kernel security authority; it is not a VM escape, IOMMU bypass, or other documented cross-boundary impact.
C:H - Use-after-free of the shared audit_tree lets a later audit_compare_rule() strcmp the freed pathname and remaining rules dereference attacker-reclaimed tree objects, enabling arbitrary kernel reads.
I:H - The dangling tree is then used in audit_remove_tree_rule() list_del/list_move and prune_one() after extra puts free it, enabling heap spraying, list corruption, arbitrary writes, and control-flow hijack.
A:H - Dereferencing the freed audit_tree pathname or underflowing its refcount during prune oopses/panics the kernel; the UAF can be triggered repeatedly for denial of service.
CVSS 3.1