]> git.ipfire.org Git - thirdparty/linux.git/commit
netfs: Fix overrun check in netfs_extract_user_iter()
authorDavid Howells <dhowells@redhat.com>
Tue, 12 May 2026 12:33:47 +0000 (13:33 +0100)
committerChristian Brauner <brauner@kernel.org>
Tue, 12 May 2026 12:42:30 +0000 (14:42 +0200)
commit0ef37eef83fad3542ee06db2940433ae1a92b39d
tree3a5ee8975247fba7c74182f98f384d7d19849d76
parent0aad5704c6b4d14007d4eab15883e8524e4310f4
netfs: Fix overrun check in netfs_extract_user_iter()

Fix netfs_extract_user_iter() so that if iov_iter_extract_pages() overfills
pages[], then those pages don't get included in the iterator constructed at
the end of the function.  If there was an overfill, memory corruption has
already happened.

Fixes: 85dd2c8ff368 ("netfs: Add a function to extract a UBUF or IOVEC into a BVEC iterator")
Closes: https://sashiko.dev/#/patchset/20260427154639.180684-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://patch.msgid.link/20260512123404.719402-11-dhowells@redhat.com
cc: Paulo Alcantara <pc@manguebit.org>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/netfs/iterator.c