ntfs: move attribute payload before shrinking its record
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 |
|---|---|
| 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 to before 7dc2c524608039d1b082a0087f7aa0751edd4ffb | affected |
| 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 to before 0ab6dc1ac4601c8d79e5448a024daed6b0c5ef64 | affected |
| 0 to before 7.2.13 | affected |
Linux · Linux
Other versions: affected
| Version / range | Source status |
|---|---|
| 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: move attribute payload before shrinking its record
ntfs_new_attr_flags() resizes the non-resident attribute record before moving its name and mapping pairs to their shorter-header offsets when compression or sparse state is cleared.
Shrinking the record first moves the following attribute over the tail of the old record. The subsequent memmove() therefore copies bytes from that following attribute instead of the old mapping pairs. Re-enabling compression on an empty file persists those bytes as a malformed mapping pairs array, which ntfsck reports as a missing or invalid run length.
Move the payload before shrinking the record, while retaining the existing resize-before-move ordering when growing it.