From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CB692F83AE for ; Wed, 18 Mar 2026 11:05:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773831946; cv=none; b=HYQMEMvRREuAL+3YkbEpm3nBOX7TL+YhJVi6bHFZ29SfR3UYIwPVG3ePJI9+YmALVetRhHb+/CGhQSoB4KrivOoxdA6Mc35dOjzxJ+HuQC3l+NZvvwSw5KcTPbTNjJr/ML/5rF+0Jlm8sx/qXk3nO6bYjGVaJjduprq7zd6tw6M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773831946; c=relaxed/simple; bh=IsYSic/2YA56AaUZG1fD4YzwRZS3rUPak0g4WIt1YCs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=V1EG+7Jul/EAxH4T3NJN9+CYtf7zchGtsi1liEBDyppTjcH5ccKDt8kVjjufc1oi8+XuUFHeaguOAch63WFfIcW0bgjjpEmhvl/i1uw3jhslD/xmYZeYhmXFFS3XGSGQcO1fusCQ7u6VzsW/gmZWx/Z9ogkkafSSoD2Z4r8wgd8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sPdggG2e; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sPdggG2e" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CE09C19421; Wed, 18 Mar 2026 11:05:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773831946; bh=IsYSic/2YA56AaUZG1fD4YzwRZS3rUPak0g4WIt1YCs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sPdggG2eXs0rVAg5czG72B5HUCaYmaM4flqKaqH+K0NoJB4DoibB79ASkAARVjoJx z0Cbx+jxGsCEZk3LJFh9siE33UAp431+hNu8MtCVmCvWm2eCqdcdmGsl77H5v9c8v5 wVYC+ArNh806Jhx+XFj7DmUWxXvAXJzQaToGtjDqimVzAbYQxfA+LDdIVU6BFYQFii zWuCKbMr9oLFsfNeL6BqRO+CbuEhzARndn5WIzx2xgBVzIe64kLlvwIei3OAxdLwqu FML4v/sElabHYqDXjI4lG6JXkx6/GUqVO7mMev5cX3AGUE5d6zP0Ko9eyLJXJAB905 R+JZW3rqjtIxQ== Date: Wed, 18 Mar 2026 11:05:42 +0000 From: "Lorenzo Stoakes (Oracle)" To: "David Hildenbrand (Arm)" Cc: Jiakai Xu , LKML , linux-mm@kvack.org, Liam.Howlett@oracle.com, akpm@linux-foundation.org, harry.yoo@oracle.com, jannh@google.com, lorenzo.stoakes@oracle.com, riel@surriel.com, vbabka@kernel.org Subject: Re: [BUG] WARNING in unlink_anon_vmas() Message-ID: References: <7eb61bf4-5483-43e5-a1b0-87a36cd67b9c@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7eb61bf4-5483-43e5-a1b0-87a36cd67b9c@kernel.org> On Wed, Mar 18, 2026 at 11:57:24AM +0100, David Hildenbrand (Arm) wrote: > On 3/18/26 11:42, Jiakai Xu wrote: > > Hi all, > > Hi, > > > > > While fuzzing the KVM subsystem on RISC-V, I stumbled upon a kernel WARNING > > that triggers in unlink_anon_vmas(). > > > > Looking at the log, this is against 7.0.0-rc2-00014-gc61ec3e8cc5d > > > WARNING: mm/rmap.c:528 at unlink_anon_vmas+0x562/0x768 mm/rmap.c:528 > > unlink_anon_vmas+0x562/0x768 mm/rmap.c:528 > > free_pgtables+0x2a0/0x860 mm/memory.c:427 > > exit_mmap+0x406/0xd14 mm/mmap.c:1314 > > __mmput+0x114/0x3d4 kernel/fork.c:1174 > > mmput+0x74/0x88 kernel/fork.c:1197 > > exit_mm kernel/exit.c:581 [inline] > > do_exit+0x7de/0x2adc kernel/exit.c:959 > > do_group_exit+0xd4/0x26c kernel/exit.c:1112 > > __do_sys_exit_group kernel/exit.c:1123 [inline] > > __se_sys_exit_group kernel/exit.c:1121 [inline] > > __riscv_sys_exit_group+0x4a/0x54 kernel/exit.c:1121 > > syscall_handler+0x94/0x118 arch/riscv/include/asm/syscall.h:112 > > do_trap_ecall_u+0x39e/0x62e arch/riscv/kernel/traps.c:344 > > handle_exception+0x15e/0x16a arch/riscv/kernel/entry.S:232 > > > > I am not an expert in this area and have not done a deep manual analysis. > > > > The full crash log, a reproducer, the kernel .config, and the relevant > > source/commit info are available in my GitHub repository: > > https://github.com/j1akai/temp/tree/main/20260318 > > > > If this turns out to be a real bug and there is anything I can do to help > > with fixing or testing, I am happy to do so. I hope this report is useful > > and sorry for any noise if it has already been addressed. > > > We trigger a VM_WARN_ON, so that's certainly something to resolve. > > Seems to be: > > VM_WARN_ON(anon_vma->num_active_vmas); > > Which was added by > > commit 2555283eb40df89945557273121e9393ef9b542b > Author: Jann Horn > Date: Wed Aug 31 19:06:00 2022 +0200 > > mm/rmap: Fix anon_vma->degree ambiguity leading to double-reuse > > anon_vma->degree tracks the combined number of child anon_vmas and VMAs > that use the anon_vma as their ->anon_vma. I suspect my recent series + some error path is a cause here, investigating! :) > > > > -- > Cheers, > > David Cheers, Lorenzo