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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 E14D1C4320A for ; Wed, 18 Aug 2021 16:46:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 77004610A6 for ; Wed, 18 Aug 2021 16:46:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 77004610A6 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 DFE4E6B0072; Wed, 18 Aug 2021 12:46:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DADBC6B0073; Wed, 18 Aug 2021 12:46:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CC3A96B0074; Wed, 18 Aug 2021 12:46:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0142.hostedemail.com [216.40.44.142]) by kanga.kvack.org (Postfix) with ESMTP id AFF906B0072 for ; Wed, 18 Aug 2021 12:46:45 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5CF2182C27C5 for ; Wed, 18 Aug 2021 16:46:45 +0000 (UTC) X-FDA: 78488780370.05.F19FD2D Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf23.hostedemail.com (Postfix) with ESMTP id EF3AD9007057 for ; Wed, 18 Aug 2021 16:46:44 +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=BcolAdz1++Lz5EKAbjNRqtUND/vI1maofEeX6aKJlvY=; b=MEM+1TG4nJWbwCPC8xryiQUkX+ 1CLRv7W3sHWrKGnzUH2U3RzElr7169+iSHhDfC+ANHIGxVu3rInkF1APeaq7Z0w0rNYoMC3iWXfRp qcb7Nmr1cBk6QVY2ShT9oEmnngZTGNsEa204N+im4dMUborvKqU+Cw8q0sPN6ESgALHzxRW47PPjk KfgV45mdgHOZczCqXY8Yv2bVIlcdiI7HKT/mU1McKSnmfMuVuRWuJMdUJpei8f2vnu8+Qp/33I01d 6BGgiCX/51sNrJGXWEPHxKiYkLemgTR6WeNT3Nr49e0G74vudL4oY+thfd3rEQ/xR+XbzUXi5xEb1 zoj1d9pw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mGOgv-0043X5-BL; Wed, 18 Aug 2021 16:45:53 +0000 Date: Wed, 18 Aug 2021 17:45:25 +0100 From: Matthew Wilcox To: Hugh Dickins Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] mm: Remove bogus VM_BUG_ON Message-ID: References: <20210818144932.940640-1-willy@infradead.org> <2197941-297c-f820-aa57-fb5167794fb1@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2197941-297c-f820-aa57-fb5167794fb1@google.com> X-Rspamd-Queue-Id: EF3AD9007057 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=MEM+1TG4; spf=none (imf23.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspamd-Server: rspam01 X-Stat-Signature: jwu5zqe839cd1jh8hf9ec461ouxkkfr4 X-HE-Tag: 1629305204-758271 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 Wed, Aug 18, 2021 at 09:34:51AM -0700, Hugh Dickins wrote: > On Wed, 18 Aug 2021, Matthew Wilcox (Oracle) wrote: > > > It is not safe to check page->index without holding the page lock. > > It can be changed if the page is moved between the swap cache and the > > page cache for a shmem file, for example. There is a VM_BUG_ON below > > which checks page->index is correct after taking the page lock. > > > > Cc: stable@vger.kernel.org > > Fixes: 5c211ba29deb ("mm: add and use find_lock_entries") > > I don't mind that VM_BUG_ON_PAGE() being removed, but question whether > this Fixes anything, and needs to go to stable. Or maybe it's just that > the shmem example is wrong - moving shmem from page to swap cache does > not change page->index. Or maybe you have later changes in your tree > which change that and do require this. Otherwise, I'll have to worry > why my testing has missed it for six months. I'm sorry, I think you're going to have to worry :-( Syzbot found it initially: https://lore.kernel.org/linux-mm/0000000000009cfcda05c926b34b@google.com/ and then I hit it today during my testing (which is definitely due to further changes in my tree). I should have added: Reported-by: syzbot+c87be4f669d920c76330@syzkaller.appspotmail.com