Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp800638img; Fri, 22 Mar 2019 08:50:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJRWyMVJkV8JPyPMFPbgYcQSWqE1/WEkHNs0K/WsaeXtP9yXFY7KKc1V8DHLiSF9t8Ff7C X-Received: by 2002:a62:59cb:: with SMTP id k72mr10153386pfj.111.1553269847165; Fri, 22 Mar 2019 08:50:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553269847; cv=none; d=google.com; s=arc-20160816; b=YrDjfqc1iaBp6Inh+1YD03bOd4fAydDdf6Td9Dnqrozorb86cTWqrGyufcmvllnutj myk2OgQE+qujS311ad5MzO8hJIcQ/vUlgQbpznR8V21bOlghBJHJ63mzJ7OCqJ+ezgYo HQKJVRTP2LLbX0xCIXnG9dmId4c7d/c936d1NS9Bnq3sxSDMCIyp4ht03mST3ge7jiWe EOfKOWAgTlwrmeUnSV2MMkaULdaePYOIatAP2Q7uZ/IgA4CxtkOWaCi5TlmD42KvE1/e Uhdx8XtSjWKaNAdFELHxl4zQ7kKhimOMeGFTASiDihJknUuw24OpHOed69gN//C5IocK tHTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=IhDNwIOxYiNuMhOLPEts3SuSbShNhJqvzKkXI4ciqCQ=; b=soR/yQWaCCAWrOSDW6qVZXjJ5004XJ4al+8u63QuJgs3/qmJUEJkM2XvjcOUrd2d6w 8kBs6qX6WsjWBIePIffTsa7Ffu+fgfAy05zlxUn9nWtkZXcMDFef2bg5tH598TTtvz52 iK4aripviSAVF2vAZjYCbIIFUzR+ZvQvXuLySxeWorhJW1NKO7FhsBXH2S7wuCJNK5s5 RSOGuie5DCjWBNxAY7040TpyFQ2LFoiCAIURt8arjWP7xzkVYVIno5SH1F2SRVLMW8KT /GoNTbC/rKGQ9gk1Xf2ra2jQFwtvUtIq+cik7kpM15jRy0eki6724N/2xtPTRbH+cWBe frhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e18si6838248pfn.164.2019.03.22.08.50.29; Fri, 22 Mar 2019 08:50:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728091AbfCVPrm (ORCPT + 99 others); Fri, 22 Mar 2019 11:47:42 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:56459 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725981AbfCVPrl (ORCPT ); Fri, 22 Mar 2019 11:47:41 -0400 Received: from wuerfel.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1MPosX-1hKuvq2lZj-00Mtqj; Fri, 22 Mar 2019 16:47:13 +0100 From: Arnd Bergmann To: stable@vger.kernel.org, Andrew Morton , "Kirill A. Shutemov" , Mike Kravetz , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Naoya Horiguchi , Mike Rapoport , Andrey Ryabinin , Kirill Tkhai , Christian Borntraeger , Hugh Dickins Cc: Konstantin Khlebnikov , Vasily Averin , Vlastimil Babka , Linus Torvalds , Arnd Bergmann , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.4.y 12/25] mm/rmap: replace BUG_ON(anon_vma->degree) with VM_WARN_ON Date: Fri, 22 Mar 2019 16:44:03 +0100 Message-Id: <20190322154425.3852517-13-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190322154425.3852517-1-arnd@arndb.de> References: <20190322154425.3852517-1-arnd@arndb.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:x9JLVby8r9r7TUxGTqLadFU79q0Pp1coCzkDeRV4r6c3+Dj8drW w3wZyzmVLkCOYTZj7d1rl88zJZduSJcyDx7T15j+BD/3ifn1JSCjet7XYnM20CaSy6N1FqD 7oLYAODBmF5j39idn1uZOpAtb5Pka75NOa5OilzhmcKHyWFj6CykM7EbL/824ma//x/PSon oX+qL1Ko/GgJFwkbg64yQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Tc+wj3NMZgw=:RU5Wsg8S3mds99gc6a+cXf 24zk4q6XyhTdtuLlc4ogImJLY4QiG24v/yy09Tl/6LHmXdSKfSSz0YHGE29MfuqrdWegfJOkP HARXOKftZgpOMl+c9zVYH0PEzaM8Tif2m3cTj4zkvf1Y2f8q2ma3eHQ+po2nSuoicrIhb9EJS lp2Pe4Ws18R1OVojCdmuEoK4o8x/lOCAkOF4stpcg4PpCzti1AzmQ0ZB5dEcPdRAAhN19JqBv 2qmULxrOYCuIWVcX5tLf5DMlamm5q1llRTPHC2dZkj1fL42dCF8D+NegqIH4gMhOZdqy3dW1l KfFLyp6JOnY9vbztmz3bqyshvyqyogXFd8yivOCzuTmQkItbHHziDVXUR72l0yepI5FAHT4wE clQHva8klOUopNyxz6rK45XmcYuZXe3BgbEfyVqT8H0F1z+0upYceQcNDsgGo/Pnk0L88JPj/ Q2M3FiuLkzN2pXg9ZshcAprVQytMU19AeN8vxAbJ0rbeESp42ZovYrdku5j+ozGN2tMGaGUXY FOdw5kl+ItdZaAy1Bn1RgeiSc0nKsNTkaxQaYJyyOFfjJnJDqun+X2FYIxzQBKspWyKBjRYZn qLA9ma6JXewR4OR+icxH2Dbq/A78inl8+s0rTxu7gP20oapeMz6R5ZkijTrjybWV8mDLCjzUL EBDekinZo6eUHBS6RGHjAtXh0h5mDJ6BaWPIBuiDTr2iAAMkUf3mcAXwwLWLggKUf5zWJzuFQ BEzDhhnnoHNiCvGc7jkiDMBXH3aSJW+lLtm8aA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Konstantin Khlebnikov This check effectively catches anon vma hierarchy inconsistence and some vma corruptions. It was effective for catching corner cases in anon vma reusing logic. For now this code seems stable so check could be hidden under CONFIG_DEBUG_VM and replaced with WARN because it's not so fatal. Signed-off-by: Konstantin Khlebnikov Suggested-by: Vasily Averin Acked-by: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds (cherry picked from commit e4c5800a3991f0c6a766983535dfc10d51802cf6) Signed-off-by: Arnd Bergmann --- mm/rmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/rmap.c b/mm/rmap.c index 488dda209431..cf733fab230f 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -408,7 +408,7 @@ void unlink_anon_vmas(struct vm_area_struct *vma) list_for_each_entry_safe(avc, next, &vma->anon_vma_chain, same_vma) { struct anon_vma *anon_vma = avc->anon_vma; - BUG_ON(anon_vma->degree); + VM_WARN_ON(anon_vma->degree); put_anon_vma(anon_vma); list_del(&avc->same_vma); -- 2.20.0