From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27E20C4338F for ; Mon, 9 Aug 2021 22:53:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BA7A360C40 for ; Mon, 9 Aug 2021 22:53:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BA7A360C40 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id EEB878D0002; Mon, 9 Aug 2021 18:53:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E9ABD6B0073; Mon, 9 Aug 2021 18:53:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D89B58D0002; Mon, 9 Aug 2021 18:53:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0241.hostedemail.com [216.40.44.241]) by kanga.kvack.org (Postfix) with ESMTP id BB55F6B0072 for ; Mon, 9 Aug 2021 18:53:19 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5745D8249980 for ; Mon, 9 Aug 2021 22:53:19 +0000 (UTC) X-FDA: 78457044918.06.118E447 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf04.hostedemail.com (Postfix) with ESMTP id 8B04B5000330 for ; Mon, 9 Aug 2021 22:53:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=JyJ5X/zIVvUaHKHLTr1RSzm14FwgxMoXR2aQx+rj2lM=; b=ip6fHkA6nYgf1O0oDkmv/N+zFM ejIOmIgJxrAsLAwqK0PN1apifHvOcnA5BtGDJJlyYj8ibialXcQTvG1Gqe5qkC5l+e+8Yp4t8BRww A06LGLE9MtI2A8cexKCBtzOJr5G5mfQUYI9RqGmhKt19aDeRerkplAI93ory9lF9P4e2qilCi7HKc qHbPOqX4qpcQZEvoW0M9h+SCTkX8rSwcNQu2I67lbreHDmy5kvkk7hBcGQoRc6tOLMPuA4sPd33y5 2LjZgHdrPEFkUq7MtRrKnTlnULUp4HvyH0Iv210+V6+Ljeietd3I5+v2+xcTEEt2/s4hsh//F1DRu tQsDGY/A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDE6H-00BV4B-IC; Mon, 09 Aug 2021 22:50:38 +0000 Date: Mon, 9 Aug 2021 23:50:29 +0100 From: Matthew Wilcox To: syzbot Cc: akpm@linux-foundation.org, bp@alien8.de, frederic@kernel.org, hpa@zytor.com, jmattson@google.com, joro@8bytes.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, mark.rutland@arm.com, masahiroy@kernel.org, mingo@redhat.com, npiggin@gmail.com, pbonzini@redhat.com, peterz@infradead.org, rafael.j.wysocki@intel.com, rostedt@goodmis.org, seanjc@google.com, sedat.dilek@gmail.com, syzkaller-bugs@googlegroups.com, tglx@linutronix.de, vitor@massaru.org, vkuznets@redhat.com, wanpengli@tencent.com, will@kernel.org, x86@kernel.org Subject: Re: [syzbot] kernel BUG in find_lock_entries Message-ID: References: <0000000000009cfcda05c926b34b@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0000000000009cfcda05c926b34b@google.com> Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=ip6fHkA6; dmarc=none; spf=none (imf04.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Stat-Signature: ox6xmgadi9fi6eidudwzor16rm4uki1s X-Rspamd-Queue-Id: 8B04B5000330 X-Rspamd-Server: rspam01 X-HE-Tag: 1628549598-293467 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Aug 09, 2021 at 02:02:22PM -0700, syzbot wrote: > The issue was bisected to: > > commit 997acaf6b4b59c6a9c259740312a69ea549cc684 > Author: Mark Rutland > Date: Mon Jan 11 15:37:07 2021 +0000 > > lockdep: report broken irq restoration That's just a bogus bisection. The correct bad commit is 5c211ba29deb. > kernel BUG at mm/filemap.c:2041! > invalid opcode: 0000 [#1] PREEMPT SMP KASAN > CPU: 1 PID: 24786 Comm: syz-executor626 Not tainted 5.14.0-rc4-syzkaller #0 > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 > RIP: 0010:find_lock_entries+0x10d5/0x1110 mm/filemap.c:2041 This patch should fix it. It's not just removing the warning; this warning duplicates the warning a few lines down (after taking the lock). It's not safe to make this assertion without holding the page lock as the page can move between the page cache and the swap cache. #syz test diff --git a/mm/filemap.c b/mm/filemap.c index d1458ecf2f51..34de0b14aaa9 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2038,7 +2038,6 @@ unsigned find_lock_entries(struct address_space *mapping, pgoff_t start, if (!xa_is_value(page)) { if (page->index < start) goto put; - VM_BUG_ON_PAGE(page->index != xas.xa_index, page); if (page->index + thp_nr_pages(page) - 1 > end) goto put; if (!trylock_page(page))