Skip to content
Unverified Commit dbee298c authored by Joanne Koong's avatar Joanne Koong Committed by Christian Brauner
Browse files

fuse: fix fuse_fill_write_pages() upper bound calculation



This fixes a bug in commit 63c69ad3 ("fuse: refactor
fuse_fill_write_pages()") where max_pages << PAGE_SHIFT is mistakenly
used as the calculation for the max_pages upper limit but there's the
possibility that copy_folio_from_iter_atomic() may copy over bytes
from the iov_iter that are less than the full length of the folio,
which would lead to exceeding max_pages.

This commit fixes it by adding a 'ap->num_folios < max_folios' check.

Signed-off-by: default avatarJoanne Koong <joannelkoong@gmail.com>
Link: https://lore.kernel.org/20250614000114.910380-1-joannelkoong@gmail.com


Fixes: 63c69ad3 ("fuse: refactor fuse_fill_write_pages()")
Tested-by: default avatarBrian Foster <bfoster@redhat.com>
Reported-by: default avatarBrian Foster <bfoster@redhat.com>
Closes: https://lore.kernel.org/linux-fsdevel/aEq4haEQScwHIWK6@bfoster/


Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent cbe4134e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment