From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6CFB4346FB9; Tue, 16 Dec 2025 12:19:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765887550; cv=none; b=Bpmshk+251R+h2x7cH+fj2wDHEjJwuURUHFMFKhxfqV6gTVSAnXh3yWLFrfD4+z/K9tqask/4phSKk3MDrCmjkkqPEUx4gv4t+AqBvo+ANI2/sF9iqqzWDO2YVxNeCIPz02eF+J6z/bycSHopBiTuVMkcaitGHsM/7TjKdny7vg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765887550; c=relaxed/simple; bh=PQ9bXSgyoEQofeNeTb3YI0MMcxlxE0xlYMA3LP2g93c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B1QDo0e6anCbHb9aUeJEuXeEYAiLaGDFrZ1fmZw1lTnJiBSgZEnhjZYaRUwu6zorH4QnPIqAqkecJBBE/eR0not4nwg76VpZ/41YTHffn49q+tRCdInYiDNSsduvusKJTHkjs89MpV3DJGMmjCcdgaLKc+5cwWMcTswiev1HDqY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=f1hOoWy7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="f1hOoWy7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9F46C4CEF1; Tue, 16 Dec 2025 12:19:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765887550; bh=PQ9bXSgyoEQofeNeTb3YI0MMcxlxE0xlYMA3LP2g93c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f1hOoWy7dbjARM3ovxPDU8yxVBYxf6Kchb4oEtuD2FjyYygcgUmu+36aTK/kVpnV9 gq3JVlT3Rqv4+ViF6h3K8JSItwv/JqwbpjOV5f/0kwE3O/aNRPcSooA1jE0SjchdB7 wwpViC9FBQI0IN95eHkr24o5x0sDK+OpimPfeROs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dmitry Antipov , syzbot+727d161855d11d81e411@syzkaller.appspotmail.com, Joseph Qi , Mark Fasheh , Joel Becker , Junxiao Bi , Changwei Ge , Jun Piao , Andrew Morton , Sasha Levin Subject: [PATCH 6.18 264/614] ocfs2: relax BUG() to ocfs2_error() in __ocfs2_move_extent() Date: Tue, 16 Dec 2025 12:10:31 +0100 Message-ID: <20251216111410.938583975@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251216111401.280873349@linuxfoundation.org> References: <20251216111401.280873349@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dmitry Antipov [ Upstream commit 8a7d58845fae061c62b50bc5eeb9bae4a1dedc3d ] In '__ocfs2_move_extent()', relax 'BUG()' to 'ocfs2_error()' just to avoid crashing the whole kernel due to a filesystem corruption. Fixes: 8f603e567aa7 ("Ocfs2/move_extents: move a range of extent.") Link: https://lkml.kernel.org/r/20251009102349.181126-2-dmantipov@yandex.ru Signed-off-by: Dmitry Antipov Closes: https://syzkaller.appspot.com/bug?extid=727d161855d11d81e411 Reported-by: syzbot+727d161855d11d81e411@syzkaller.appspotmail.com Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Jun Piao Signed-off-by: Andrew Morton Signed-off-by: Sasha Levin --- fs/ocfs2/move_extents.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c index 10923bf7c8b84..26e150c5f25eb 100644 --- a/fs/ocfs2/move_extents.c +++ b/fs/ocfs2/move_extents.c @@ -98,7 +98,13 @@ static int __ocfs2_move_extent(handle_t *handle, rec = &el->l_recs[index]; - BUG_ON(ext_flags != rec->e_flags); + if (ext_flags != rec->e_flags) { + ret = ocfs2_error(inode->i_sb, + "Inode %llu has corrupted extent %d with flags 0x%x at cpos %u\n", + (unsigned long long)ino, index, rec->e_flags, cpos); + goto out; + } + /* * after moving/defraging to new location, the extent is not going * to be refcounted anymore. -- 2.51.0