[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191010031516.GA5060@richard>
Date: Thu, 10 Oct 2019 11:15:16 +0800
From: Wei Yang <richardw.yang@...ux.intel.com>
To: Wei Yang <richardw.yang@...ux.intel.com>
Cc: Shakeel Butt <shakeelb@...gle.com>, Qian Cai <cai@....pw>,
Andrew Morton <akpm@...ux-foundation.org>,
Konstantin Khlebnikov <khlebnikov@...dex-team.ru>,
Rik van Riel <riel@...riel.com>,
Linux MM <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>,
Heiko Carstens <heiko.carstens@...ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ibm.com>,
linux-s390@...r.kernel.org
Subject: Re: "reuse mergeable anon_vma as parent when fork" causes a crash on
s390
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
Powered by blists - more mailing lists