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 508FF2D73B4; Thu, 15 Jan 2026 17:43:21 +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=1768499001; cv=none; b=Ge8Y1zzOQghwtpFOTKF2jpZg4mGbbM0ET7ynFJOvb6TPZvuk8mK6FkpiPHySrJSlXVF/bADASlpkr+9QvN37YAl2Xo73wLskAnG8G0DiykFrLTEjNTYuEYSDJwT8kmjCUYu55f/dsGtuegRN0exgB+sy5LsN0U4O8xA3UaklgSM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768499001; c=relaxed/simple; bh=/nzvTn1E1QVt8C/W+nEkozwbxdRYUqm5sPi1UhtucpM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sBDYFWGksqeP9ZXHJOP1GMb4C26NQBxAEf7yrd3yCGNNbmgriOBqdaxmIWu0s9KLwNTc2J+ZxIqgMSENI1FRC11yFZCPeEQU0TlL3f46w3JBem8gX5t9VEnPiqGkqMQdDK+ihFneQc6kfq/Masogn5y1Bq6s/Jnq9WM8a0m4/8s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uX9qtnyD; 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="uX9qtnyD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6701C116D0; Thu, 15 Jan 2026 17:43:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1768499001; bh=/nzvTn1E1QVt8C/W+nEkozwbxdRYUqm5sPi1UhtucpM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uX9qtnyDQ5Zzu7wLaasL8vlgI29hv+rFuI5Je7Y2WpI1k6ubn6RAFxLW4pDdSHSuL nbfx50VZdS7SlD6BoGXvaBhsQNATdkFJIckngBekX9UdhDE7AdfdzCj3eODBx7P8m2 ID/CvZTnbUUbG4CoQnR1Cod4crGcSa0uv33W35ok= 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 5.10 073/451] ocfs2: relax BUG() to ocfs2_error() in __ocfs2_move_extent() Date: Thu, 15 Jan 2026 17:44:34 +0100 Message-ID: <20260115164233.541295539@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260115164230.864985076@linuxfoundation.org> References: <20260115164230.864985076@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-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 3cc28afe9815e..6df8b5513bab0 100644 --- a/fs/ocfs2/move_extents.c +++ b/fs/ocfs2/move_extents.c @@ -100,7 +100,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