Skip to content

Commit

Permalink
fs/ntfs3: Fix general protection fault in run_is_mapped_full
Browse files Browse the repository at this point in the history
commit a33fb01 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]>
  • Loading branch information
aalexandrovich authored and gregkh committed Nov 17, 2024
1 parent ba0b09a commit 509c1c6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fs/ntfs3/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1646,6 +1646,15 @@ struct inode *ntfs_create_inode(struct user_namespace *mnt_userns,
le16_to_cpu(new_de->key_size), sbi);
/* ni_unlock(dir_ni); will be called later. */
out6:
attr = ni_find_attr(ni, NULL, NULL, ATTR_EA, NULL, 0, NULL, NULL);
if (attr && attr->non_res) {
/* Delete ATTR_EA, if non-resident. */
struct runs_tree run;
run_init(&run);
attr_set_size(ni, ATTR_EA, NULL, 0, &run, 0, NULL, false, NULL);
run_close(&run);
}

if (rp_inserted)
ntfs_remove_reparse(sbi, IO_REPARSE_TAG_SYMLINK, &new_de->ref);

Expand Down

0 comments on commit 509c1c6

Please sign in to comment.