From patchwork Wed Jul 10 19:22:39 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: 13729606 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 D50D4C3DA42 for ; Wed, 10 Jul 2024 19:24:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 997766B00A9; Wed, 10 Jul 2024 15:23:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9201D6B00AD; Wed, 10 Jul 2024 15:23:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 643236B00AF; Wed, 10 Jul 2024 15:23:48 -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 1A1C76B00A9 for ; Wed, 10 Jul 2024 15:23:48 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C8F5580235 for ; Wed, 10 Jul 2024 19:23:47 +0000 (UTC) X-FDA: 82324817694.16.39282E5 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf08.hostedemail.com (Postfix) with ESMTP id 907E8160021 for ; Wed, 10 Jul 2024 19:23:44 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="AX/xobzN"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=VKP4w5zX; spf=pass (imf08.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1720639408; a=rsa-sha256; cv=pass; b=dfC9xzhL4EyWFYCByHoJfgsh/4B8JjI06KTz7P+kcmvYCV7jUXbg42foJN7GDyu5hvJ7tO v3ly8tYQ2rDM/tPfpgNiEyBbErqsNtQu/e6Z8RU1IWyrBjo20S2wRfKqDWiMTrcQLjOYZr JElaacEapEJ1r0vkKHE/Ja6vJu2Xjfo= ARC-Authentication-Results: i=2; imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="AX/xobzN"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=VKP4w5zX; spf=pass (imf08.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=reject) header.from=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=1720639408; 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=DoMwpLBw9WhZL+32pCwXz6AxsApbM/3+qs6lMKa9YfU=; b=F7vv71WsIRu3d6Wehb1cliaGvMRPH6FZUMlBLPrBuzEyzLIsHwgjOtnEu4r4cXIioZtd6H AOdvwOQrId6rDTv+ltRW3GX6hou+XzfLmfbke5FDZ57cNVl2uYmWUH32laFI5mqG+4/G3z j2JjPrCBPWz0y94iTjf7fCLGn+MYCKU= Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46AFnCs6006199; Wed, 10 Jul 2024 19:23:35 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=DoMwpLBw9WhZL+32pCwXz6AxsApbM/3+qs6lMKa9YfU=; b= AX/xobzNpcaC93CQ/gONwDiwfTlO7M1FYSPrAbQ1/WRzn4Csjaeo/dSiWNZbEnFf TOW5u/kcKIFHkm0PEiXk3lbtja9apMp3A6KNX1BE6gktSFzKfCOKjQr+MaZ3MXiX klj0WL/wdlgf/ZK07/GojAdVJEb+nbAcQC/P8XZCUFHN8P6sTspo1ot6ElLKU5cG 8etjuqg+vM+HUojYC6xmFOTnllXxa0m1LMVxTqD21ou7i6FgrpaVGEnKL1UzS1bn WWKOQsMeyP827amwmIK0wEdbhxmxngVJr0xxVGU/xCTIqt49toWLhbtS851bLtil nuHCm9Luykvw8jR6woU6qw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 406wknr2ef-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Jul 2024 19:23:34 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46AIdNi8033802; Wed, 10 Jul 2024 19:23:33 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2042.outbound.protection.outlook.com [104.47.70.42]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 409vv194ff-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Jul 2024 19:23:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EgnSyBUxoMFG2pJKEvwTuoGMlNrmfyWVvdl9hKjdJ3s+ZX/iNf5K456AAcspMPd980gt0Gevs+pITuyfWJboC3iH1A9j6gd8tYCCgJXHJ5xDh9SX7faF+7GQbCrqS8X/jZ6M40jYjI6ZGLVY9TH1LOTTeMSN5/0eQNnsX97Z/kRT8n6G0IMThceUTUyLXQTdMsk0fiNoTioYcqEBA+oJP7rvpkE9rpq9D5sb6sIkHwdxbUjw45+j1hiEskbD6ZQls1UBZkMRz0IuAQH0SvcC+1yIaUx8H2P1LAiuAxm8meLClO1Pzab/uSHGOfh5HDiN8LLJoMswej/xzEumr3UeZg== 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=DoMwpLBw9WhZL+32pCwXz6AxsApbM/3+qs6lMKa9YfU=; b=Ko46QYqr5Hv1LabKsd+DBcVHPp7lu1JrkDII0JbXUSW/Z/SMg36qtU6mwz+AsdwwnB+IgU30D6yqLquUol+7liRGFsCdzlj3ITb82qiEubuYjPSZYPaxmkwfklmEqLOh/j55NV5bI6yQSxp/TNgSV+3jU8mf50s1WCMpbsMm2sODWN8Cgt/zpwMYtFlkPlhlxDgCxffhM0LH2v5qMikU4TZc046EvLxhJ9N4RPvXSIw9YbCPH1/Fiz8jdyBw8jKshald/SI6g4t6+Whgv/EuUBN0dEz6RO1vFmwgDuny2btiOSSIev8yiPrELD89lJ/JZO/O+/lXRmvDab3NzKL1Wg== 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=DoMwpLBw9WhZL+32pCwXz6AxsApbM/3+qs6lMKa9YfU=; b=VKP4w5zX3yXehde+vY7BX6ZPojKjD+MQOcOORfEZB11B7cYI8W+LbfctsYgs3lSKbZtzBckB7QkzXJnDQzTtzYuIg2aOaW9TzBDaXPh7Ph0W6jYVyutV6XejgO/9+TOlZsneeJUkSu9+yqqGNIZscdJ1bWjlzUsQr0STGXyv7QM= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by CH3PR10MB6833.namprd10.prod.outlook.com (2603:10b6:610:150::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Wed, 10 Jul 2024 19:23:19 +0000 Received: from DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490]) by DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490%3]) with mapi id 15.20.7741.033; Wed, 10 Jul 2024 19:23:19 +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 v4 10/21] mm/mmap: Support vma == NULL in init_vma_munmap() Date: Wed, 10 Jul 2024 15:22:39 -0400 Message-ID: <20240710192250.4114783-11-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240710192250.4114783-1-Liam.Howlett@oracle.com> References: <20240710192250.4114783-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0049.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:82::30) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|CH3PR10MB6833:EE_ X-MS-Office365-Filtering-Correlation-Id: 51974674-f6d4-494b-28c5-08dca115c0f9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|366016|1800799024; X-Microsoft-Antispam-Message-Info: oSNHtG4DTfLp+MkrWyPE1YwNni7hjS825zrcZWZowPhsvrMTAnxN7EYbiArjwmnv5YdKd5B0XmjTOQN5H2liMBO2TEqoh0VIanyxzijuPHsyTB4RlMtCnotzKI7tkwED82fkjgiczEmbxl2vFBHyzM6cFvl1n7K4YxJ/MmLkqtIQ7q3GdFVlBZKUJJGhvapODvU72I1u2VfYv9jv8qe+98KNPCh+NQ88uZb0aUiwO7gZJPRrXBNlnxC9eMDFy/SCc7gpGu75E+loSerXhwLqec6YHCREtnZg5qWr9EBk99Za+rNTtcK0sZLEEx90sqRP8unNLuwUIfqmu6hdt4A0IGbPplfwjlqzCf6JKU3LBzEhRtdVRO5obv//Ahhx52d1w5Rqw62+c4eA7nHxd6m3UWeE8nX9evsBnSSJGgskToZlsaRp2DwFjDE32eg9R8/su493jnriywNJMSG9H01m72qTXUu5wXr4nYALpheCho3cpmRlhLGEGbf4wA+iZlR2rQJfAfYdfheGvKbrVkt6rHFE2VzRPqAfRGoRihUbVfc65jJfIMyQ6kA/eAqbX8TgTBO3w0jDVT0X/XDRvvDRiYpZl3/TshBpXQYgVezmiC4lFPsuEpxpM3B/SGV2StYgxuxajl5yTmd2wXpIiNW8eryDxapOCY3nM0uVfMkCtuWW3RaW9QfVi611juR0IbI0AMogmuKkD9m95pKNheJLGNwDt2S7MTxcJLis9e6HzaEQsgd3nUiM3eiy/LSece9kWnSmlXaQuil/VaCi4az42eCsf3uoPsMclLiVqe+gG3qNsfM4XBqz3y1X2jWyJSECMLySzuwgdg3cvlh8+VbZxRNjHjrHUhRfa9DoELFfn8wsjCmty8lHJ5RvEZWD2jwYqSSki+ccY3V7bLINZVxQR27viw+uZOAw4VJcd6ULNJHKordtl+wRY6k3ESJ5ldXkF46yWm2BDffjSUNYDRZtRPW+gGXdMfpLYD5e8zqWZJSy7+PdWmKxad2Wv7538nNbX//PCkjdRy5qD/taajypu/bHiyLG52OKmZoh+9UGYV57ajv0JntDVTyYaWq026ZJc0D7mey5LFPz6JsF1pUlRrh8F0QQ11ryZQOmYk3YFpfIzGS3bHwC2e3SnojPKH1oS+3y8UGcjC2dIUNjX77drV+0rD/TA9D4zUphsVY1NlNOdXiYzqrWBPU8GMzvMga/eJdhQ8XGdBAHjL98SCJAs6cLUxzwh6e4pmKiMxMlq081STeD+6qzWVPL8oMqK4jiHU0GhY/fIaxI5V689hVMjw+oiDAXBJn1fNUytBEzSnV0NOqFjZ6XMiiolB9yLODqGZ4fD9u/3Li9Kj7KpmS0Ow== 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)(376014)(7416014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3LuM46FgQKswdonzwdFgjaEIprrEi+dkQyn92kliclItXbm3sLEW3QVCahKKMN8SiuqQXL7F44FVx7JpKQ03w02qgcZflP//FrmbxoP5yp6/qPUgyiY7ImcL3XxMdWzO9Bc2Foe4c8noVNDyXowkBJYBO3IEi6FU0f1YSX6A4I/TUDuoMs+NfnjVgDqjUmZzJfXgMRiJTVkLRwHp3y+Yv0UP0xvuV5sj3F3XFij+VL8eaSmXUgkrnyIPc9sdp90jOLVpQf8XKuZ2l9jfdh63IpA/VTKNqxn8USo85uWjabmveSDAYkpX/7EBUZOBD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ZQFLCQXb6oAxBg/GAstsheKnanAMzNav1qSYOkrYHg/Mw6xwU2k8p5wy3430y3i59VTEfTd1T96rwR1aT0RRez4TxuOyseapfMhcO4df4mcBHRbuJZLnFB8dfGRoPkVTwAKddmm13NfYcULBrdWpZ3UqwUqz3XsbmKHMKKlWw0mcfED8k7U2CDdakTjdZktNUGmYWnVfaEtjz0Pcl/Ts0myQDLKUMg== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: PWo0GIJx6/Xt93ZkvdGvk9r+KmioDa+8Z4hYR3J29T6Xs0NHOTs9+EpunKujPI/8Ze8IF0T3GCMTQjV8bdBTx/escL9Bf2yxccj69jl0vP6d2M2LPX5Od1DASnGMYSpMuVAQWBMk0zVmXiaBRg4vKvOubvTpP1pZ7HQFUy+cU12uvFvSCxFIc3nWe01Dqn1ishB4VRyhldfEHI+Y+U50U+38Lob4CybyNPU3QjoI5ea/mLfYBKUBKn2iW0SfJmF/s1XaNtWkxxrWRu5/jND5d00Lo25CX79zBPzo9Jd72Var15obEIqqH+TlXEWFH5V3lxJqjvZs8CSFwXqeIAZqaeNXw31qotg8YGL/b85I45JDy80llnteent8PCh+k6wjKHE1dSS0dFezlvaUUYheSrtgxeVihYxoIo+V/IkAQsI6XckF+2MZprAtgKBuA4XFiUREpfUjWEiH/pxRDxQb0/t7TrZnkSploXTatX2I0pFdsNDxm7OclcUrjj2LqWp6V8RQmKCaCC5FDFszvJtOl+BKTJRYoNiBqzgu4YLw5c31aien+2yQEZw3ur25KibGxu3XFBj4c+Mnv7dr7DoGT0BYN7xR71rnkl73tPCpyKw= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51974674-f6d4-494b-28c5-08dca115c0f9 X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2024 19:23:18.4500 (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: bAhFBDL2SORemJW3Km1K+BOXNx+cNuZbYHGzMsHsoYJA/haQcHgwTWQDNk2NtepT7JlFusdL96pmcjlkorBAlA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB6833 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-10_14,2024-07-10_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 mlxscore=0 adultscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2406180000 definitions=main-2407100137 X-Proofpoint-GUID: GtRhqp71Z-I9pTRdU62fMwZ50ePWkO4H X-Proofpoint-ORIG-GUID: GtRhqp71Z-I9pTRdU62fMwZ50ePWkO4H X-Stat-Signature: m1o6kbnrqhtyf38kdceztq3xpzff6i1k X-Rspamd-Queue-Id: 907E8160021 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1720639424-939655 X-HE-Meta: U2FsdGVkX1+0ggpRtSt0aMJ+HefdxonNewYyHg5XLBajmxJtbA8Ufcmk6zLGcBeTZ/YZoRg8ZTFqxptszmF2QLZ+QpqHZjK441dUBgidc6B/D0tDV1kpkQVGhLNnlCtWgL6EizHcfGuG2wad+BP74Ll/5gA/3fUG8J6NYbaXefFNq1gEL+ck2kccVx6/gg3/jegJb+ADqgqdo9vJDQrjQSrfG2uS3S8CZaBPcU+g4402rKW7mDpxQpn5bRAB5DXK43hTM/sjjDdws32AzCP0dMHbZXuAx5VSdzrhBqE/U/7py90k671b0C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/Yz01sGxX+1de60jNk+xVBtwDjruelIFgksspyrJTZ2KOF4Ewm7Ja5fDtzXq+JjMP1PDxz0raoguiQ4BL2jOyhSY7RAd6j1FZMobeCH+rIyR69le8d+zcyUavA+5UF0Eh3U= 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: From: "Liam R. Howlett" Adding support for a NULL vma means the init_vma_munmap() can be initialized for a less error-prone process when calling vms_complete_munmap_vmas() later on. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index a1544a68558e..e2e6b3202c25 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -516,10 +516,12 @@ static inline void init_vma_munmap(struct vma_munmap_struct *vms, bool unlock) { vms->vmi = vmi; - vms->vma = vma; - vms->mm = vma->vm_mm; - vms->start = start; - vms->end = end; + if (vma) { + vms->vma = vma; + vms->mm = vma->vm_mm; + vms->start = start; + vms->end = end; + } vms->unlock = unlock; vms->uf = uf; vms->vma_count = 0; @@ -2950,11 +2952,11 @@ unsigned long mmap_region(struct file *file, unsigned long addr, /* Find the first overlapping VMA */ vma = vma_find(&vmi, end); + init_vma_munmap(&vms, &vmi, vma, addr, end, uf, /* unlock = */ false); if (vma) { mt_init_flags(&mt_detach, vmi.mas.tree->ma_flags & MT_FLAGS_LOCK_MASK); mt_on_stack(mt_detach); mas_init(&mas_detach, &mt_detach, /* addr = */ 0); - init_vma_munmap(&vms, &vmi, vma, addr, end, uf, /* unlock = */ false); /* Prepare to unmap any existing mapping in the area */ if (vms_gather_munmap_vmas(&vms, &mas_detach)) return -ENOMEM;