| @@ -757,12 +757,6 @@ static int ntfs_read_locked_inode(struct inode *vi) · 756 unmodified lines |
| 757 | } | 757 | } |
| 758 | a = ctx->attr; | 758 | a = ctx->attr; |
| 759 | /* Get the standard information attribute value. */ | 759 | /* Get the standard information attribute value. */ |
| 760 | if ((u8 *)a + le16_to_cpu(a->data.resident.value_offset) | | |
| 761 | + le32_to_cpu(a->data.resident.value_length) > | | |
| 762 | (u8 *)ctx->mrec + vol->mft_record_size) { | | |
| 763 | ntfs_error(vi->i_sb, "Corrupt standard information attribute in inode."); | | |
| 764 | goto unm_err_out; | | |
| 765 | } | | |
| 766 | si = (struct standard_information *)((u8 *)a + | 760 | si = (struct standard_information *)((u8 *)a + |
| 767 | le16_to_cpu(a->data.resident.value_offset)); | 761 | le16_to_cpu(a->data.resident.value_offset)); |
| 768 | | 762 | |
| @@ -849,13 +843,6 @@ static int ntfs_read_locked_inode(struct inode *vi) · 80 unmodified lines |
| 849 | goto unm_err_out; | 843 | goto unm_err_out; |
| 850 | } | 844 | } |
| 851 | } else /* if (!a->non_resident) */ { | 845 | } else /* if (!a->non_resident) */ { |
| 852 | if ((u8 *)a + le16_to_cpu(a->data.resident.value_offset) | | |
| 853 | + le32_to_cpu( | | |
| 854 | a->data.resident.value_length) > | | |
| 855 | (u8 *)ctx->mrec + vol->mft_record_size) { | | |
| 856 | ntfs_error(vi->i_sb, "Corrupt attribute list in inode."); | | |
| 857 | goto unm_err_out; | | |
| 858 | } | | |
| 859 | /* Now copy the attribute list. */ | 846 | /* Now copy the attribute list. */ |
| 860 | memcpy(ni->attr_list, (u8 *)a + le16_to_cpu( | 847 | memcpy(ni->attr_list, (u8 *)a + le16_to_cpu( |
| 861 | a->data.resident.value_offset), | 848 | a->data.resident.value_offset), |
| @@ -954,10 +941,6 @@ view_index_meta: · 92 unmodified lines |
| 954 | ir = (struct index_root *)((u8 *)a + | 941 | ir = (struct index_root *)((u8 *)a + |
| 955 | le16_to_cpu(a->data.resident.value_offset)); | 942 | le16_to_cpu(a->data.resident.value_offset)); |
| 956 | ir_end = (u8 *)ir + le32_to_cpu(a->data.resident.value_length); | 943 | ir_end = (u8 *)ir + le32_to_cpu(a->data.resident.value_length); |
| 957 | if (ir_end > (u8 *)ctx->mrec + vol->mft_record_size) { | | |
| 958 | ntfs_error(vi->i_sb, "$INDEX_ROOT attribute is corrupt."); | | |
| 959 | goto unm_err_out; | | |
| 960 | } | | |
| 961 | index_end = (u8 *)&ir->index + | 944 | index_end = (u8 *)&ir->index + |
| 962 | le32_to_cpu(ir->index.index_length); | 945 | le32_to_cpu(ir->index.index_length); |
| 963 | if (index_end > ir_end) { | 946 | if (index_end > ir_end) { |
| @@ -1552,10 +1535,6 @@ static int ntfs_read_locked_index_inode(struct inode *base_vi, struct inode *vi) · 588 unmodified lines |
| 1552 | | 1535 | |
| 1553 | ir = (struct index_root *)((u8 *)a + le16_to_cpu(a->data.resident.value_offset)); | 1536 | ir = (struct index_root *)((u8 *)a + le16_to_cpu(a->data.resident.value_offset)); |
| 1554 | ir_end = (u8 *)ir + le32_to_cpu(a->data.resident.value_length); | 1537 | ir_end = (u8 *)ir + le32_to_cpu(a->data.resident.value_length); |
| 1555 | if (ir_end > (u8 *)ctx->mrec + vol->mft_record_size) { | | |
| 1556 | ntfs_error(vi->i_sb, "$INDEX_ROOT attribute is corrupt."); | | |
| 1557 | goto unm_err_out; | | |
| 1558 | } | | |
| 1559 | index_end = (u8 *)&ir->index + le32_to_cpu(ir->index.index_length); | 1538 | index_end = (u8 *)&ir->index + le32_to_cpu(ir->index.index_length); |
| 1560 | if (index_end > ir_end) { | 1539 | if (index_end > ir_end) { |
| 1561 | ntfs_error(vi->i_sb, "Index is corrupt."); | 1540 | ntfs_error(vi->i_sb, "Index is corrupt."); |
| @@ -1999,13 +1978,6 @@ int ntfs_read_inode_mount(struct inode *vi) · 437 unmodified lines |
| 1999 | goto put_err_out; | 1978 | goto put_err_out; |
| 2000 | } | 1979 | } |
| 2001 | } else /* if (!ctx.attr->non_resident) */ { | 1980 | } else /* if (!ctx.attr->non_resident) */ { |
| 2002 | if ((u8 *)a + le16_to_cpu( | | |
| 2003 | a->data.resident.value_offset) + | | |
| 2004 | le32_to_cpu(a->data.resident.value_length) > | | |
| 2005 | (u8 *)ctx->mrec + vol->mft_record_size) { | | |
| 2006 | ntfs_error(sb, "Corrupt attribute list attribute."); | | |
| 2007 | goto put_err_out; | | |
| 2008 | } | | |
| 2009 | /* Now copy the attribute list. */ | 1981 | /* Now copy the attribute list. */ |
| 2010 | memcpy(ni->attr_list, (u8 *)a + le16_to_cpu( | 1982 | memcpy(ni->attr_list, (u8 *)a + le16_to_cpu( |
| 2011 | a->data.resident.value_offset), | 1983 | a->data.resident.value_offset), |