]> git.baikalelectronics.ru Git - kernel.git/commit
fuse: lock inode unconditionally in fuse_fallocate()
authorMiklos Szeredi <mszeredi@redhat.com>
Wed, 23 Nov 2022 08:10:42 +0000 (09:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Dec 2022 10:23:01 +0000 (11:23 +0100)
commit3e1b6d0d8af24730c66a8169608d723c9064e6ab
tree9d9c32eb63bd7d25669cc0e41232aa1b783aaaf8
parent52aafbfc1c99b891b492934cd323b7b84eb57cda
fuse: lock inode unconditionally in fuse_fallocate()

commit ba09aef3c43e4c088ef656a64da60280865e57f9 upstream.

file_modified() must be called with inode lock held.  fuse_fallocate()
didn't lock the inode in case of just FALLOC_KEEP_SIZE flags value, which
resulted in a kernel Warning in notify_change().

Lock the inode unconditionally, like all other fallocate implementations
do.

Reported-by: Pengfei Xu <pengfei.xu@intel.com>
Reported-and-tested-by: syzbot+462da39f0667b357c4b6@syzkaller.appspotmail.com
Fixes: 1a2df5444ce3 ("fuse: add file_modified() to fallocate")
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/fuse/file.c