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)
18781878 goto out ;
18791879 }
18801880
1881- root_sdh = resident_data (attr );
1881+ root_sdh = resident_data_ex (attr , sizeof ( struct INDEX_ROOT ) );
18821882 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 ) {
18841885 err = - EINVAL ;
18851886 goto out ;
18861887 }
@@ -1896,9 +1897,10 @@ int ntfs_security_init(struct ntfs_sb_info *sbi)
18961897 goto out ;
18971898 }
18981899
1899- root_sii = resident_data (attr );
1900+ root_sii = resident_data_ex (attr , sizeof ( struct INDEX_ROOT ) );
19001901 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 ) {
19021904 err = - EINVAL ;
19031905 goto out ;
19041906 }
You can’t perform that action at this time.
0 commit comments