Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp640571rdb; Fri, 6 Oct 2023 14:08:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEkjY/urV/09TuP6b1DovqGJxGWb7+jwzZ3cfiOykKPllN+osujpp98+YPqSfzPylim299C X-Received: by 2002:a05:6870:7196:b0:1d6:7f77:c922 with SMTP id d22-20020a056870719600b001d67f77c922mr10271773oah.28.1696626533748; Fri, 06 Oct 2023 14:08:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696626533; cv=none; d=google.com; s=arc-20160816; b=RsxJf51SqFyq0cbLYmLtuaVA52PZH35S7wSCqUaFVOq9E+UbzZHtjS3SlBlm/aTsPo Zgaa6NFwRAWI4BUjpi5NLR1sxeJLjqB4TMkGgBiPVHcpvU0ou3lCcBMkjtwvuC5q4+Ac 5ydJ0N0DQlsZVLmKl9OAvhTuVxkE8jwBEzagdqo5hewdrTQSGnZxLpjJJr7y9rm6LjQ6 dUH1/ToQbBoWSU8Pyr3n37EvieiBAXhEYFwLQ1aBlzKKFhPfT20QGswoccEUUwJC4do2 90vDpIFvXX0zyi2fwTfBzUBDr8u54ArJ2QaeeKwRWb5XvAwx4UAhp4IKRgRRQi+2/oVn 9wPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=e6F7cGvBpwGU9Yz82K3RACDJqvDAlfzAXpJFt8LKedc=; fh=X5imizxMjWD3JPhoO3TNckL+TAZO21z19EZWJdBsQjg=; b=BUn2LissXZY9g7Q4WzOGScWUnhylgLJHqrXbq7jDFryNu3Zwta4/Co6gW9xBfVVRWF bUNkRTX6V4poiWmpYXCPWVBKqshIfqvTorH8tEgAJI1J5HS7gb+iatKeNEWDRv4vLaER ug5+iWdJJ1rDd7C05xoFytu5Gr/iSqJbsRFJrdJnyPvO+qW2VFlx52JKoLEualb/R2T+ pxihMriMlQ/MpG8TACjUOLGBy0psuNtC3jfsbxSBQMazIZKtaaNcPp3k0Sk2AOiz3Rcx eCSFTmxLSRnnSeGMoSfnt30Ew7H1hnTUTv1zZpm6PKquTF8bGRG0PFudkSJfgQx3gbUa 0OlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=nYSvxJye; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id j13-20020a63cf0d000000b005704979833csi4255499pgg.855.2023.10.06.14.08.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 14:08:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=nYSvxJye; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id B86B282CD432; Fri, 6 Oct 2023 14:08:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233624AbjJFVIl (ORCPT + 99 others); Fri, 6 Oct 2023 17:08:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233587AbjJFVIj (ORCPT ); Fri, 6 Oct 2023 17:08:39 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D259BE; Fri, 6 Oct 2023 14:08:39 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EE07C433C7; Fri, 6 Oct 2023 21:08:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1696626518; bh=9BZJKDvYId5mTUI/VJ4lTfM8ilKtayFSoGbiLtqREq0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nYSvxJyec3IzHIU6njiyA9wPXgtaeINBNOahtcTtBy9+2BT8dPfyxfbLnT1/krQks 9bwzY9MoB2+3vdaH94yQsrezbRC1C2xKLTOHrlZBTSE6si1q1G+T0x8rU1a5rpGh9z QWIZna64U8bKGxeKGJKvJvq4f9Lt9hCpOQ5E1/ok= Date: Fri, 6 Oct 2023 14:08:34 -0700 From: Andrew Morton To: Suren Baghdasaryan Cc: "Liam R. Howlett" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Jann Horn , Lorenzo Stoakes , Vlastimil Babka , Matthew Wilcox , stable@vger.kernel.org Subject: Re: [PATCH v3 2/3] mmap: Fix error paths with dup_anon_vma() Message-Id: <20231006140834.07110f7008677c646af1694d@linux-foundation.org> In-Reply-To: References: <20230929183041.2835469-1-Liam.Howlett@oracle.com> <20230929183041.2835469-3-Liam.Howlett@oracle.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Fri, 06 Oct 2023 14:08:50 -0700 (PDT) On Tue, 3 Oct 2023 09:21:22 -0700 Suren Baghdasaryan wrote: > > @@ -633,7 +641,7 @@ int vma_expand(struct vma_iterator *vmi, struct vm_area_struct *vma, > > > > remove_next = true; > > vma_start_write(next); > > - ret = dup_anon_vma(vma, next); > > + ret = dup_anon_vma(vma, next, &anon_dup); > > if (ret) > > return ret; > > Shouldn't the above be changed to a "goto nomem" instead of "return ret" ? It looks OK to me as-is - dup_anon_vma() leaves anon_dup==NULL when it returns error.