From patchwork Thu Jul 4 18:27:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13724168 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 C3819C30653 for ; Thu, 4 Jul 2024 18:27:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 814A06B0096; Thu, 4 Jul 2024 14:27:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7C3CD6B0098; Thu, 4 Jul 2024 14:27:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5A1126B0099; Thu, 4 Jul 2024 14:27:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 3AC996B0096 for ; Thu, 4 Jul 2024 14:27:44 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id E54B31202E0 for ; Thu, 4 Jul 2024 18:27:43 +0000 (UTC) X-FDA: 82302903606.11.05A855D Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf05.hostedemail.com (Postfix) with ESMTP id 881BE10000E for ; Thu, 4 Jul 2024 18:27:40 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=jsM+xrnI; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=REUuntBz; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf05.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720117635; 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:in-reply-to:references:references:dkim-signature; bh=vBrw4cpyDlw0oCxrS1NpsHrvh6il04b/OpjjP2KEzV4=; b=fj0DNMCCM2Mfk58bHpKjv+lcXUhO2c/8yj8wbnfATrkgzNfFbGfKRcC1XT5qJ/T2Xxkkzd uKPkkd7rKd0laWKXex3N1vEJqS/2oXLDKl98QqK48NI2EBECC692JZkc03460pGvV0TocM /UBUAeeRPxFE00oc0Nt/YtZR6AFf/pU= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1720117635; a=rsa-sha256; cv=pass; b=YBs/rjW91Gy5JsUMENwwYLOucNOKZub7OmgkB1ggHijp/cfjyGH3hbsLzx/M1Fo7D+hvq2 ttiAUyo+rW9bKkXj0sFQiaTfluoNOuv+6ZTdkQAi81pf/vDmwNlzNvh/H3hrCjf0boNhoR wU9bVlNkX4XVS0gJbMd/k/uiCeQ6G9c= ARC-Authentication-Results: i=2; imf05.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=jsM+xrnI; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=REUuntBz; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf05.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 464Dn5Yi016715; Thu, 4 Jul 2024 18:27:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=vBrw4cpyDlw0oCxrS1NpsHrvh6il04b/OpjjP2KEzV4=; b= jsM+xrnIjqhzDKoVS9tHCNWhBskZomXjdCvR/Iqg6rZkTtWR0hEsAPTFqJN9irSN +/AtvZVMLNRElKE4sSp5LZgdpN7OZJH4K1HTHV3g140Siy+wao76cSADJmXaJE15 JLNIeL1Yg99Z4m9+40YD3q13O9nzEuzppJx5R5V2p+SjyKbB2flIf01/Smv40I8e QIqyNIsc9bV20RUqoENE2jCMjtfbeVuSTpNT300cuXcN5DIPOSCqLyhPALd76Ied bh4zP6nx+HTuywDVYCRfKKerSntCk+W9wmH5TT+otRgJ/qBQJl2kj7zHKG4hDT60 vEXGOvkebhrVRZ99ecahIw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 402attjpgp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Jul 2024 18:27:27 +0000 (GMT) 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 464FVlJE023459; Thu, 4 Jul 2024 18:27:26 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2040.outbound.protection.outlook.com [104.47.56.40]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 404n11kmh7-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Jul 2024 18:27:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hpss7cz9cQdKGy9YGVCHriUF+LLEOzMeinsFobKbwuxAjzpAW4RhvDFfGtuufMRILBC1U78BsVQQsuDwq+8JH+fIGYNeMSMQb86FBTmJdMRzxbYPkoV4sDTj2EdS3wOjX2ApbjIyPyxOozkaaK0IKXpXybwUK3oEFnrib/48fncQWfwHwwEYmn54eFpeTwWRK/XSJS0pqZ6k6oZWodhN0rHKFDjw3VqtIeP46Xw8ae1nGu6zsjnez85628skBKyeehmQuW7lV5NRoDNGnebZKMbWzUIAlxNYLaWWsWuNnO/10GW8aU9EECpbspvtjdw4BpA02U7B0S8x0uExrpyr+g== 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=vBrw4cpyDlw0oCxrS1NpsHrvh6il04b/OpjjP2KEzV4=; b=UyrF0d/3IpsWt8axTazaummk53SQN1O3emzkRsrIObSd7HtxCuWhh4M0O/eG9rjaPFM/3Bxfpa6Ywt67/PYQbXy1fJffG1qs3cfLFA3IrV6JjzjQPhkqc/NqgeZrJJcZXmllWc8ckYbyvwwPo7VC6nOWzWptyeVeLxTreMYoUwmU48+rO5SaCuVPCtzQDYOguSkUMj4Pp94PvAXo7QZozJ7ES5518K12TAd/Z4wg/WktdiYILYIUJRZ/R3L9UEitgn5aRO+xor7w/Bpfp4k3QR6vSz9mvCVAbxsVnPnF+x4PJwjNN0B1lrbzww1EPj68JZ8O4i1TsFonkL9VAXdR5w== 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=vBrw4cpyDlw0oCxrS1NpsHrvh6il04b/OpjjP2KEzV4=; b=REUuntBzTEi1jtu4Dvpa54hr3mMxX4dKP9EL3OhQrcOBEouppUSDnRvaY9yMO99ticMsO5wxCicWXtQ7dD5iYkLmfq8d8oxcaiRwQ+3x0QCX8LMAgHTMtr9q3R3RVqOD6b1umvbQf6boqcGSnGumQ1jpCkoU0Yq++Iodr+yc4xs= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by BY5PR10MB4242.namprd10.prod.outlook.com (2603:10b6:a03:20d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.29; Thu, 4 Jul 2024 18:27:24 +0000 Received: from DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490]) by DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490%5]) with mapi id 15.20.7741.027; Thu, 4 Jul 2024 18:27:24 +0000 From: "Liam R. Howlett" To: linux-mm@kvack.org, Andrew Morton Cc: Suren Baghdasaryan , Vlastimil Babka , Lorenzo Stoakes , Matthew Wilcox , sidhartha.kumar@oracle.com, "Paul E . McKenney" , Bert Karwatzki , Jiri Olsa , linux-kernel@vger.kernel.org, Kees Cook , "Liam R. Howlett" Subject: [PATCH v3 01/16] mm/mmap: Correctly position vma_iterator in __split_vma() Date: Thu, 4 Jul 2024 14:27:03 -0400 Message-ID: <20240704182718.2653918-2-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240704182718.2653918-1-Liam.Howlett@oracle.com> References: <20240704182718.2653918-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0497.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10c::15) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|BY5PR10MB4242:EE_ X-MS-Office365-Filtering-Correlation-Id: 6cbfa750-f4e3-4b87-0df9-08dc9c56f37a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: EJwSLKOxaIY6R/LuZK1Z0VZTx96+UKVnLd495amwSG51+pSWXwEUg/fXo0BXZvbefQUaWacBNrQjfSrb50/29645GNGQJQk180uVGD60O9dHeOuztRUcDshljZ0ZsRYpy4y2bxrk6Scss0b3Btx2PqwA6/DUfpMnHpDkXcqjQhYTN/nXgKNANta4pQ1jvVkkQeWIAwo90CNIaEt1EFEqOUg+Wm8LSjKRWLjY7hHOeKiDe5VQ1okvbH46Pck7Dk/Mwasn7Ol0rlgpAb6wt8kO/gZjOk8jzk1aD+2Fd1tyCVhcfUVYOSlXJfPfB6VasIYCmSOQH/aTAXuYEr2MVzg2iO+zNPHrPMXXEk1B8ZQN/5cXYu79YU59+xOxJnlk2+RSwZ7VBLFZC8x7BLpuu8w6+8R09vJnhRqqXUv1ITxE1W1nQ8jp/rcARtpfKVfqxnZS284tRby9MEaNR0Ii+eN1R5cO00H/XUr4Ue8P5ZP0go2ZkmBKwAexa5wD9dXORm7HzYkrPb08xkuPuQDjp8lnMHdqy4DjRSQu3PM4ai2zmtHInZTAbvSfMslXnT5+xPnAyooqvunW2/FYbRPeVkgSeMZohl8G2jfCzgF7ePy8QvugB6T3Iz2SiwEE39CUEbJCpJvxaftZO/WwGwl/y4bIZeKW/ihslIOLGMtZw0XJIW5xKU8C6GfXnmpCTpiwj6FRnZFWCDzbYBnHFZPX5OfKOReRl3Cc+FjbkVOKKDfOW7eqxHSQbsv43LrONIm+9yvv9qknPRBC0X1VUM8e6pCQuZuW1rIFZUTkHlykrvjuoCS8Z9mxq+Sgg1qh0Zzp6KHo1WBiz1RcqONk+zwwDxZEIWojZu8Dyu8y88ma3okNq2mDFV9sFVp216Jvs87/l4JyjxnSsAQ+7TBCknIQEpHxUnohaFHjfuAuJaBdyf4FnGhY09VcQYcT2wrL/pmNjppij0/1dYvdImiU36VpLhL7h9/z4qyzoObys9++s6K/0qOOpMaqYOzRj0h4AbgO0mvkyGtMf/iuU4Jx6zlsjyJXt0RoBRtjFJAFYrGrdtvrcnGUrqil8YyZdCvsxjk6J4hMMyiw5PAYQBV4y4hG9KSpJvvqA72dheEXGin2rVKZ0mPbj6wiuFWAYuNDSd7jbQAMuAkaVKGB5AHKakqzHqrybpsr8zqINbLoV/9xPKrgqtFtc/23IAgjhSkrXOSHwTiINUlIfOiNHg5c6ZwOltW3jMYrrY8vN/W63HUE4F39o4NOGrWiF09P5F7OHFfikaYLvZiYrdE5mnRo6EJgjp0n3qz0uUul24Q/AvHW1Ix+eq1kqWs2/6IeNGQd9KL8nMdzzjyLMscWV4cbl7+tjPTOmw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR10MB7933.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sIqh+5WEvwQSIxOLjy3sKNYMThr0CgrZQXFWFRii5S1rVx20oxafVuRMtq6jU0x3yomcGIh2au0TxY88jWIKgL1XeXju/Nit0OKu8jprluu0Xc+tGz4vKQEHsUTbATKhPDCO9QO5tcavmG1OqqM/K0NRdLetBJFptYkcCPru8La3VMoHOd++IjOnB9gllWGBBiw7aOsETF09BmyOYQmFV9UGiGx1HWCpjc8T9EG1cktk6bawcntS9QWr9VlsAwKcd3TxyDgWp+W+nTlPlADMh2CThJvQUz//bZaXihSNuupzBbADk7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3RIma4d924oOgNpusAjs/DM225WFFJPgaI/RUdiKPsJV0cz6PWqliLk7B36ph7da6R9VdQV/s46qjbCEmOtn+kDIv8fArRm3e5VMguDEbrqJ8AEs6g+qFOswVQW8f4utmcJ063Bxm1R0muq6Ybqx6GKW51BG+EgWY9XHoZjLtKlnoq8wTVZPNJInImnLbt0uEA3vStB/n2SvYpjZ1jxCJtrCyKchxX6 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ImesFqDqQqtFEofjEhPEZeBU3K6r4ic4AbmF59e4p6urZDW6kQChlrdDaW3pkcBkht82yuSHA76DDeRjPxXgmLj+ZdsXv6PENzCA6l4DuHwK7Y2cMMcvz7L3lvH9UhjId52Rg993OThhrBNq0ciA5zX8XwtNkSf1D+HB9OZEn5Hetv5bCA1zPaJ8KharSZWFIHYJorhxUqB7cde7FM0kt8WXzkaTkZXzM9UJfAHoe4+kRtrmCjOQOFG+ZLKIjMSU0481El3v59WRY+O47yWWB+BXgsbsznX3SPHFZCkRmeWEHlkJmXcxBfoQVr6Llij4vYn6+Bx/ipnZWCVf4VhWTcC0WPOiPIQYUA9NB8GBiG7oqex/erySEHYUtYGgv3db/+g/ibZEEJ4xNfYUD0ytT4YdWqmOS5KugJkORQ0RDBu82yx0I6yUO+w/n7Hp5wPkrv7eQ+yQCrL67aPFQExZCe5XSjwgBKIlQuvPP/cqf5cHqgcQx9IozFbF/WY8KRJQo5ojjRtqRK6OcOuc71KUZiNAdKjxJdlS+V1kahCmbUyLpkWKVb5i21TZ8P8ZSE6Yn6H+x3r5XY0x3FazoOOATQfOb+Gg6uuUAzr/VdkD/nk= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6cbfa750-f4e3-4b87-0df9-08dc9c56f37a X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2024 18:27:24.6500 (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: CmNKVhDLa0lmV7ySDbJ4DJ1ymIjaenoaZQl71Ro2w4IoN38iQ/ypNZerqkiyR2UdCVN9POZN1HKk0e41VDKTlA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4242 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-04_14,2024-07-03_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 bulkscore=0 adultscore=0 malwarescore=0 spamscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2406180000 definitions=main-2407040134 X-Proofpoint-GUID: qmyscRGXXsu5sO-R7I3C7fvSWV9vzbAz X-Proofpoint-ORIG-GUID: qmyscRGXXsu5sO-R7I3C7fvSWV9vzbAz X-Stat-Signature: 1bci3tp1ix51qn19g3p1uo6jrzdso8sm X-Rspamd-Queue-Id: 881BE10000E X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1720117660-23467 X-HE-Meta: U2FsdGVkX1+I7/zhXEFm00QUpudEeHczHJgwjQMxaP0TZh+F3EX60GHaRvQL4LlOMrO2m6npXXKFbCOyOxpIHuFMgQBqBQuASy0zX+c7BsrEswb79UMPCmFawvEdK+TOa//YCggoda+YFQVSADvoFb5/pZ3ybfhNBe6nWrtx0ijCeMuk1GRtOCBB8hqtsJIN0Yk3s+3iJiz1sRNsMENbYCE7WmrlL6eKh2gY8o1XBFpfvCJPW2hUNAxJJApc1Cir39gfaWjV9i8M2+vXDpLN3U5etZbx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cFNZylaF8f1OjiVlHDyanE7OTsZ9cHZkdLL9COtRPmK9kBES7lAczrziC1+rZALjDUAms7N09jVFmvyQDZOkguuTyL51R7Rz/2ZxCA2J4K1yVuLr6nMIx3wK8a5QC23EYCgYlqxD7HY6/phMizw2S0eSwjxEhO7sn0CwVqg1FhzvqzM9tmDYwQzkN8xYpHX/hRa5V2tuev0n0ULO4p 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: List-Subscribe: List-Unsubscribe: The vma iterator may be left pointing to the newly created vma. This happens when inserting the new vma at the end of the old vma (!new_below). The incorrect position in the vma iterator is not exposed currently since the vma iterator is repositioned in the munmap path and is not reused in any of the other paths. This has limited impact in the current code, but is required for future changes. Fixes: b2b3b886738f ("mm: don't use __vma_adjust() in __split_vma()") Signed-off-by: Liam R. Howlett Reviewed-by: Suren Baghdasaryan Reviewed-by: Lorenzo Stoakes --- mm/mmap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mm/mmap.c b/mm/mmap.c index e42d89f98071..28a46d9ddde0 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2414,7 +2414,7 @@ static void unmap_region(struct mm_struct *mm, struct ma_state *mas, /* * __split_vma() bypasses sysctl_max_map_count checking. We use this where it * has already been checked or doesn't make sense to fail. - * VMA Iterator will point to the end VMA. + * VMA Iterator will point to the original vma. */ static int __split_vma(struct vma_iterator *vmi, struct vm_area_struct *vma, unsigned long addr, int new_below) @@ -2483,6 +2483,9 @@ static int __split_vma(struct vma_iterator *vmi, struct vm_area_struct *vma, /* Success. */ if (new_below) vma_next(vmi); + else + vma_prev(vmi); + return 0; out_free_mpol: