Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1318302rdb; Mon, 2 Oct 2023 06:14:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVKxVE6XWWkt/RMKJzw15WUqd37Lg3BLJNhM8JXrTUnaRG6vzkNNobdPNjifgEWOFN5+8P X-Received: by 2002:a05:6870:f10d:b0:1d5:40df:8fb1 with SMTP id k13-20020a056870f10d00b001d540df8fb1mr14328178oac.19.1696252464685; Mon, 02 Oct 2023 06:14:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696252464; cv=none; d=google.com; s=arc-20160816; b=XjantW+SVDjBMRk06/ugnWRhxOqlU9t91EigNhSykU0VnvJ29mLrM+lH7nJ4qaqh5V yXiHo976oVQGLPYgVNrScdvmceD5Q8dRYF13w2HRsUH9wIMK7tpt6k/nZtYiwBtruodf /MMs8Z/2FIVR0MTtmq21bfmnmCEKRl6lF5J+Qf1e4O9FSeBJStORpoVPl6nvwXTW18jt 0jGggxKI9fNIxSVaue/u/TA1aLwq8Y7s5kfXCvq9v75bmo2A2RPYn4JNJjB0cIF0mXYm 9LaoqHinX5TIVwaE7S3bnAUdp0/XlXzCgEkINx8ZJ+ETIURPwCRiudvJ8zsyvMSubYvo ka9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=P0mFFbYawjhHJI/MVnVhD7eJbJDMhTOVCb9gruMN8Mo=; fh=6M5ep/xA7byG41PvLXc6skGUTVKf7xR0ukeVPSqrBrI=; b=K8JVJ7qGU2RYre6/RojS7dELuQn2uY8S/zy6t1zDtIpl75QKvEDAep5Gs97lAlrFoU Fhjeu9V2eFlfB1I7NsXXlOFUAsanDKkZ/+UUuGsIDrxPig9wKQUHDTArXZ3gbhZSmiJt neNmt0pu4ElPrTKU+NQNnIhmVz4Dsu5m6mmaPVJPCTDZiJ4vhR/us+RoAvKlO259Z+WS sJefn4gByk4SmlCjzi1NkBuZE9gXxstEifTwtsaysuiUozG31nXuDPrOPnljY6AnMkjk 3J/k7YiACMFeyOG+mdSNfWJt+57fg0JRydoOba78DihAFhQ0MhCBYvodoM9UwcSYZ95c xX3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=rZ41UYqh; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=DQliiCU2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id y127-20020a636485000000b00578d6a88716si27553453pgb.3.2023.10.02.06.14.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 06:14:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=rZ41UYqh; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=DQliiCU2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 4AC32807451F; Mon, 2 Oct 2023 00:11:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235688AbjJBHLI (ORCPT + 99 others); Mon, 2 Oct 2023 03:11:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235684AbjJBHLH (ORCPT ); Mon, 2 Oct 2023 03:11:07 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEBEA8E; Mon, 2 Oct 2023 00:11:04 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 6FEE721853; Mon, 2 Oct 2023 07:11:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1696230663; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P0mFFbYawjhHJI/MVnVhD7eJbJDMhTOVCb9gruMN8Mo=; b=rZ41UYqhrcd8ECadWlH8Rnkr1zEiqXt/hPInCf1O+E1azyx6hnKeUVA/wA+GuapSurfKUh 7WUFXtgDl/vzNsccAXHBHzWdSSvwmL4ym+VTsa+3SOJ+F4p3YxIl2P3TfNa1NDqPw0lLhm 0VskMfhMVK4SE874zL7qR0Rh243XBwU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1696230663; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P0mFFbYawjhHJI/MVnVhD7eJbJDMhTOVCb9gruMN8Mo=; b=DQliiCU2cteEMe2Lt8fetDwWqgRgcP4yttY4lh4VwuGdtOu/Z8M9Jw0aPGS1KUKZjDfTOt WPrkUfC86Yh+JtCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4E40F13456; Mon, 2 Oct 2023 07:11:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Rc9uEgdtGmVKeQAAMHmgww (envelope-from ); Mon, 02 Oct 2023 07:11:03 +0000 Message-ID: Date: Mon, 2 Oct 2023 09:11:02 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v3 2/3] mmap: Fix error paths with dup_anon_vma() Content-Language: en-US To: "Liam R. Howlett" , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Jann Horn , Lorenzo Stoakes , Suren Baghdasaryan , Matthew Wilcox , stable@vger.kernel.org References: <20230929183041.2835469-1-Liam.Howlett@oracle.com> <20230929183041.2835469-3-Liam.Howlett@oracle.com> From: Vlastimil Babka In-Reply-To: <20230929183041.2835469-3-Liam.Howlett@oracle.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 00:11:09 -0700 (PDT) On 9/29/23 20:30, Liam R. Howlett wrote: > When the calling function fails after the dup_anon_vma(), the > duplication of the anon_vma is not being undone. Add the necessary > unlink_anon_vma() call to the error paths that are missing them. > > This issue showed up during inspection of the error path in vma_merge() > for an unrelated vma iterator issue. > > Users may experience increased memory usage, which may be problematic as > the failure would likely be caused by a low memory situation. > > Fixes: d4af56c5c7c6 ("mm: start tracking VMAs with maple tree") > Cc: stable@vger.kernel.org > Cc: Jann Horn > Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka