Skip to content

Commit 509c1c6

Browse files
aalexandrovichgregkh
authored andcommitted
fs/ntfs3: Fix general protection fault in run_is_mapped_full
commit a33fb016e49e37aafab18dc3c8314d6399cb4727 upstream. Fixed deleating of a non-resident attribute in ntfs_create_inode() rollback. Reported-by: [email protected] Signed-off-by: Konstantin Komarov <[email protected]> Signed-off-by: Bin Lan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ba0b09a commit 509c1c6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

fs/ntfs3/inode.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,6 +1646,15 @@ struct inode *ntfs_create_inode(struct user_namespace *mnt_userns,
16461646
le16_to_cpu(new_de->key_size), sbi);
16471647
/* ni_unlock(dir_ni); will be called later. */
16481648
out6:
1649+
attr = ni_find_attr(ni, NULL, NULL, ATTR_EA, NULL, 0, NULL, NULL);
1650+
if (attr && attr->non_res) {
1651+
/* Delete ATTR_EA, if non-resident. */
1652+
struct runs_tree run;
1653+
run_init(&run);
1654+
attr_set_size(ni, ATTR_EA, NULL, 0, &run, 0, NULL, false, NULL);
1655+
run_close(&run);
1656+
}
1657+
16491658
if (rp_inserted)
16501659
ntfs_remove_reparse(sbi, IO_REPARSE_TAG_SYMLINK, &new_de->ref);
16511660

0 commit comments

Comments
 (0)