Message ID | 20210225191127.GNU2Eisy0%akpm@linux-foundation.org |
---|---|
State | New |
Headers | show |
Series | [merged] ntfs-check-for-valid-standard-information-attribute.patch removed from -mm tree | expand |
--- a/fs/ntfs/inode.c~ntfs-check-for-valid-standard-information-attribute +++ a/fs/ntfs/inode.c @@ -629,6 +629,12 @@ static int ntfs_read_locked_inode(struct } a = ctx->attr; /* Get the standard information attribute value. */ + if ((u8 *)a + le16_to_cpu(a->data.resident.value_offset) + + le32_to_cpu(a->data.resident.value_length) > + (u8 *)ctx->mrec + vol->mft_record_size) { + ntfs_error(vi->i_sb, "Corrupt standard information attribute in inode."); + goto unm_err_out; + } si = (STANDARD_INFORMATION*)((u8*)a + le16_to_cpu(a->data.resident.value_offset));