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=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 6F988C10F14 for ; Thu, 10 Oct 2019 03:15:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1C9AE20650 for ; Thu, 10 Oct 2019 03:15:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1C9AE20650 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7FA7B6B0003; Wed, 9 Oct 2019 23:15:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 783F46B0005; Wed, 9 Oct 2019 23:15:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 649FB8E0003; Wed, 9 Oct 2019 23:15:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0099.hostedemail.com [216.40.44.99]) by kanga.kvack.org (Postfix) with ESMTP id 3DCAF6B0003 for ; Wed, 9 Oct 2019 23:15:37 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id DBD7682437C9 for ; Thu, 10 Oct 2019 03:15:36 +0000 (UTC) X-FDA: 76026409872.16.head50_30f0a0a708e3e X-HE-Tag: head50_30f0a0a708e3e X-Filterd-Recvd-Size: 3060 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Thu, 10 Oct 2019 03:15:36 +0000 (UTC) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2019 20:15:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,278,1566889200"; d="scan'208";a="223801015" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by fmsmga002.fm.intel.com with ESMTP; 09 Oct 2019 20:15:32 -0700 Date: Thu, 10 Oct 2019 11:15:16 +0800 From: Wei Yang To: Wei Yang Cc: Shakeel Butt , Qian Cai , Andrew Morton , Konstantin Khlebnikov , Rik van Riel , Linux MM , LKML , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linux-s390@vger.kernel.org Subject: Re: "reuse mergeable anon_vma as parent when fork" causes a crash on s390 Message-ID: <20191010031516.GA5060@richard> Reply-To: Wei Yang References: <1570656570.5937.24.camel@lca.pw> <20191010023601.GA4793@richard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191010023601.GA4793@richard> User-Agent: Mutt/1.9.4 (2018-02-28) 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 Thu, Oct 10, 2019 at 10:36:01AM +0800, Wei Yang wrote: >Hi, Qian, Shakeel > >Thanks for testing. > >Sounds I missed some case to handle. anon_vma_clone() now would be called in >vma_adjust, which is a different case when it is introduced. > Well, I have to correct my statement. The reason is we may did something more in anon_vma_clone(). Here is a quick fix, while I need to go through all the cases carefully. diff --git a/mm/rmap.c b/mm/rmap.c index 12f6c3d7fd9d..2844f442208d 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -271,7 +271,7 @@ int anon_vma_clone(struct vm_area_struct *dst, struct vm_area_struct *src) * 1. Parent has vm_prev, which implies we have vm_prev. * 2. Parent and its vm_prev have the same anon_vma. */ - if (pprev && pprev->anon_vma == src->anon_vma) + if (!dst->anon_vma && pprev && pprev->anon_vma == src->anon_vma) dst->anon_vma = prev->anon_vma; list_for_each_entry_reverse(pavc, &src->anon_vma_chain, same_vma) { >BTW, do you have the specific test case? So that I could verify my change. The >kernel build test doesn't trigger this. > >Thanks a lot :-) > >On Wed, Oct 09, 2019 at 03:21:11PM -0700, Shakeel Butt wrote: >-- >Wei Yang >Help you, Help me -- Wei Yang Help you, Help me