Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19218828rwd; Wed, 28 Jun 2023 06:40:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Mmd0DDemZVgMN34D8N/n2IL0mwzYY+hiX7929TrBXSlgwbv+jKdc0InS04rpOT94YDAqs X-Received: by 2002:a17:902:d50f:b0:1b8:2c2a:962e with SMTP id b15-20020a170902d50f00b001b82c2a962emr4180029plg.33.1687959647314; Wed, 28 Jun 2023 06:40:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687959647; cv=pass; d=google.com; s=arc-20160816; b=e7+qxsNK+gpcoDkQ07Yvl2XpFsoTBsLOkaErjHiGq0ixkYfriibDcXDzz8w3MLKNLg UGa25TPNRjVLweZsG9PpEy+TQWFvMZBrviDdvUPp+blA8oUTZNHDagO4yh3MN4HXHgqH XRHCtXNrvxUQj5L0g5lOq748ESGw9UYFux6OqJbhjXVOsDXdNX/Jr7qXWCFOlMrHAxn+ +LPrCdGb0H9iAgtUh33vnM7w/7HCLsXAfi8VcLJu6TgTppgG7vUSOSF088+VnGihXIxg 1AxgeNpbwE68G3Rh4iAjuVXALy58My/LrtKZLFFE1UbkfIK2CgePia22HpAznPJdYPs3 b8eA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:in-reply-to :content-transfer-encoding:content-disposition:references :mail-followup-to:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=B3eUvsReXW5f2NLzpJqQAokxwIYjjhyvH6LecC8+WWQ=; fh=KbKlFpgKv0XhSRQpLHskjngXJwTwtbzI7KFMEPvbnkw=; b=rrDCq1QykjJTCfSwslQodeEkr2C6k5sNc5xb/PtIcpeWNsF+l4bcQbZm90pwdsC1up 8kHCfX1rKS+PodL+yRQgX0xC0B/mriW9t6+t8AuBPczZsmHJ7qveGGoa6bgn8kq9ApfO AGor15agGvQSlgJDWAVFZfw7qHIUHZ60zUm1z2T7l/ot9m3l8WAkz6EmIuS3m9PEJa7z 9FxT3fxFLSdc9Jqwr16gLh5YECkFbCy6aBdCcCZX/N6l+V0AdQDBe/hce8DFYtBAmCq/ eEIXH7FoFSUPD9pHvKowKmCxgTv8JhTqh1igyefVnyusBc6bbD/CoAm2nxOj1xDdjRjK xhYA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=i9WNRjoG; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=KAP2pDwc; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l15-20020a170903120f00b001b51ff840fcsi9798241plh.456.2023.06.28.06.40.27; Wed, 28 Jun 2023 06:40:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=i9WNRjoG; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=KAP2pDwc; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231264AbjF1NN4 (ORCPT + 99 others); Wed, 28 Jun 2023 09:13:56 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:13162 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231235AbjF1NNx (ORCPT ); Wed, 28 Jun 2023 09:13:53 -0400 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35SBTKYs011269; Wed, 28 Jun 2023 13:13:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : content-type : content-transfer-encoding : in-reply-to : mime-version; s=corp-2023-03-30; bh=B3eUvsReXW5f2NLzpJqQAokxwIYjjhyvH6LecC8+WWQ=; b=i9WNRjoG6JUrhduebQH9diDUh1bdEem1Yl6rZCNjzbFZ/PLn90/wldzhT9uQ2eNvZ4Tu +faxeZ9ld/Iu5oXOw1YsZNW51kv7aHXr7ODYbLd+zPkZ+536MAToOiuRhnAjZQEGu8ep zpXS5JdDIdoejPp8RqIYgqw5NeVfIS08B1HCchu1+PQY7xMEfqh8m53QHgHQu0fCKFSR JKvRRepGpwKlJ4VvM0cYiq4BM4/djHN0/U3flcgQF6Ea2q6z/+RdFv2u8hNA8jakzEak FeIOHHb9MLsfTqt/TgUGD1sHX8HTuhBxw8v77ukadS4kqQVSqMWcEO7z9ip9SinJeF9d Iw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rds1u7c68-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Jun 2023 13:13:39 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 35SBbZfd038205; Wed, 28 Jun 2023 13:13:37 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2171.outbound.protection.outlook.com [104.47.55.171]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3rdpxcgfjp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Jun 2023 13:13:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ClbdkqSXOW9XQ6gq0r6M1k9v1nvazreSfizMzk7kOwMAZ9/o9PbthsWwg9cqh4kK3Bx4zF/S8RS5Vmr1oPfAZ9qmGpEPQ+grnlj5w+xxjoRYptoEzCsQbK9nDy7/CIN361H0LF9t40qzRlHSBMLAbalrmJEtFfY9b8g+uaaJ+xq2PkQwV7+RRWBICAdMAo15d0IXRtin9O7yjRTJxfX3phNckvpU8s4R7w0PYbyS/tDd4q/Hb7jkW2JY192JZo2m+qY7VOiIHpwwLujk043eVWvWSpjO8WvLQ05Lhz8cwg3SBzanwWpev2zUxEsoA2+BcAKvcx+W6WQ0bi197reppg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=B3eUvsReXW5f2NLzpJqQAokxwIYjjhyvH6LecC8+WWQ=; b=LqmhgLM6KKIm3znn1q7pvdHz48uYkAV2VerCRb/gsLjOUhFnwPsx3Dub9mkZX+pD4aaH44Yz/3sWv/+VxC5T/fLBrAjMzWCJdZo4dQSvTUgAqjwdwV2bq/6JvxNNmP5p+ea3nFqm+lfGBR0mS4iw+jmA8QK75ylRZD8v2suWCpIx3ducsj+GhT2Bzvr7V+/43ihsL+lCEpix8hA4Z/RO9Nrfnt3SRNhYSOhf9BoqMZ/9qQZmYRDlnCZN7jFJJYpgZ5ZV/bKO2gyXZ0XdMBMzo6raebnj0TfhPAIaSBi2tM+SAE1GbcyZ+X/hcY162gL6y1e7sGQUDQCFqcltOvrJEQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B3eUvsReXW5f2NLzpJqQAokxwIYjjhyvH6LecC8+WWQ=; b=KAP2pDwcfdQnn/aHTTO6zIpOQIqjbN1PtIBqEVAsKxQ0pQwnpVSCJIdF+/bVNhprX7Dud8LqjduVt1+HLGQ+aYChFEkFU8EQZ0a0STIR2V3XBbEiSJxB2dSQWO+O1y/hUSFNdXaCzpAOAf1VnEDgXpBKDrc17LnsHxDUrLgJ7Wg= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by IA1PR10MB7472.namprd10.prod.outlook.com (2603:10b6:208:454::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 13:13:33 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6521.024; Wed, 28 Jun 2023 13:13:33 +0000 Date: Wed, 28 Jun 2023 09:13:30 -0400 From: "Liam R. Howlett" To: David Woodhouse Cc: Linus Torvalds , Vegard Nossum , Andrew Morton , "linux-mm@kvack.org" , linux-kernel Subject: Re: [PATCH] mm/mmap: Fix error return in do_vmi_align_munmap() Message-ID: <20230628131330.ufrp57vnfpynlapq@revolver> Mail-Followup-To: "Liam R. Howlett" , David Woodhouse , Linus Torvalds , Vegard Nossum , Andrew Morton , "linux-mm@kvack.org" , linux-kernel References: Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: User-Agent: NeoMutt/20220429 X-ClientProxiedBy: YT4PR01CA0400.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:108::10) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|IA1PR10MB7472:EE_ X-MS-Office365-Filtering-Correlation-Id: 7626e85d-359d-40e1-410a-08db77d979b0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SkjNjXupBVsq2SkGXUvzGk1rOwEfN1oQ2Gfj/TrKn8HtlQuA+jYlbN7R86PJEiM0u8EqQC4523qKwBmQD4Q15+TFnMZavR4Mg7D1BkqR3MzJycIz/yy0KrFTBZPj+y9N8uDDJZb88UyzLsSR+ukdbrkPqr1sx2J4y499i2Z+FokKcxMR0z8bpfn3CSPFcLndM/4FdGGYPaXfrEO9yy9JwvW4suWBwBS/eA5rzz1mJGquKIyUi/5SJ/BkcU7XsgGp0EDCyOLn0L70rGk4pbe3swvK4Y/CmbXqu4YiKgS6w4qGfGZrSieoRePSz6C1n5CvY7jTNNwqKvdE3UYx0CKdJMuHKrCyFB63oQeqIQtojyKcZ7aMP0Jlv6I4IlRxFdxmRW+QjgS9sN+AjpBedKZW813n56mccJJfPXa7zDqGhCnggN3jrnXyJGGI+NsRcyc0G5HasYA5PjzJsHEDZGI8wQagPJZcDvzA3RS9tBReOOkLeNbXDDREVDaoMNrbWhtxhIOqkKCpud99iCesknohyGOxbNz7//Ptg2GRPqC9U2g036kv6jwDs1hzPJR+sZ/+ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(7916004)(39860400002)(366004)(396003)(346002)(136003)(376002)(451199021)(6512007)(33716001)(6916009)(66556008)(4326008)(8936002)(66946007)(8676002)(41300700001)(66476007)(86362001)(316002)(38100700002)(5660300002)(9686003)(1076003)(186003)(6506007)(2906002)(26005)(6486002)(83380400001)(54906003)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MVU2OGhQWkhhNkg2M1VvSllydTR4V1BUTzV5cVdGZXp6NmIrMHhQdzh0bDYz?= =?utf-8?B?cDJ4NWtNcUN6VzBrQ1ROcHFQbkhYM0R4NFZpWXFPY0ZaOXRmM3d5Q1kvbmEr?= =?utf-8?B?Y2M4SjdFczZMNTN3aGF6UFNlOGV5eW8weUhvb2JpQ242V0NyRlErVzJub2lq?= =?utf-8?B?bHg4UDh6ZDI0WmgyYnJrUDBFY1h3aTBVcjU1VWovQStwOVhZaXFIQ1lWRWxF?= =?utf-8?B?Q0cyeW1FdWgzMVV4ZXZ0VmI3Njh2MkROWGZwajd6MktBdkk3RW5iS254UzhY?= =?utf-8?B?eTJsVU9mck01LzRYNGpEd1ZVaUdiZlZBdXEvWFpqRTlKaTk3WFlTdlVMZXMx?= =?utf-8?B?V1BCWW1pY1ZvYlVQeFZ4bGlxWEVBUWpSVEtYWmp1U2I4MGNVb1Z2UWRFeTF0?= =?utf-8?B?K2FmZWJkY2pEL2t5VXUxamQ2MkUwL3VFVzh5Ni82MUxUa0cvWVdjZ2tCUmxt?= =?utf-8?B?VVJ6bW9UcFFEUmMyZGo4RUZ0TDIwSUo1TGZ0VmdVUjNKeHlGaiswVC9Da0Zl?= =?utf-8?B?N0Y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i0+NwRGhHe8T/HuWp6aO8vgKi/w93IqADnzqi8BJBmmM2xpmykM8Yz8eJ7SULwbRvOa8ivdoSs7HQmQz+0/oB0okcn9gtQ0NjdCZwlt1uNQX5sCD6JXgDXjTgPNuNj/hl2+5pHMsoQsAgOjlfU8nYVP2ydhpsrt171/b6oaPOrI1nMju3Nu52tM+lIrVkmOBTH6lhgJSGpULh4Cg9FiZtWa/7dYO2pgNQnXwyBmQ+OwHMImPWYvvA4huFNnISQV7uvH6Gk6Hv/87LA0uwSu4qJbMmqBLuJpCXeStRzoRGxruN/pIufF7DRtw9WVz21SadltmuXg0D6nW0hrEXqqeEPv+Mmn6ANT4gO/p1l5n2VEkTuMk5RARvxFITkWl4AF80UvXCP8W4q7in/5qAAxYDfWFJ3iGfLZH3c/IPoJd5de9yp7iIz2aIQ4l4OPCfjbXhvzm9+pPPyIUQoKf7LPmfvBKf4Z++aIjzXY0HwUN9y15jZLEvcWCSR03Ag2Tk5XEnQP4CzQkSdJX0OpcsyPyxiwH3HUlxD6GekCr+WChcpAl0+LmjrAR2wPJnAMrXkPiU1s5uukGfzVwXZvtHvPwwg6yYKDDTSBYcEsNRffDZ2zYoGvll0iqDtGReIocL/i1cyb3Pz5A31wia2RC6yGFs5rcRxs6kZsgsswNhLaG8SnQZx3MOInzD9TAiwf64jDwhWjWk8J6vvKKcv4slhtcHwoB3eLDdHO8s7p60pAgTwp+Ybw6HtXhDwcsPDTKE1vA4lVVHd X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7626e85d-359d-40e1-410a-08db77d979b0 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 13:13:33.7342 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: A4muFoJFdCD9Ma7M0lbQGjrN8sbYjutdg/Rkuwp2aPDWTrv57Se2GcRVU1+GnEGproX/THmkzqawhyhOi1DUjA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7472 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-28_08,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxlogscore=884 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306280118 X-Proofpoint-GUID: oXacdQ-h-FlBBcwMSTGLAISZvXZW6821 X-Proofpoint-ORIG-GUID: oXacdQ-h-FlBBcwMSTGLAISZvXZW6821 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * David Woodhouse [230628 06:43]: > From: David Woodhouse >=20 > If mas_store_gfp() in the gather loop failed, the 'error' variable that > ultimately gets returned was not being set. In many cases, its original > value of -ENOMEM was still in place, and that was fine. But if VMAs had > been split at the start or end of the range, then 'error' could be zero. >=20 > Change to the 'error =3D foo(); if (error) goto =E2=80=A6' idiom to fix t= he bug. >=20 > Also clean up a later case which avoided the same bug by *explicitly* > setting error =3D -ENOMEM right before calling the function that might > return -ENOMEM. >=20 > In a final cosmetic change, move the 'Point of no return' comment to > *after* the goto. That's been in the wrong place since the preallocation > was removed, and this new error path was added. >=20 > Fixes: 606c812eb1d5 ("mm/mmap: Fix error path in do_vmi_align_munmap()") > Signed-off-by: David Woodhouse Reviewed-by: Liam R. Howlett > --- > mm/mmap.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) >=20 > diff --git a/mm/mmap.c b/mm/mmap.c > index d600404580b2..13128e908470 100644 > --- a/mm/mmap.c > +++ b/mm/mmap.c > @@ -2387,7 +2387,8 @@ do_vmi_align_munmap(struct vma_iterator *vmi, struc= t vm_area_struct *vma, > } > vma_start_write(next); > mas_set_range(&mas_detach, next->vm_start, next->vm_end - 1); > - if (mas_store_gfp(&mas_detach, next, GFP_KERNEL)) > + error =3D mas_store_gfp(&mas_detach, next, GFP_KERNEL); > + if (error) > goto munmap_gather_failed; > vma_mark_detached(next, true); > if (next->vm_flags & VM_LOCKED) > @@ -2436,12 +2437,12 @@ do_vmi_align_munmap(struct vma_iterator *vmi, str= uct vm_area_struct *vma, > BUG_ON(count !=3D test_count); > } > #endif > - /* Point of no return */ > - error =3D -ENOMEM; > vma_iter_set(vmi, start); > - if (vma_iter_clear_gfp(vmi, start, end, GFP_KERNEL)) > + error =3D vma_iter_clear_gfp(vmi, start, end, GFP_KERNEL); > + if (error) > goto clear_tree_failed; > =20 > + /* Point of no return */ > mm->locked_vm -=3D locked_vm; > mm->map_count -=3D count; > /* > --=20 > 2.34.1 >=20 >=20