]> 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)
committerMiklos Szeredi <mszeredi@redhat.com>
Wed, 23 Nov 2022 08:10:42 +0000 (09:10 +0100)
commitba09aef3c43e4c088ef656a64da60280865e57f9
tree5ed4b8a896e1f68fdf096ae86621413d8a2cafc1
parent2e3c2571813581b04fc6d806cc9bd3184e8163e9
fuse: lock inode unconditionally in fuse_fallocate()

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>
fs/fuse/file.c