Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp439714iog; Mon, 13 Jun 2022 06:03:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsilIzXiSy2qSonMwSefXj26YZcItOFEdSgFqFZWW7nCR021dPUYK+xuUUm6vUuIbrxQMj X-Received: by 2002:a17:906:1501:b0:715:76d0:862a with SMTP id b1-20020a170906150100b0071576d0862amr9052528ejd.681.1655125419340; Mon, 13 Jun 2022 06:03:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125419; cv=none; d=google.com; s=arc-20160816; b=RzvnpW4ce/2iYRz7TcbDjw+vCDZovmkSJ+8FhAsS7nPIlFMPiNw3v4bbHAuEqJAJEO BETv2RTnwVEDIqjzp/Jjsx2EWpVaI6kWl0C2z7PsZpnkOBYaqXvMHwC3dPoQkmMM5TI3 1ixmTUP4URNYmmmL9dCqsoJoWHgTIsdcpae6XqN/GWa1ezEX+Npv1jJXLIriZC7LdgY1 VPa50EzWHThTbmikxxRNxn4Sds6YnC9sbWM6iwEq3Ug3qAKkpiiziDWxEVwleiLVfvOL gFYOqDW8xcYXltLEBR+bAYL2WQCNncawGy7AlxF1z/PBOgJOt3NxGrVsYkkewGWxVPJQ bMSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8I/GcZtNTXgkDhiQA4LG4oBDHhYdb0Fy6zJWJ+P6quc=; b=02r978x6brl9nPYiVWh6DmbyUWOnGCnDnK6k2CBmMbmqtIMmci4rmvFQEvFHWrAzbY ivMUshxbJL0ZoFAQB+63KBZA6yDc3H4YgjRCI21iaAkw2ZVMz3MUP00nxgTIq1aUAbf8 NE8a2+tJDvi0xLCJx6rIjxBrZyK7DJLXD8hqNdOAwTLHEbHI0fm97TeSQ3lctx2fwJ/H FSZXiV9NDpbipa7R5g3E6QjbrxU4yQseRNbYNNT2ItSovBuB1dNnbXnc3Zaml5d8yi+4 YU0mHQ43krzrAX3jJT0NL4mTLxfxe5GhfltPbW0gYhiX671qfvVvrqIQB91CQZxR24cf aHDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nT4QlsfN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b29-20020a50ccdd000000b0042bd6e16b44si6751946edj.464.2022.06.13.06.03.12; Mon, 13 Jun 2022 06:03:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nT4QlsfN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355863AbiFMLmF (ORCPT + 99 others); Mon, 13 Jun 2022 07:42:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355019AbiFMLeW (ORCPT ); Mon, 13 Jun 2022 07:34:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18891433AD; Mon, 13 Jun 2022 03:47:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7BC69B80EAA; Mon, 13 Jun 2022 10:47:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC40CC34114; Mon, 13 Jun 2022 10:47:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655117262; bh=3xcd3CMZiQnx8j+zrFZDh4QsHMgdVew02B6wf7ESE9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nT4QlsfNKKQYRia5ZJ98vjek3xZ+AGd0B+Tg9Ak1SNac5qtv+HfJ5N30MUxPwGtYf +qb5v1/tqyYAz816fGelVjon9PTZfCwKR/cpUSV9KJ7rYdYj6P9RKH1cy1xLI8FVMD s8P69OxncAmsPiwtxoKc2A3PIrTWS15F/I53x8K4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+763ae12a2ede1d99d4dc@syzkaller.appspotmail.com, Dongliang Mu , Chao Yu , Jaegeuk Kim , Sasha Levin Subject: [PATCH 5.4 340/411] f2fs: remove WARN_ON in f2fs_is_valid_blkaddr Date: Mon, 13 Jun 2022 12:10:13 +0200 Message-Id: <20220613094938.909028005@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094928.482772422@linuxfoundation.org> References: <20220613094928.482772422@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dongliang Mu [ Upstream commit dc2f78e2d4cc844a1458653d57ce1b54d4a29f21 ] Syzbot triggers two WARNs in f2fs_is_valid_blkaddr and __is_bitmap_valid. For example, in f2fs_is_valid_blkaddr, if type is DATA_GENERIC_ENHANCE or DATA_GENERIC_ENHANCE_READ, it invokes WARN_ON if blkaddr is not in the right range. The call trace is as follows: f2fs_get_node_info+0x45f/0x1070 read_node_page+0x577/0x1190 __get_node_page.part.0+0x9e/0x10e0 __get_node_page f2fs_get_node_page+0x109/0x180 do_read_inode f2fs_iget+0x2a5/0x58b0 f2fs_fill_super+0x3b39/0x7ca0 Fix these two WARNs by replacing WARN_ON with dump_stack. Reported-by: syzbot+763ae12a2ede1d99d4dc@syzkaller.appspotmail.com Signed-off-by: Dongliang Mu Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/checkpoint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 54f0d2c4c7d8..44c5110e18f0 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -149,7 +149,7 @@ static bool __is_bitmap_valid(struct f2fs_sb_info *sbi, block_t blkaddr, f2fs_err(sbi, "Inconsistent error blkaddr:%u, sit bitmap:%d", blkaddr, exist); set_sbi_flag(sbi, SBI_NEED_FSCK); - WARN_ON(1); + dump_stack(); } return exist; } @@ -187,7 +187,7 @@ bool f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi, f2fs_warn(sbi, "access invalid blkaddr:%u", blkaddr); set_sbi_flag(sbi, SBI_NEED_FSCK); - WARN_ON(1); + dump_stack(); return false; } else { return __is_bitmap_valid(sbi, blkaddr, type); -- 2.35.1