fs/ntfs3: don't hold ni_lock when calling truncate_setsize()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
fs/ntfs3: don't hold ni_lock when calling truncate_setsize()
syzbot is reporting hung task at do_user_addr_fault() [1], for there is a silent deadlock between PG_locked bit and ni_lock lock.
Since filemap_update_page() calls filemap_read_folio() after calling folio_trylock() which will set PG_locked bit, ntfs_truncate() must not call truncate_setsize() which will wait for PG_locked bit to be cleared when holding ni_lock lock.
From the CVE record · Linux
A lock-ordering issue in the Linux kernel’s ntfs3 filesystem can cause a silent deadlock and hung task. It occurs when ntfs_truncate() waits for a locked folio while holding ni_lock; the input does not specify attacker access or user-interaction requirements.
Engineers running the Linux kernel with the ntfs3 filesystem should check their systems; affected versions are not specified.