Unverified Commit a33fb016 authored by Konstantin Komarov's avatar Konstantin Komarov
Browse files

fs/ntfs3: Fix general protection fault in run_is_mapped_full



Fixed deleating of a non-resident attribute in ntfs_create_inode()
rollback.

Reported-by: default avatar <syzbot+9af29acd8f27fbce94bc@syzkaller.appspotmail.com>
Signed-off-by: default avatarKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
parent 090f6127
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1718,7 +1718,10 @@ int ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir,
	attr = ni_find_attr(ni, NULL, NULL, ATTR_EA, NULL, 0, NULL, NULL);
	if (attr && attr->non_res) {
		/* Delete ATTR_EA, if non-resident. */
		attr_set_size(ni, ATTR_EA, NULL, 0, NULL, 0, NULL, false, NULL);
		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)