Re: [syzbot] possible fix (linux-ntfs3)

From: syzbot
Date: Mon Sep 02 2024 - 09:01:19 EST


For archival purposes, forwarding an incoming command email to
linux-kernel@xxxxxxxxxxxxxxx, syzkaller-bugs@xxxxxxxxxxxxxxxx.

***

Subject: possible fix (linux-ntfs3)
Author: almaz.alexandrovich@xxxxxxxxxxxxxxxxxxxx

#syz test: https://github.com/Paragon-Software-Group/linux-ntfs3.git master

diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c
index 1963a8928360..ab2abd323859 100644
--- a/fs/ntfs3/inode.c
+++ b/fs/ntfs3/inode.c
@@ -1679,7 +1679,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)