From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f200.google.com (mail-pf0-f200.google.com [209.85.192.200]) by kanga.kvack.org (Postfix) with ESMTP id 46B8B831F4 for ; Mon, 22 May 2017 15:26:50 -0400 (EDT) Received: by mail-pf0-f200.google.com with SMTP id c6so139273479pfj.5 for ; Mon, 22 May 2017 12:26:50 -0700 (PDT) Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id k76sor281104pfb.30.2017.05.22.12.26.49 for (Google Transport Security); Mon, 22 May 2017 12:26:49 -0700 (PDT) Date: Mon, 22 May 2017 12:26:38 -0700 (PDT) From: Hugh Dickins Subject: Re: mm, something wring in page_lock_anon_vma_read()? In-Reply-To: <5922B3D4.1030700@huawei.com> Message-ID: References: <591D6D79.7030704@huawei.com> <591EB25C.9080901@huawei.com> <591EBE71.7080402@huawei.com> <591F9A09.6010707@huawei.com> <591FA78E.9050307@huawei.com> <5922B3D4.1030700@huawei.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Xishi Qiu Cc: Hugh Dickins , Andrew Morton , Tejun Heo , Michal Hocko , Johannes Weiner , Mel Gorman , Michal Hocko , Vlastimil Babka , Minchan Kim , David Rientjes , Joonsoo Kim , aarcange@redhat.com, sumeet.keswani@hpe.com, Rik van Riel , Linux MM , LKML , zhong jiang On Mon, 22 May 2017, Xishi Qiu wrote: > On 2017/5/20 10:40, Hugh Dickins wrote: > > On Sat, 20 May 2017, Xishi Qiu wrote: > >> > >> Here is a bug report form redhat: https://bugzilla.redhat.com/show_bug.cgi?id=1305620 > >> And I meet the bug too. However it is hard to reproduce, and > >> 624483f3ea82598("mm: rmap: fix use-after-free in __put_anon_vma") is not help. > >> > >> From the vmcore, it seems that the page is still mapped(_mapcount=0 and _count=2), > >> and the value of mapping is a valid address(mapping = 0xffff8801b3e2a101), > >> but anon_vma has been corrupted. > >> > >> Any ideas? > > > > Sorry, no. I assume that _mapcount has been misaccounted, for example > > a pte mapped in on top of another pte; but cannot begin tell you where > > Hi Hugh, > > What does "a pte mapped in on top of another pte" mean? Could you give more info? I mean, there are various places in mm/memory.c which decide what they intend to do based on orig_pte, then take pte lock, then check that pte_same(pte, orig_pte) before taking it any further. If a pte_same() check were missing (I do not know of any such case), then two racing tasks might install the same pte, one on top of the other - page mapcount being incremented twice, but decremented only once when that pte is finally unmapped later. Please see similar discussion in the earlier thread at marc.info/?l=linux-mm&m=148222656211837&w=2 Hugh > > Thanks, > Xishi Qiu > > > in Red Hat's kernel-3.10.0-229.4.2.el7 that might happen. > > > > Hugh -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org