From patchwork Fri Sep 29 18:30:38 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: 13404766 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 3C3CCE728CF for ; Fri, 29 Sep 2023 18:31:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AD46B8D00FF; Fri, 29 Sep 2023 14:31:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A850E8D002B; Fri, 29 Sep 2023 14:31:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8407C8E0006; Fri, 29 Sep 2023 14:31:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 6590B8D00FF for ; Fri, 29 Sep 2023 14:31:16 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 405AB1CA593 for ; Fri, 29 Sep 2023 18:31:16 +0000 (UTC) X-FDA: 81290477352.09.511E90E Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf16.hostedemail.com (Postfix) with ESMTP id C8B1718001F for ; Fri, 29 Sep 2023 18:31:12 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=L7JfHgql; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=sRRfs1Vr; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf16.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=1696012272; 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=hJe3qHblJsXBEKNLWuPWb4ai3qycBxBwm7gvqKoRxLg=; b=LJfGpUEPunEm3l3UrJ1lyaz/DMaZYEQK4dXoFzGcnE12tp7/iF0fm6M1P40dfHcvQsmXes fwyNgbu4Lz2EXbVj+Ezba/A4fVgCPQ4okmCwc55092TaIUMj12lthNtS8FWTuBrsuo9rd5 dpXrYxNIxbhCr0smSvQKSAYYI3Tww6I= ARC-Authentication-Results: i=2; imf16.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=L7JfHgql; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=sRRfs1Vr; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf16.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=1696012272; a=rsa-sha256; cv=pass; b=hyiyJ5E6+w0SCZuAYi4zPaJaOzcyZU+sNhxLtQPdO8Ask2caUM+ALbJRHe9cgyvNCubIMw 5ZgsIc3RhT+e4px55Kuoc3OQcTy0NozSa5LjW98YsEtxmW871/i+kaPM5IB7AbYFP/mxpD lOtjcnawri8x/9mifLHvO1iHTW5u/6Y= Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38TIJFNB018135; Fri, 29 Sep 2023 18:30:50 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=hJe3qHblJsXBEKNLWuPWb4ai3qycBxBwm7gvqKoRxLg=; b=L7JfHgqlUeOmA01+WIdQ/gjNPb58GGmZIg4ZEaAhA/ZqrpwfLNMurelLXD7COOBdQhCT +lAsGdIjely+09E321csjjKDNINlj+nbVoIfpJBmCCGDz+JifISAfGOGsAifK7kMcQlX 4G2qLiwZqAu3y+QGLGq7z0i3d5ncEqxDCMm7gxIa9CdAE8xpDoo0oAWVD+k/WGOKjoMV zjGWIn6NPt57af2G+bLszG63lp3t+8mhxZOmmegTUrELR7L6b7BaL63ksVjPOBNdTadg E+mfcbov7u0qFYNfXgqRHZJtB3bDV8YgCDWkUWrAqeSWZuj3QRA+/jcshiuN2/Ayp1ri UQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t9r2dqh2r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Sep 2023 18:30:50 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 38THpMmh040662; Fri, 29 Sep 2023 18:30:49 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3t9pfj02kv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Sep 2023 18:30:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JWqUz+kUhUAXZoOtUPajp5y+yRnKk2mHLKAhWeOfO3BPtm8bz8GnWybP7FcMUrypy0MgvdyN1Ar18+q59MdlDixlnXYERIyjvLo3vlbTMrz2uWEPlYHivFdeOdF35CeCIlaYKVBNakO/FKJ9Z8tldZCO90j2tUnX1HC6kSUaojOawyf6joRlIFyu1JyAbxQVMoeSuQUgx4wrTbEZ7sZD9GpgHYok7gy6bx3ipPP40wTqug74x3311dihoeQd0Tkudh0oqCBFSrM7kaxGuaXDMZ46jXuzoxO2W0SyIiZk5wc3pcWHvvUgTjwtytukZA9sP78jfWV1hhAITWXq0qNEiQ== 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=hJe3qHblJsXBEKNLWuPWb4ai3qycBxBwm7gvqKoRxLg=; b=gcA7SH3LQxyCytyMrk4Kj6RCWQSKBmK5lB5nnhtGJcRzcfu4A2BRINd98yD4QP+YN6W802CeXiow2vQYmzySuyxtFtKecO/iT5NxUSlDGd2Qkb3DVmr238PavJicycnws1n6db6VT7pPaVKkI9AHljXHYSE5rrIpVQcebKsyY+9GnLaS9GDjZ1UWxBvqXfjXDVoWHgJVNxzJbSOq0xsH4lPAVvQqs0en4zYnKUYc6bmEU7ES2Kundpig/P0diq+8qU7Ws+oVy5y1QDPHJxx3+qCN8d2dq6OSE7s165JyhqXMjkZv5G5YLxulKfdcO/H/ZZAZNNBB8oVU5M+D8K5Xuw== 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=hJe3qHblJsXBEKNLWuPWb4ai3qycBxBwm7gvqKoRxLg=; b=sRRfs1Vre89gR6obd+pAmeVEr3SN+V6pKu7BDWJuB/HefsOjmEeHeF5gRCzDxrq7Vn4+B1Ht8VW69YP7X/nBVlksBxlNl4PyBLKkyETRxzUxuT1Szjw3cBW3xq4t+163vRcMOhcYculWMXsE8CQwCRAySO9ReoMPM1jEfUosHp0= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CH0PR10MB7482.namprd10.prod.outlook.com (2603:10b6:610:18b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.35; Fri, 29 Sep 2023 18:30:46 +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; Fri, 29 Sep 2023 18:30:46 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Jann Horn , Lorenzo Stoakes , Vlastimil Babka , Suren Baghdasaryan , Matthew Wilcox , "Liam R. Howlett" Subject: [PATCH v3 0/3] Fixes for vma_merge() error path Date: Fri, 29 Sep 2023 14:30:38 -0400 Message-Id: <20230929183041.2835469-1-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.40.1 X-ClientProxiedBy: YT3PR01CA0018.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:86::22) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|CH0PR10MB7482:EE_ X-MS-Office365-Filtering-Correlation-Id: 2778f911-50ca-4dad-1d42-08dbc11a329e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xSs5EkwmOUTsOQ3IYWoZqxIdohZbCQAhQpC5rQ27vtEXyKCgtj7GACTSXX82DTfmjAwr1HYv9/kndPv6M4jZ5k/fHp6uuWDFH8PyzzKFI0Hhxe2WeuoCKQ3kYv3WhXIa8JJknETVGiu4yAn/iQuW/nmichpCP+1450+l+KhOmYLJ6dNToEkr8JpybHcdBwPdxcB5sco1OTowBlGDlsJyXK5uOBqOv0dLjBezdHqePkjXiKRm3gtSJeOPYGTtRD8lUBdjpe4HBclwaPKGDEIr8CwJsYSnrtYTa7S60Mc+G5HH9mADEwm7d9HFpTiaziBi4uDt1TOiEYDC4SJtPVB5asw9O5HTBR/DFw9R5jk34zHGX9acdGAwdqsgYd0uiNVM5/am8YLWXo9/LGtrbSh7MFciDp38OTvSp6R4Gv9IlcPKOd6piTVRgP9NErm7bzb5JyYHzGa+qglMaKwhcJmrCsq8Gd8cNRZcO9lQ7vQb+OhOVdqZ0CVHn3CLX2VexzsvSTykZ4kaDU+M4PhF6B0gMCKJuT3TLfM9j4/kcX39ibOmngZtyevvHLAmtw4Cs+ea4rjW0Ttvu0wVkzJe2Dgqv9HUoU0MAARyOWEXa01nlLQ= 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)(346002)(396003)(136003)(366004)(39860400002)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(41300700001)(54906003)(316002)(6916009)(66946007)(8676002)(4326008)(8936002)(66476007)(66556008)(5660300002)(83380400001)(6666004)(966005)(478600001)(6506007)(26005)(6512007)(1076003)(107886003)(2616005)(38100700002)(86362001)(36756003)(6486002)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-Anti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qhRAZV21vaF3XHHyHKovo2cPTVYvEj7Pz6dzdXcVmYJkCcOZhw0CE2GqscLb8cbK32OthrUw/qcGydng2UbDwndl0hWksKWSqd0C1wcOBQGEuLEJZjQOZf0PZU2stcIjPOppLEHyrdeCWDmRITzDbY5PI36ZZz8fSq9uRVpEUoYna6MioGwnX1jkdCg/nMMvBLS0tteK0OvdI07lZrZKudF2CYXees0KxjsledDG2ChjRKHHuDw3JxpLn1FvJRf/RfiYyzsvBv9QakTfzLF+5uWucBXNeQA/D4czHcA2FYIO01r5cIzYIlTGTJ2VJgia/kBbZGNStUlQ1DfSZ4zVltucmL3hPezMYPcErotwdFmkxIFnlk3zPjVzX7IxEnXSplSwGovxZcbHQq/DwYiNKyCrmjtgphjdBhV+5p2idxbPrfiGTmamSyfM/+rGLTxNp168S3qdK5ImNjUEtE3pe4Ms+l7IX4pGzaN/rt4+Jdr+Q1SdMD92jpCSz0kA1fQoRAQ1jZKQwHDK8qkIvNOUgA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2778f911-50ca-4dad-1d42-08dbc11a329e X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2023 18:30:46.7183 (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: QnPcC/BbcBY21m3FxsEp+wLldKGxuQmH00vmtykkYr1SUi0ud6A8/7X7xFJ0ugvlTaMj2qDCY94GzgWFisLO+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB7482 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-29_16,2023-09-28_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=559 bulkscore=0 suspectscore=0 adultscore=0 phishscore=0 mlxscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309290160 X-Proofpoint-GUID: GpvI_SnBfxkjuax37aBSHxoDfQNObRhj X-Proofpoint-ORIG-GUID: GpvI_SnBfxkjuax37aBSHxoDfQNObRhj X-Rspamd-Queue-Id: C8B1718001F X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 55phx7jifz3xgsukj7swe4teksjw7ji6 X-HE-Tag: 1696012272-664072 X-HE-Meta: U2FsdGVkX1+TSjPYZsuloeQ/5Ixs8GOyMpFBprTcPRAp4GhnDM1QBxjzrlOkz/dhK/4sCM2TsOiFD0JV1yj+uKwATnmakxBYT98rWT6qDu+7seM4kK0V8LQgJHb7EDy54W96qiKQUrgCXkUv4pSsj6usSM3mR9iYtHBqRYK++vwm1zjYSecyW81Rre+xxOowLNYLPK5t/7Cw1H2puhn3l4tp2lGhyNI6kos33tmOHvDbc1K8mlQiTiQKT6MGmukxeo1OEhw0WgdpgylFFi5L+leeSvfzYCa/156HkJsGCYKwa6EZWlqCswLaSuF/i0306fMT5DLplkcYm9AzDMQ+U4XDqoGXBEQDpAjoQoR54dWVl7e+nfc7cJqCrZlDiF5uKLrrdAmMWPMdgCpQiac0J+84T+UJucw76xBGouq2qN19a+AmGJ3I6QxcoSDiRgHPtyUEErS+8fqtGAmt9TUw6OO4vFyM/14X3b9oNrLEYK64Ua7QoGjlQKsaeBZAePV/1FKg1GHil074rcSfc/FEkMw0i2wYc/QLZ51ruzq1fospXYSkMqB26Tq4C2DFtB+EV+d2w0AnmHZGHh8c5hJHtnnNkisiHmVy2Lep/PhlfUgFV25vUGwhNkxQYcqJyGU+Q4gJ8f0Saa9OTSKC0qVTy2//usgNIlx3X0GT+Ep5BC6LBh3bzrDRXovDXJHixWX7uynle6x22P8Py+34nGv3R+uuuhKR77LKsYLF7AA2+m4QX1w2fW8TsSIGJvY4Do8NwHJ44FmXTtzkbE8cM80td9eJWAAperjKZdTNgYfo0eQliAmFLKn1d6iOQaAJTQDEDxgyOiQlA4DtT5XLya5+/bFpB3a0KoTMeU15AhdCi+b1An0Z1K+VX9Urd/m8ALbwANu+05yd5B6Fx29nrT+reHkZau4FBjGiDYNB4ZuXdr5JU0UUR4WNsrNcnR7M72yIhoj5lOVqGS+B3x8zLa7 13CNCjmJ yfXxgxciLUHVvZau0KzSJ6Vv/s5+6X+O2uGJLlNkeeGgATzsa920FhDB7wyltj4zSQPtb/elEUzf8xDpjST1+8qwVmuZr+37EPduZmxgbsP4mKBmkc2gS+htoXbqBMh+ZqTrPQd+qHgxxXMGYMoTwnUNr4VUqNBWCZBZGyKZNWm9lLhpo4mqWhrt13Me78O3b/lEFW+fI4oqPkwk2Vwgk1oyywUKSkeYlqRWp1Vf1p3+B9AmLZ5Xi6XR2MDPLimKbzNtYKIKG8aDBDeCZ3byK5/tBnhTuZ1Dt79OG/fQgmTnIwM5U5mjk2zdkgXP1XlHi53iSAPftxA1oRqFmgDP/KpW0XDUDf30FLf6fZ6th9A1oNcQvQ+2l5Jtwd+KNUQJr34VtQxZO1Ujb6ix6a6a6YUUmJ5hQJtnUe35CuGA9uvwd6ciNKqpq7vQNpt3M7cvCJILiupWKP1tsh/HHitSvw6yKsNhDBkeEQBPz96lPGm/14ka9TSk7eLjsVQ6i34CHf/Npx79lJf+eUL0= 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 v2: - Updated dup_anon_vma() comment to include new argument. - Change vma iterator undo to a reset and rewalk to ensure vma_iter_config() changes are dropped. - Thanks Vlastimil Babka - Update user visible changes in patch 1 again. - Thanks Vlastimil Babka - Only set the anon_dup vma when the duplication is successful. - Thanks Vlastimil Babka v2: https://lore.kernel.org/linux-mm/20230927160746.1928098-1-Liam.Howlett@oracle.com/ 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 | 45 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 10 deletions(-)