File tree 1 file changed +6
-4
lines changed 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1849,9 +1849,10 @@ int ntfs_security_init(struct ntfs_sb_info *sbi)
1849
1849
goto out ;
1850
1850
}
1851
1851
1852
- root_sdh = resident_data (attr );
1852
+ root_sdh = resident_data_ex (attr , sizeof ( struct INDEX_ROOT ) );
1853
1853
if (root_sdh -> type != ATTR_ZERO ||
1854
- root_sdh -> rule != NTFS_COLLATION_TYPE_SECURITY_HASH ) {
1854
+ root_sdh -> rule != NTFS_COLLATION_TYPE_SECURITY_HASH ||
1855
+ offsetof(struct INDEX_ROOT , ihdr ) + root_sdh -> ihdr .used > attr -> res .data_size ) {
1855
1856
err = - EINVAL ;
1856
1857
goto out ;
1857
1858
}
@@ -1867,9 +1868,10 @@ int ntfs_security_init(struct ntfs_sb_info *sbi)
1867
1868
goto out ;
1868
1869
}
1869
1870
1870
- root_sii = resident_data (attr );
1871
+ root_sii = resident_data_ex (attr , sizeof ( struct INDEX_ROOT ) );
1871
1872
if (root_sii -> type != ATTR_ZERO ||
1872
- root_sii -> rule != NTFS_COLLATION_TYPE_UINT ) {
1873
+ root_sii -> rule != NTFS_COLLATION_TYPE_UINT ||
1874
+ offsetof(struct INDEX_ROOT , ihdr ) + root_sii -> ihdr .used > attr -> res .data_size ) {
1873
1875
err = - EINVAL ;
1874
1876
goto out ;
1875
1877
}
You can’t perform that action at this time.
0 commit comments