]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fuse: verify attributes
authorMiklos Szeredi <mszeredi@redhat.com>
Tue, 12 Nov 2019 10:49:04 +0000 (11:49 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 11 Feb 2020 20:03:37 +0000 (20:03 +0000)
commit9767e04c1124eb66aed6e3f6e5edf4fea7b2c8a7
treead0aa8b018a4bd886d8b2e85e42d7d3cc22659df
parent222ba5d8fc9df44eecf85fcaf2bcde1e31aa5aba
fuse: verify attributes

commit eb59bd17d2fa6e5e84fba61a5ebdea984222e6d5 upstream.

If a filesystem returns negative inode sizes, future reads on the file were
causing the cpu to spin on truncate_pagecache.

Create a helper to validate the attributes.  This now does two things:

 - check the file mode
 - check if the file size fits in i_size without overflowing

Reported-by: Arijit Banerjee <arijit@rubrik.com>
Fixes: d8a5ba45457e ("[PATCH] FUSE - core")
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/fuse/dir.c
fs/fuse/fuse_i.h