mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-24 11:25:43 +00:00
fuse: Apply flags2 only when userspace set the FUSE_INIT_EXT
commit3066ff9347
upstream. This is just a safety precaution to avoid checking flags on memory that was initialized on the user space side. libfuse zeroes struct fuse_init_out outarg, but this is not guranteed to be done in all implementations. Better is to act on flags and to only apply flags2 when FUSE_INIT_EXT is set. There is a risk with this change, though - it might break existing user space libraries, which are already using flags2 without setting FUSE_INIT_EXT. The corresponding libfuse patch is here https://github.com/libfuse/libfuse/pull/662 Signed-off-by: Bernd Schubert <bschubert@ddn.com> Fixes:53db28933e
("fuse: extend init flags") Cc: <stable@vger.kernel.org> # v5.17 Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
af6d1fc5b8
commit
549f5093e9
1 changed files with 4 additions and 1 deletions
|
@ -1127,7 +1127,10 @@ static void process_init_reply(struct fuse_mount *fm, struct fuse_args *args,
|
|||
process_init_limits(fc, arg);
|
||||
|
||||
if (arg->minor >= 6) {
|
||||
u64 flags = arg->flags | (u64) arg->flags2 << 32;
|
||||
u64 flags = arg->flags;
|
||||
|
||||
if (flags & FUSE_INIT_EXT)
|
||||
flags |= (u64) arg->flags2 << 32;
|
||||
|
||||
ra_pages = arg->max_readahead / PAGE_SIZE;
|
||||
if (flags & FUSE_ASYNC_READ)
|
||||
|
|
Loading…
Reference in a new issue