From patchwork Thu Sep 28 17:16:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13403336 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 40DC6E732FE for ; Thu, 28 Sep 2023 17:16:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D468C8D00BF; Thu, 28 Sep 2023 13:16:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CCF688D0023; Thu, 28 Sep 2023 13:16:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AFB658D00BF; Thu, 28 Sep 2023 13:16:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 9DE388D0023 for ; Thu, 28 Sep 2023 13:16:55 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 5ADFD80328 for ; Thu, 28 Sep 2023 17:16:55 +0000 (UTC) X-FDA: 81286661190.04.75556D6 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf26.hostedemail.com (Postfix) with ESMTP id 01131140013 for ; Thu, 28 Sep 2023 17:16:51 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=HyhqoUlE; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=d9Bq+XJ0; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf26.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695921412; h=from:from:sender:reply-to:subject:subject: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: references:dkim-signature; bh=8N9bQT4OfARgJz8z2dDRPsDy+ABDtcJbYYwl5l2osV0=; b=GQr3LtwauOLf4QSErqJu6nIaS3BgwzStazQEYGqBQTatv5QiqAt3oaEhSUxEVmBA7HZIVu aHh7jZgpv77a0sokwLOzxiewgbMm+LUoTXXq7aWT8yzYt6Q1pJzjos1p/EeQHGuMWBpWqf D7StyDckIe6QPG3cFT/Kl2zFYcWK0Q4= ARC-Authentication-Results: i=2; imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=HyhqoUlE; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=d9Bq+XJ0; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf26.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695921412; a=rsa-sha256; cv=pass; b=JsgFg2RJs1KxT8fi3Imio5YqvsoMvlYQUIsKE/M45nkMr0qPBfvYPkyQoZkvlZzKK450wp qwegNb44Y81HS9LddKgreWZ9yBSkJTF1NrVLu8zBz0s0lNGMYFOe5sfFOT7sPTDej26c1M RtwWUw1zZQQHugSPB6u/YL6sLgyHdGI= Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38SGi9Hl011469; Thu, 28 Sep 2023 17:16:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=8N9bQT4OfARgJz8z2dDRPsDy+ABDtcJbYYwl5l2osV0=; b=HyhqoUlEM4YV1KFprmlJM028Dn4YNPSYFbrk91mUC1zOLwbLulX96NOdcQaJv2FTnIz7 gfXdPkTUTg+e7I9kOkLVG7N1yw0HhG/lYTeDVBbeVyNJ0UjmJPHkkIuJ/tzcYrnfYbib NzAj98G31vwQThgxvPXXVAdXfFONL0IYzIxZI9qTkIqKhW7UlH9rm3bHRHZySn4W3NpD Myc8lTYGTAtmxUnxIvLwWIqDvssevI7PY1m6XeGXiRsRSiGWP+0Yn8rqo4ORcjsGlKaq PG9eT39uNIkLxMSSAmDMksCcq12vmA8hZHZ3HRGrmQLieQjcZNAjNizRPAl/lvAiFXTX iQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t9pt3w2qq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 17:16:44 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 38SH0WCt015788; Thu, 28 Sep 2023 17:16:43 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2049.outbound.protection.outlook.com [104.47.66.49]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3t9pffyuuk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 17:16:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nFepxrxV47lmzG51OiN/2br7qp6ozweqAzGui1JRmSrO45b1j1hITGa5HiByED6s1Xp66BlVpIEr1TwUf4ov11TLLJJ5UC5w0IxZfJqwk1eKwrVXSv3y+AzMYOOWBdAQ9VtTwcU4Aw+4L3V9KO/dE/h2wuwx7TUEqa4WlEhr96Tg3EkFOdaqvYGmX0LSTeV5j9zOZLD6xFcJ+IVVY9O604lgvRDYpABdulA4q30wbEh2URtQpYWBnGtDNp/LD3POagbRhEQhOxz7Exj6qVwxd0UsTjs0SZS6PoaISAMquAR4baiRDZeCfTviyyTwZQi9S6vuGwxoXuM9nY1qUfLaCQ== 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=8N9bQT4OfARgJz8z2dDRPsDy+ABDtcJbYYwl5l2osV0=; b=OC3oZp7KpNh7NA2sXQhXOBptpRX8Ssm54Xzd7hLtIGR/L0hB8lFvzxqSf2SW8MATYiihUtuBwkLokP1NqA/hCiQBQkabARocXucMIXYhpd4bfXVlQBT2UrwhNTNUwPrcO7Eb3ToINvbmRGYx6jARNtU2emakTDsF8CmE381+E3HKNQz10H2V+misDzYOrMF6kP7FGhvdfVYyh0qzRnVVt71STRQQ/xP9RfLxffInTE+lifbekgWtYp2yfdnmwPjG7FH7SEuNEtG9w7Zv49IBeRH0ozbLD0rqiAiG0p9SbrA2HbNvBt95mBK76b9KGezFDHns0vI9mAyW0m3V2PsAyw== 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=8N9bQT4OfARgJz8z2dDRPsDy+ABDtcJbYYwl5l2osV0=; b=d9Bq+XJ0aaXz4/0I5l6c5Ba9fqBOW9Kg4BPN7XrmKAtx2u4uqbwBaI0bl+D2wvGx2qNE/a32+fnb5J8rDQyzgygyTWiG5ISLS+yZDzMnIo7KELcPIG8i4YE+atCiTXcKitOaLv8yDrbGOQzQsfgS38D7p+TkB1sRxbnvZLUQfOM= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CH0PR10MB5273.namprd10.prod.outlook.com (2603:10b6:610:db::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Thu, 28 Sep 2023 17:16:40 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa%4]) with mapi id 15.20.6813.027; Thu, 28 Sep 2023 17:16:40 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Jann Horn , Lorenzo Stoakes , Vlastimil Babka , Suren Baghdasaryan , Matthew Wilcox , stable@vger.kernel.org, "Liam R. Howlett" Subject: [PATCH 0/3] Fixes for vma_merge() error path Date: Thu, 28 Sep 2023 13:16:31 -0400 Message-Id: <20230928171634.2245042-1-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.40.1 X-ClientProxiedBy: YT3PR01CA0120.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:85::13) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|CH0PR10MB5273:EE_ X-MS-Office365-Filtering-Correlation-Id: f17fec8f-08bf-4606-86f9-08dbc046ae40 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fGzn1YrNTZ8tp4QbQAoMgcPg7oa+s0eJTwyIvNIlGr/PTG9mXtxj/0GKXsYZNSoAQ9D/0pw2HxXLjXYtqbXDUYcptH9nZT9/XsZ4zqoLtIbSGe4xr1mag6+UM/7oxkBdeyQjVo8qNWwQggk221H8o1CkzE4Lk/xtlMTC0SdkruiBpH1uLLFC0JJ76zbEQ8yQ3xy04QBt15salH6QCtSzrRaVOxJKo4DPdoriPZE1Z6ow7FqAMYwHRPEov9ORcPR4/iiHuwEfnnfkJcnki9gywn77TdPT1IMS9P7yka34mfJa4RPhCwq/N/7k5FuMBueMJf9dxA/H1IQL6lRrgYbY7oPNX1Qw0H5BoZB7x6BqAbyqKUGgO0brpIFggfkF2PAb1GpYGfynmklE/x/kOTSUVIvjpl1+wEmxcAMR0RpXoNqJ2AS5PfMI9G6qyXC5VDrGydAy1JCLYdiWKmkff4yy/TY4cjw9rg0vRZVdFwsh8Wka7yzJ67eV89LGx1nYgMsZ9rxpwe++6Dy7bHGiEJzbvjRw67TkP05CxHnhpG+pOPg= 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:(13230031)(376002)(396003)(366004)(346002)(39860400002)(136003)(230922051799003)(186009)(64100799003)(451199024)(1800799009)(4326008)(5660300002)(107886003)(66556008)(26005)(83380400001)(1076003)(66476007)(8936002)(54906003)(316002)(478600001)(66946007)(2906002)(2616005)(6916009)(966005)(41300700001)(6486002)(6666004)(8676002)(6512007)(7416002)(6506007)(36756003)(38100700002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 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Kk9ogFVJqiZlMkuyyDZRom8GTyleeSVtUi8BQPcHiWjZOmppa8MowTMPm6Fg4Kh+W9jzdJWJLErC5nlQrf+za8lpZFyb8lhcTDHh7C4skKtllzZWcVDxY5/F+2gfvzvhT7/bED34J89glBUKz2AkFVJwLELT6WsrcYa2Ih5aCUz55vPD3pF7MRpBaqRuNMyMZL+DoXh2rStGSzHSoRtoN9npczUe5c1dg33O/VJnE7xG+IsBvRlWMgy/uo7KeZnf5ABTMqOIu5hZE+Rds7reveKFi+hKy+Ijmura3Sh1hgsM/pwbkaOENVpTSEpzBznIsCNGIY9dKbYXy5Umcpe4XdJmWqygYyVToz/fGncHHdkMxt+PkZr0TSewdoeJTCjsyF1C5F88k8j9LZy97TE7t8czYpUcHkvHrlK19A+o3ZqIVaFzqV7dpxUmakeQGwSiPAybLi74ku9UDRx2JvY15p6C8lVl0lKvBrBy9UHEhjJ5FNRbPStxakjoB2g+3oUnDl+qA/G+YnJq0ah3RBve6IBQL3MXuVcCBnIsuZ7uoLcR00CuLScHusO1YllVUK54qPgGl7g2ZvFXuhR7wxH X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f17fec8f-08bf-4606-86f9-08dbc046ae40 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2023 17:16:40.7552 (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: jOyakHA5CxGg5TjUcBeqvsP6FBbARqWXg4DT2NVW67lZZki1KuDmRLBDzmvCCobtmYyvCzfLEcMH9u4tyYsBnQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5273 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-28_16,2023-09-28_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxscore=0 malwarescore=0 suspectscore=0 bulkscore=0 mlxlogscore=550 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309280150 X-Proofpoint-ORIG-GUID: f2zBmCU_cijtLLXm_pTwn1yJvNESit2X X-Proofpoint-GUID: f2zBmCU_cijtLLXm_pTwn1yJvNESit2X X-Rspamd-Queue-Id: 01131140013 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: sxfg6e7if541rb4r5kjfqnsxnjrdcqeu X-HE-Tag: 1695921411-245239 X-HE-Meta: U2FsdGVkX19qvlAJHGJpbCQ774o3FzyC89b/W1lFXxsO0UgA7g6ESmeNTQ18+6QTHXJWBnh0bH/XXiHz47UIGmMcdt7waMMRhe6wSEpX1Ra+rEfnomF17IGCTkpb7jZ/OjbjUqbPZslmOgx/2gYYPRYuhOaAzv7W5rTbHa2KPaeNIDmFDCb9fXq8yXAzYxvKPGCTxJ4t0/KT5PfIYOGplY8mGqE65vBsNRICSsYZb1d8JeBx/zNGtiwgQREz6orBziu4JbaYJB3hbIi3XWnaXbFROvn08ZgKKsZnsSUHb1X481ZSapA6u4mJwtzDfNx24Z7ZMsyEwgSiBjB/JkosdC5K1EFjUr9SyHsPjYoI4W5v1/HHUkYroNiJCAPrqNPyALEapE37/hfiTcikOiq7sfdEAmtgcBNj+0Jf6Uahc/50INfbttLsAQKFPbrAmJf18VmUQ3VNtLu1mC7RD1xXqHmrBIE0xnhUqgQQcv20CXZPbVXGUvcPV33gyjcSP1ok2jlHfXiHUQ5gEj6ytPyXq/3Vfhkw0qnCNNtEzVE98g+86WCnYJ5d64hGvvCZlNkIZuJaveiaDeuwJibGgQrc/r6YtA6rbcC2JFlOIZ4UZ5IQJtS3kwt0E2oc9f+YSmQNFoBr3uWhJd3BF3qLkFSZPTU2Nn1Jiqalvqy4istRFpBsB0d77UCyoWqUa5AImO/pjKfTZqAcs7xxVpU7AyMiDSb/ga/OuXaFkZHFS53HlODczfRiW5mz41URyy9FZhICZbdgLAyiEpAE7LN8ntkwOKPcnKljMwK8Eks3n6QT9Qtt9Kzoj6WfuW4EWTjs4iuqwARWYOCv9BPA3um/zdWgspyxcS7qsWccF9g/qavALsqtvo+ZPRvfToAV2Rv1znomsWijpnOA8XyPEVVhCX9sMGNLxFEkiJQTKIRHfUI2/I5xACqNw7zKzwAn1ynTrRT1vrqocLhLmQcySFZSX5A FF0q4hXV 1u+bj5YAp7MhqVdW/fkF0eRrJF0tj7dXNUEralC9bZ96R/ZPuJAzSFaIOCBojk71XcgOKZLEEoQ+ngG9d390zu6hl7ah7lUipQSinaWU+9/tLivyIfKad6PFkie5KdnJWax83QCDrll1hrQzckfr0kO6UVym8fiD1MoTzf5y9ay+wADcUJQ6QQCBLrul3yKFL8x0UZOmgQ3WDmjfPHWyuIWZyNpLOr8DirTO2NobXxNdxYfIKIf0NXv7l80o0KJv/PKJwxsa+qjvycvKw6YHtntm3Ro2HhQP+2LinTCdJkxYUCzPyXxpDhnEyCdnTgyYeokCe3COj5JKfJco3b8fIHS5RjzcGL/A/Fij/of0cz992CoVQ9mZRpfXWz1xd2PrdMAzKY+U3ak5vbdQULOTvp7KRCDUuAC8nUWjwtrMM+iOtzLBOEcBo66NgveJV2tVMiYbDAVaI1ts5R4MSU2AjX9d9YYlYJlQ4bTdgQ+44ktrQ5sR5fBSKBKqbG0V3xooTYaCbRfP+rV5u2c8= 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: Jann Horn reported a potential vma iterator issue in the failure path of the vma_merge() code. After examining the interface, it seemed the best course of action is to simply add an undo path in the unlikely case of an error. On examining the vma iterator issue, another issue was discovered that would increase the memory usage during failure scenarios, so this is addressed in patch 2. Since it is unclear in the code, another patch adds comments to the vma_merge() function on why dup_anon_vma() is safe in 'case 6'. Changes since v1: - Moved dup_anon_vma() call update from patch 1 to patch 2 - Thanks Matthew Wilcox - Changed comment on patch 1 - Thanks Andrew Morton v1: https://lore.kernel.org/linux-mm/20230927160746.1928098-1-Liam.Howlett@oracle.com/ Liam R. Howlett (3): mmap: Fix vma_iterator in error path of vma_merge() mmap: Fix error paths with dup_anon_vma() mmap: Add clarifying comment to vma_merge() code mm/mmap.c | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-)