fsnotify: fix inode reference leak in fsnotify_recalc_mask()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ c3638b5b13740fa31762d414bbce8b7a694e582a · < 4aca914ac152f5d055ddcb36704d1e539ac08977| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
fsnotify: fix inode reference leak in fsnotify_recalc_mask()
fsnotify_recalc_mask() fails to handle the return value of __fsnotify_recalc_mask(), which may return an inode pointer that needs to be released via fsnotify_drop_object() when the connector's HAS_IREF flag transitions from set to cleared.
This manifests as a hung task with the following call trace:
INFO: task umount:1234 blocked for more than 120 seconds. Call Trace: __schedule schedule fsnotify_sb_delete generic_shutdown_super kill_anon_super cleanup_mnt task_work_run do_exit do_group_exit
The race window that triggers the iref leak:
Thread A (adding mark) Thread B (removing mark) ────────────────────── ──────────────────────── fsnotify_add_mark_locked(): fsnotify_add_mark_list(): spin_lock(conn->lock) add mark_B(evictable) to list spin_unlock(conn->lock) return
/* ---- gap: no lock held ---- */
From the CVE record · Linux
A race in the Linux kernel's fsnotify code can leak an inode reference when a mark is added while another is removed. This can leave an unmount task hung. The input does not establish an attacker access path or authentication requirements.
Engineers running the Linux kernel should check their deployments; affected versions are not specified.