Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp649815rdb; Fri, 6 Oct 2023 14:32:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFR/YkTjdezS8sCvI6Vp/xrBVY7C8U/ITDAbJs7xSOnXQP7S913R7VKOkbRDT0Or2ZOZOcc X-Received: by 2002:a05:6358:33a4:b0:151:ac8d:bfe7 with SMTP id i36-20020a05635833a400b00151ac8dbfe7mr10606143rwd.22.1696627966314; Fri, 06 Oct 2023 14:32:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696627966; cv=none; d=google.com; s=arc-20160816; b=ssEHJY17W5FyVbSKZ3y/seb9jFnM4Oo/fQQtxLOSXCCYqw1rWjD31p/xKTiA6PWRZa 33SRpCnhARGhks1HMdzmIcM7smHFPyLrwdvfdnVR31UAyjUgXKGgKIKxmBdE4OO9LI68 UYzego8BmEf6lAq1yGFY9KM418a0C1uz9D6BvY0zfcG2WZXkeXyfM+yKGi5LAr8brmFG 57ABn5FvRn7x6gpjbG4ekUhsa7XcaW7Gb9vZH9AKDp4iBeUSaVQ21ZuqSnr0Frx2zblc BOM7viFzUNjKbbjGEsi3/tWP9Lv6K9vqRrFFWltO5q408TjFMNRz4Ee9GQau/vdClskq SI7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=n7nhNrrcEioXD0TPvV1pN7kd7gJMiVym43CUY/dMMZM=; fh=L59QPe5/MyR2T+xmIwFAjkeNX4zYnl5JePxZjib7Zx0=; b=PbT8STHUT8NYR5PhCzQhasM/H2C7KUI9tZTIJ+DqYovJiEvyBYhenDPxCxlbtGkqyO MtfbBl4ZqeMU/mHwW7g9eEvRzobHhN9Xh9ZMdrELsaDKPOFaSnwFC1yneSrQ5D7rmevr dCkwXMXoS8qyzYkA/y/uZHc+EK1mWxNmFQy6rvTJ9WfhfRD5W8Ka+IcdIy7Xcy6aFu6m vwec9a5NXNvPcCBylmIQHszNwJ6lGiUSTq+71ZiwqVbeERrfzj7BfBngkmpogW9FWO5c 7E4pJ4NB3iblmuZjKw3zfKao5hkS3tapfm2e7AbASj8AxudcBVtDojjZGuWwmE9zaywC vHqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=wDuI+2jc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id g67-20020a636b46000000b0057c2f614756si4367331pgc.212.2023.10.06.14.32.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 14:32:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=wDuI+2jc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id D503F80C60C1; Fri, 6 Oct 2023 14:32:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233504AbjJFVcd (ORCPT + 99 others); Fri, 6 Oct 2023 17:32:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233321AbjJFVcc (ORCPT ); Fri, 6 Oct 2023 17:32:32 -0400 Received: from mail-yw1-x112f.google.com (mail-yw1-x112f.google.com [IPv6:2607:f8b0:4864:20::112f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AAD7BD for ; Fri, 6 Oct 2023 14:32:30 -0700 (PDT) Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-59f7cc71e2eso32696897b3.0 for ; Fri, 06 Oct 2023 14:32:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696627949; x=1697232749; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=n7nhNrrcEioXD0TPvV1pN7kd7gJMiVym43CUY/dMMZM=; b=wDuI+2jcAn3wsh7XgXl6U2TkZx5jEf2Hmi0273zvlD0pNffroaL6zS5hld1Z1iQU7I NImuZCJfXtaC7rEWg78JT49wfoe74p0WdlCdwMnrqOA5ZmA2FMU3TM6kaKrQ8srrkxCn R0HtMiEdstP6RW77watFRzEpFpj/VcU68S4m0xMCGWuAtmT9TwVhcZDbu7vQk/ugs9bT 4bXBqw55OWvFkixdyTB0xWrUU+h//lWi/+LpTI8XBgRrQ1Z3WEDh04zPnjxErS/2X5q5 gstDZXSr+NGcrvxRm/K00yCawMlKE+oEYYsDP0SJ50AyvVLQgT69dIJrAGglGySAlBQ+ pFbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696627949; x=1697232749; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n7nhNrrcEioXD0TPvV1pN7kd7gJMiVym43CUY/dMMZM=; b=c97273zrNSZGhSKb/PctjDeO9NYcnXn4EMSC8xEvJ0lxrxreVuZ1Ps1oHsJk9CBUr9 ACa8rvhpkJ5Ip2KvwdQl318eo+hNSzjl8xwELmM9q7X7xOl0pNZ5PasdzUqXYlNwIyhd pg2XolLtm5VyWeGH42GqAHUwEHQxFdpxw1nau3kQNcA2kJpbLZ4Zn2JCQ5OVezXRYDYv O3xLk0TLiApuPCh1TcvwbuEcKXBrpt1AmLRuJ6EOeK6HMhnMRRt0QDWdRFZrGL67fKiE FQvCqUmPv8RvDNoZPW7yzebUJPROMZ4haVv2HQa76yFE4w0Zlft46mr3uFDe0QvIdJ0q 2mfA== X-Gm-Message-State: AOJu0YxfjbCech9wEIFdf2DE5dPlCVfUPjpg0OZoI9eXEbRSdjDsiL33 FeMfwUg1KvYKFmoHECTUDhuc750sKAUPDvQtBXISTw== X-Received: by 2002:a81:8494:0:b0:59f:728b:ac0f with SMTP id u142-20020a818494000000b0059f728bac0fmr9816573ywf.6.1696627949389; Fri, 06 Oct 2023 14:32:29 -0700 (PDT) MIME-Version: 1.0 References: <20230929183041.2835469-1-Liam.Howlett@oracle.com> <20230929183041.2835469-3-Liam.Howlett@oracle.com> <20231006140834.07110f7008677c646af1694d@linux-foundation.org> In-Reply-To: <20231006140834.07110f7008677c646af1694d@linux-foundation.org> From: Suren Baghdasaryan Date: Fri, 6 Oct 2023 14:32:16 -0700 Message-ID: Subject: Re: [PATCH v3 2/3] mmap: Fix error paths with dup_anon_vma() To: Andrew Morton 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.8 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 06 Oct 2023 14:32:44 -0700 (PDT) On Fri, Oct 6, 2023 at 2:08=E2=80=AFPM Andrew Morton wrote: > > On Tue, 3 Oct 2023 09:21:22 -0700 Suren Baghdasaryan = wrote: > > > > @@ -633,7 +641,7 @@ int vma_expand(struct vma_iterator *vmi, struct v= m_area_struct *vma, > > > > > > remove_next =3D true; > > > vma_start_write(next); > > > - ret =3D dup_anon_vma(vma, next); > > > + ret =3D 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=3D=3DNULL > when it returns error. Yes, I realised that after sending the question and didn't want to create more noise than I already did... All seems good.