ntfs: validate attribute values on lookup
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest6 patches 6 repliesIn review
- v31 patch 2 repliesSuperseded
- v21 patch 2 repliesSuperseded
Changes in v4 from the cover letter
- Expand the single patch into a 6-patch series as requested.
- Keep corruption messages using numeric attribute types and drop the attribute type name helper.
- Move non-resident mapping-pairs metadata validation into the shared ntfs_attr_value_is_valid() helper.
- Preserve resident @val matching in ntfs_external_attr_find() using the actual resident value length, and avoid reading the non-resident lowest_vcn union member when checking resident attrlist duplicates.
- Make ntfs_write_volume_label() add a replacement only after successful removal or after -ENOENT, and propagate other lookup/removal errors.
- Reinitialize the mount-time search context before the $VOLUME_INFORMATION lookup, since a rejected $VOLUME_NAME leaves the context in an undefined state.
- Add $VOLUME_NAME-specific validation, and reject non-resident $VOLUME_NAME records like non-resident $FILE_NAME.
- Include the ntfs_ir_truncate() shrink ordering fix.
- Add $INDEX_ROOT-specific validation on top of the shrink fix.
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | ntfs: validate attribute values on lookupfs/ fs/ | +107 | 0 replies | |
| 2/6 | ntfs: do not replace volume name after lookup errorsfs/ | +8 | 0 replies | |
| 3/6 | ntfs: reinit search context before volume information lookupfs/ | +1 | 0 replies | |
| 4/6 | ntfs: validate resident volume name values on lookupfs/ | +13 | 0 replies | |
| 5/6 | ntfs: update index root allocated size before shrinkfs/ | +15 | 0 replies | |
| 6/6 | ntfs: validate resident index root values on lookupfs/ | +31 | 4 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.
Cover letter [PATCH v4 0/6] ntfs: validate attribute values on lookup
This v4 supersedes the previous single-patch v3. Per review, it expands the lookup-time attribute value validation into a series so $VOLUME_NAME and $INDEX_ROOT can be validated safely.
The first patch keeps the original $FILE_NAME corruption fix and moves the duplicated non-resident mapping-pairs metadata checks into the common attribute value validator. It also keeps resident value matching in the external attribute lookup path on the actual value length and fixes the matching attrlist duplicate check for resident attributes. The next patches prepare the volume label write and mount read paths to cope with a rejected $VOLUME_NAME, add $VOLUME_NAME validation, fix the ntfs_ir_truncate() shrink ordering issue, and then enable $INDEX_ROOT validation.
Changes since v3:
- Expand the single patch into a 6-patch series as requested.
- Keep corruption messages using numeric attribute types and drop the attribute type name helper.
- Move non-resident mapping-pairs metadata validation into the shared ntfs_attr_value_is_valid() helper.
- Preserve resident @val matching in ntfs_external_attr_find() using the actual resident value length, and avoid reading the non-resident lowest_vcn union member when checking resident attrlist duplicates.
- Make ntfs_write_volume_label() add a replacement only after successful removal or after -ENOENT, and propagate other lookup/removal errors.
- Reinitialize the mount-time search context before the $VOLUME_INFORMATION lookup, since a rejected $VOLUME_NAME leaves the context in an undefined state.
- Add $VOLUME_NAME-specific validation, and reject non-resident $VOLUME_NAME records like non-resident $FILE_NAME.
- Include the ntfs_ir_truncate() shrink ordering fix.
- Add $INDEX_ROOT-specific validation on top of the shrink fix.
DaeMyung Kang (6):
ntfs: validate attribute values on lookup
ntfs: do not replace volume name after lookup errors
ntfs: reinit search context before volume information lookup
ntfs: validate resident volume name values on lookup
ntfs: update index root allocated size before shrink
ntfs: validate resident index root values on lookup
fs/ntfs/attrib.c | 203 +++++++++++++++++++++++++++++++++++++---------------- fs/ntfs/attrlist.c | 11 ++- fs/ntfs/index.c | 18 ++++- fs/ntfs/super.c | 12 +++- 4 files changed, 174 insertions(+), 70 deletions(-)
base-commit: 8553f258a57607dbde0b8baab47459aa28eb92f7
Signature · 1 line
2.43.0