The vfs_fileattr_get() API is a unification of the two legacy ioctls FS_IOC_GETFLAGS and FS_IOC_FSGETXATTR. The legacy ioctls set a hint flag, either flags_valid or fsx_valid, which overlayfs and fuse may use to convert back to one of the two legacy ioctls. The new file_getattr() syscall is a modern version of the ioctl FS_IOC_FSGETXATTR, but it does not set the fsx_valid hint leading to uninit-value KMSAN warning in ovl_fileattr_get() as is also expected to happen in fuse_fileattr_get(). Reported-by: syzbot+fa79520cb6cf363d660d@syzkaller.appspotmail.com Closes: https://lore.kernel.org/r/698ad8b7.050a0220.3b3015.008b.GAE@google.com/ Fixes: be7efb2d20d67 ("fs: introduce file_getattr and file_setattr syscalls") Cc: Andrey Albershteyn Cc: stable@vger.kernel.org Signed-off-by: Amir Goldstein --- fs/file_attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/file_attr.c b/fs/file_attr.c index 53b356dd8c33a..910c346d81bcd 100644 --- a/fs/file_attr.c +++ b/fs/file_attr.c @@ -379,7 +379,7 @@ SYSCALL_DEFINE5(file_getattr, int, dfd, const char __user *, filename, struct filename *name __free(putname) = NULL; unsigned int lookup_flags = 0; struct file_attr fattr; - struct file_kattr fa; + struct file_kattr fa = { .fsx_valid = true }; /* hint only */ int error; BUILD_BUG_ON(sizeof(struct file_attr) < FILE_ATTR_SIZE_VER0); -- 2.52.0