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 754A234BA49; Tue, 16 Dec 2025 11:48:38 +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=1765885718; cv=none; b=NxXDkUKKC0x5oD61X4QwgHFUHUdV4CRbksw8YcnzLyZj3KUbl9U3YKc5+YahmyOsi30ormBQlvVzM44+sRDYdbQtLmdvX3IxPdjkJqPi3EY7raHY6+4QjaZruTiSzoPjDv5MzhMe6lnm1IVrrNC9Wf0UMMx6oQP+qjLc9easV7E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765885718; c=relaxed/simple; bh=nts91pwJUzbc57tCK0B//wVs4MQ/XrdSOXZWZKXchlY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AyJLzNOyoxPkemgb1RavqF69LPrcVyD44LwUlU21hQ+TbVLI4GN/10VpCKD8qYW7HL+ONOejfBHGuzcMHpl2N8pH6qhXjwE3vT2et7vqGZqnUH0CgMWIPiFu9S3Pi08a9EsmAdtLEtlvITP20ZutcYCgfW+tgBWixsuWTGXxRYk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BcCRDFfz; 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="BcCRDFfz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BA98C4CEF1; Tue, 16 Dec 2025 11:48:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765885717; bh=nts91pwJUzbc57tCK0B//wVs4MQ/XrdSOXZWZKXchlY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BcCRDFfzLVjGFvuo8fJP36QRHp8AQLM9YkdcVZxi30dQBJv34jcdpj0fjhCfuHGsm kwBscU06p7Pw95KOe0JhcDCe67pGiS1EPukpJ0XNFuinCYXlTzVYCFOpaZ9Ox8GzqN eXQ3gMV0xKvHkKgIuRyRdxmMuyUkx8SjrMNk7rQg= 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.17 224/507] ocfs2: relax BUG() to ocfs2_error() in __ocfs2_move_extent() Date: Tue, 16 Dec 2025 12:11:05 +0100 Message-ID: <20251216111353.620292499@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251216111345.522190956@linuxfoundation.org> References: <20251216111345.522190956@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.17-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 80ebb0b7265a9..5a0228c51ec3c 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