File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1878,9 +1878,10 @@ int ntfs_security_init(struct ntfs_sb_info *sbi)
1878
1878
goto out ;
1879
1879
}
1880
1880
1881
- root_sdh = resident_data (attr );
1881
+ root_sdh = resident_data_ex (attr , sizeof ( struct INDEX_ROOT ) );
1882
1882
if (root_sdh -> type != ATTR_ZERO ||
1883
- root_sdh -> rule != NTFS_COLLATION_TYPE_SECURITY_HASH ) {
1883
+ root_sdh -> rule != NTFS_COLLATION_TYPE_SECURITY_HASH ||
1884
+ offsetof(struct INDEX_ROOT , ihdr ) + root_sdh -> ihdr .used > attr -> res .data_size ) {
1884
1885
err = - EINVAL ;
1885
1886
goto out ;
1886
1887
}
@@ -1896,9 +1897,10 @@ int ntfs_security_init(struct ntfs_sb_info *sbi)
1896
1897
goto out ;
1897
1898
}
1898
1899
1899
- root_sii = resident_data (attr );
1900
+ root_sii = resident_data_ex (attr , sizeof ( struct INDEX_ROOT ) );
1900
1901
if (root_sii -> type != ATTR_ZERO ||
1901
- root_sii -> rule != NTFS_COLLATION_TYPE_UINT ) {
1902
+ root_sii -> rule != NTFS_COLLATION_TYPE_UINT ||
1903
+ offsetof(struct INDEX_ROOT , ihdr ) + root_sii -> ihdr .used > attr -> res .data_size ) {
1902
1904
err = - EINVAL ;
1903
1905
goto out ;
1904
1906
}
You can’t perform that action at this time.
0 commit comments