From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B961B2609E3 for ; Mon, 3 Aug 2026 03:04:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785726272; cv=none; b=PqjEeE38oJHhquXDZa7j/Und/V+CBiyIRt/q3EJZ2x4ah0FkV7/v6r/3nwLI4zVHgQmU5O4fcCBd1n/3yhQn1OtfZQ0A+YNgHSQVCE9V1g5yNmgZM67B3PwFg1AATy3pmFPB1RMerjZeGGQG+iOrnFfXW7SFAGr3jCqzk+Zo9bw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785726272; c=relaxed/simple; bh=T4qg+p9BJYW02bha4XTkLAMIPLws+Azjyur4ILHys+o=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=CeDW5daMz3SSEdDYVxJHl2XYLTNRhdlTqZ9hq/4ij0o4HWSFXtVgV3RtDSoIa8Cvu4fvfIueBVCykiYbkru77e2kBNxdxG/JUi8y5wn8KPrdoUKXr1CibHuIDYYOgJuKOIriCh8w0JSitupp0e6SYbwtnfpfDFYSvYjJwrmIyRA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WYOZ3DWw; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WYOZ3DWw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8FC31F000E9; Mon, 3 Aug 2026 03:04:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785726270; bh=6fJcLy6n1zDvyoFaA5W3X+l8LTPqOlt+uZqCUBrTpg8=; h=Date:Cc:Subject:To:References:From:In-Reply-To; b=WYOZ3DWweT8JtOL+BV/9B72upY0i5oDdgjLvfvoh6TmW//MjI4txYr1gmQuKaw21/ nQQuijkosS3SzDjTM9MltHSP6csNttR1ex0+iqh6yqmwM9cDAsgVRTX3miEoz8Ubbm DNzWPamAJvMs/G8VxQB7FH0/yRkpsF3UcV5i2m7NMCivhn6dCAjp2Xh+nb6KOwbAjV m/teh+Guo6+fugCYSlr60paaNhaRYF5/SIbgR0ktpNIhOpaInMc26oPaob+PrsHVZY rIJFx101GfrzA83AnfFC2AgkmgOEwhv1mLO6xXwdr8AOiJ+pJtFLIrh5kag4yyx6ww +nDpGFkSnJioA== Message-ID: <8ec122ba-7c79-48b0-ac44-100c4840b5bd@kernel.org> Date: Mon, 3 Aug 2026 11:04:26 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, stable@kernel.org, qiwenjie@xiaomi.com Subject: Re: [PATCH] f2fs: validate MOVE_RANGE destination size To: Wenjie Qi , jaegeuk@kernel.org References: <20260630031700.2573819-1-qiwenjie@xiaomi.com> Content-Language: en-US From: Chao Yu In-Reply-To: <20260630031700.2573819-1-qiwenjie@xiaomi.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/30/26 11:17, Wenjie Qi wrote: > F2FS_IOC_MOVE_RANGE checks the source range, but not the destination end > before updating i_size. A source hole can expose this: __clone_blkaddrs() > skips NULL_ADDR entries and returns success, so the caller can still extend > the destination inode with unchecked pos_out + len. > > Reject destination overflow and use inode_newsize_ok() before extending > the destination inode. > > Fixes: 4dd6f977fc77 ("f2fs: support an ioctl to move a range of data blocks") > Cc: stable@kernel.org > Assisted-by: Codex:gpt-5.5 > Signed-off-by: Wenjie Qi Reviewed-by: Chao Yu Thanks,