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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 602AFEB64DD for ; Sun, 16 Jul 2023 15:06:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E8B516B0074; Sun, 16 Jul 2023 11:06:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E3C8A6B0075; Sun, 16 Jul 2023 11:06:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D039E8D0001; Sun, 16 Jul 2023 11:06:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id B7D406B0074 for ; Sun, 16 Jul 2023 11:06:18 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 82C561601E7 for ; Sun, 16 Jul 2023 15:06:18 +0000 (UTC) X-FDA: 81017800836.19.B568730 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf04.hostedemail.com (Postfix) with ESMTP id D71D540014 for ; Sun, 16 Jul 2023 15:06:16 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=HtnbhBwa; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf04.hostedemail.com: domain of gregkh@linuxfoundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689519976; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ly6YE7Y3WmpNHWVE5aZ6L7fTJi2gzZrYvx+3PHNg8HE=; b=dpz1cEabRvzig+gd/0j0qQ3647n2yhEIObesyjWAAQ5QjkbxlyGEsvyHrTYEIeUrtsm8Tp cgjI2M4DdPjplb56+D68EAmZA6IdaexQwWx2X+xAyNr4i8AxsJAXG0QC20+cpZzdace4qx X5LOAIAdjeNKMW1RV15FUqae2/dG9ew= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=HtnbhBwa; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf04.hostedemail.com: domain of gregkh@linuxfoundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689519976; a=rsa-sha256; cv=none; b=bPdYpZURBaEiiSY+R9/buIyJP1/r/97lUp1KDvY0Eu7pSuo+fVnfWgYAw8RLJCfmDGG+1R Fc+6PLAAU4PtIZ4vW4c2UN0y50kDnSXd1b21Pq2UcIqBJffJ152xq5HCMF7outN6EyOf1Z hsvKYwy7d6HU9vNX8SZTBndB2csPg34= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 11ECF60CEC; Sun, 16 Jul 2023 15:06:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23F31C433C7; Sun, 16 Jul 2023 15:06:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689519975; bh=IR4VJUVgvUH9MEJ1EN/3YsW9iPepl4lBBHAiODrzKoo=; h=Date:From:To:Subject:References:In-Reply-To:From; b=HtnbhBwaQVq8X0kSAvZYMpIQb8X9kWIhwiCzbxRTftNGKxp4oJIvg5xLXcxvz5lhJ OeBlJiJVTIT/VNswZkuPAZh3OZESCWpbLh6OFahfZu4ByE17kBapZotVSmsJsZOl+b D825hzkzKQVs5OV6FRnfBvbC+vyF3lUanM44A0Dw= Date: Sun, 16 Jul 2023 17:05:17 +0200 From: Greg KH To: "Liam R. Howlett" , linux-kernel@vger.kernel.org, Andrew Morton , John Hsu , stable@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH stable v6.1] mm/mmap: Fix extra maple tree write Message-ID: <2023071609-outdated-hydrant-f9ec@gregkh> References: <20230706185135.2235532-1-Liam.Howlett@oracle.com> <2023070748-confiding-abnormal-b7e3@gregkh> <20230707164507.mfekysya2jyupghp@revolver> <20230712005442.r5ehzbkcxu73whvb@revolver> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230712005442.r5ehzbkcxu73whvb@revolver> X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: D71D540014 X-Stat-Signature: od6if9f1bh7gemwccnhcbuheym8ah5qx X-HE-Tag: 1689519976-133947 X-HE-Meta: U2FsdGVkX1+eheXWTd/GArtnzxrTuX201FBktZR3OzIzE9QLF0qT6FqCk6ZUFBJgqnQRGivMuxtWjmiB43Q4Axgs/TVFjQ/a2Tt0nAxmpkgrZ+iYErDobYJUDvvdhR7jG9CejM+ihEiDhxUbUetKXd30KCRkX+7Km/Ko68CM6gdqQ3yxAMIroiUz5E8uQzmOag42j3UjuEex9Xl4jowkPOzzWqBIAbQWYHhCAD+vyqbQweUYMHGd88fFgGTDcCXdVC8PJuY7A3rBt9wLjL2FA2c2C9MaqJ6Y6Q2frxb+Tkfiuf+4Yh50O84rpVCKzpzvuPwNJCFvZWNCr0u6EKAuaxxIsvy6Eh6iRW7FCtEAPF0pISIZB4J+luqEq1FC5L2Ay5xr1jDNY+xWSLu7YaKP/Bz/p1lGbtaY9hDb/Wn2Q12EeD1aPIzMvKIwOUzxW8Tu/xs8VGCCtoXPKxwnnMWeBeMFkpPGuHD7dzg2k60vpO3/zaK2iJTogXS/3OzjP4UqLZjKlJb/JkkKJledQbANzoMxRVGMMfOsCd5zZz+qdCse53oIT+mxzvI+4hxWR8a5wWzH9jQdzsXvj0A2hzUcy8HIVFEzXDQ6tFjDyzzjCWeBj6Ea5jr6edrBt/axcE2tq/BbDcXgeetPgqayoPfhX9+OI+AxSMunOczffOdlClkf50uxUcawFT3r4PHkSh6uJFj/w8UjXnqH2yLFywhXC+AEgQekweBPwYvc4j/Zk0Muxi2p4iK+zXEhsrjv06DjPp1WmEPPoEseFrzWTAFYJ2OBitSV/a2/4UHUdTgqQPLu/YvHbk/LhLPs2/c7b0QGldBTLqfBSV7681+azwo/wIY9B6jJobgGNsdFaY0CO+nR0YMwpkiT8bge3JZ3Qk6phsX81BonGxHNWkSMU6GKFytJK5L+SBp/LYgLJziqSr20AesSiQY+NHvsQF7GntSYUFkTKwK9T71YGpiL7Sx gOtIYhS4 kqgYP42XaFNNOS3N/vi4+zXJ1NAJ1Y7pHjKlngjFuthvhXEzPNIUtvxpwM37WbsWqnpkzUGZx/QGcNCkU298DB4hAps7t59VVQDGhaOurDGdPidmTX8IEP6H9+bn87tFeRNfO6rZ+0pJmY6jyOAQSPKs4RI3VJVtc6cF4Ou3bBAjaWCq7q1Q4Jp7lma/9CVn2MwCGaIJ5gKabhU6FCgFhnj95s/wGDCvAQPRnj5G+Gewtmuz0zRgS+rSoJviSxuT1Pc3GrQI8AQCQLrtEblkPOOC0djh1boTJymoYljan8j90+tSi8YtQ7+val1gFY08tpn7fptRAeXyuAgqf9pNl1luhoBxGy3Kw8WCvEcxj0SC8badq8KEjRSVRJoNSBnGkMQG8 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 Tue, Jul 11, 2023 at 08:54:42PM -0400, Liam R. Howlett wrote: > * Liam R. Howlett [230707 12:45]: > > * Greg KH [230707 11:55]: > > > On Thu, Jul 06, 2023 at 02:51:35PM -0400, Liam R. Howlett wrote: > > > > commit 0503ea8f5ba73eb3ab13a81c1eefbaf51405385a upstream. > > > > > > > > This was inadvertently fixed during the removal of __vma_adjust(). > > > > > > > > When __vma_adjust() is adjusting next with a negative value (pushing > > > > vma->vm_end lower), there would be two writes to the maple tree. The > > > > first write is unnecessary and uses all allocated nodes in the maple > > > > state. The second write is necessary but will need to allocate nodes > > > > since the first write has used the allocated nodes. This may be a > > > > problem as it may not be safe to allocate at this time, such as a low > > > > memory situation. Fix the issue by avoiding the first write and only > > > > write the adjusted "next" VMA. > > > > > > Are you sure this is the same git id? The one you reference above is > > > _VERY_ different from your 2 line change below. > > > > > > And the changelog text is not the same. > > > > Yes, but I am not sure I've indicated what happened correctly. > > > > The bug exists in the older __vma_adjust() function, but I removed > > __vma_adjust() and inadvertently fixed the bug. So the bug doesn't > > exist upstream *because* of that commit: > > > > 0503ea8f5ba7 ("mm/mmap: remove __vma_adjust()") > > > > My comment after the commit id indicates what happened, but the > > documentation wasn't clear to me on how to specify what happened. > > > > Does this answer your question? > > Friendly ping on this one? Now queued up, thanks. greg k-h