ntfs: take invalidate_lock in ntfs_setattr_size()
Impact
In the Linux kernel, the following vulnerability has been resolved:
Source excerpt · LinuxAffected packages
Affected products
Vendor version evidence. Product records are separate from automatic dependency matching.
Linux · Linux
Other versions: unaffected
| Version / range | Source status |
|---|---|
| 9c87959601e80b39a45250e362e6ddfec17cb0fa to before f0b0738ba95731eeafd11352c74f8b48951f67dc | affected |
| 9c87959601e80b39a45250e362e6ddfec17cb0fa to before 9cc5761b8f28f9cef72061094eb5e37e2cd44d97 | affected |
Linux · Linux
Other versions: affected
| Version / range | Source status |
|---|---|
| 7.1 | affected |
| 0 to before 7.1 | unaffected |
| 7.2.13 through 7.2.* (inclusive) | unaffected |
| 7.3 through * (inclusive) | unaffected |
Original source description
In the Linux kernel, the following vulnerability has been resolved:
ntfs: take invalidate_lock in ntfs_setattr_size()
ntfs_setattr_size() updates i_size and resizes the on-disk attribute without holding mapping->invalidate_lock. Page faults take the lock shared, so a fault racing the resize can resolve a VCN against the transient runlist state of ntfs_non_resident_attr_expand() and fail with a spurious SIGBUS, and can interleave with the size-change epilogue (truncate_pagecache(), i_size_write(), pagecache_isize_extended()).
Take invalidate_lock exclusively around the whole resize after inode_dio_wait(), matching the fallocate path and other filesystems such as xfs, which wraps truncate in its mmaplock (= invalidate_lock).