Message ID | 20240717200709.1552558-9-Liam.Howlett@oracle.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 F008BC3DA5D for <linux-mm@archiver.kernel.org>; Wed, 17 Jul 2024 20:08:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 07F006B009D; Wed, 17 Jul 2024 16:07:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 02C656B009E; Wed, 17 Jul 2024 16:07:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D27B46B009F; Wed, 17 Jul 2024 16:07:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id A9E486B009D for <linux-mm@kvack.org>; Wed, 17 Jul 2024 16:07:47 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 5E21E120C86 for <linux-mm@kvack.org>; Wed, 17 Jul 2024 20:07:47 +0000 (UTC) X-FDA: 82350330174.23.18DCB7B Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf20.hostedemail.com (Postfix) with ESMTP id 2CBC11C000F for <linux-mm@kvack.org>; Wed, 17 Jul 2024 20:07:44 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=WoP01W6O; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=gRdLmOrs; spf=pass (imf20.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=arcselector10001:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721246833; 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=LArHVtRPmTnLL4Ka/8b8U968Rn79AaiiLYmA/o/M1Rk=; b=lI9jl5mHDBwUEf6AupezENkbodTsDHHLnzIjYtX1NHZQrl1vW65O3uFxa3GJgxHBWACqXs gCAVx5q6jMJlR5ctn1QNu8ordMGamPYGvigg0XKoYCO71aO0YlsENMswsivh+EscIEO9kk jhb70NU0jTaiqzD3sckZRNw7Sek/nb4= ARC-Authentication-Results: i=2; imf20.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=WoP01W6O; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=gRdLmOrs; spf=pass (imf20.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=arcselector10001:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1721246833; a=rsa-sha256; cv=pass; b=BUOjE+W7q/nLSUeF0zt7ByHlOAk/on3P7VCdYldKGNV4TVprZN/Jlo/K4Uz+qs2z8YHco/ qwGz+EjDImoHqBPaMW+59LGymJO6X8aRC1U1Ov7PxC5iw9pxrcQizicftkm1XKcXqxrXnC 0LuivSd5EehMbF7hFUbHW/xB1PlYqbE= Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46HK5ARp002719; Wed, 17 Jul 2024 20:07:36 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=LArHVtRPmTnLL4Ka/8b8U968Rn79AaiiLYmA/o/M1Rk=; b= WoP01W6O2dx5J7hrolTh2BTrFkXgiRJxWftRVO31nsM3ejb7sWpyblYNhq9FINFy qVKK9mkd3VOsvh0kgA3NI29r647dUcjOGcsr4f5pG0mgydkOuvSCN3qREgEfjjV4 sBqL6pDZwKaWiy5ryxnxOKbLIHnuSpzKkY92RLhkcxhFU38wC9dVqh0CcDxQe/94 VzflUDHYMPUMAn5PDcBHO1cTVx/e11aGTxc1oVcI+z8bJ+1v/yXXcJcYmJLzb4Y0 x9Q1GnXOJta5Dvh9S7TgnhBP070GXMXkF+sBpIZuVDivfr0fFOxpuL+QA8y8FnD/ pu39rxOJqzqkNkTrqf2UpA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40emp5r07h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Jul 2024 20:07:35 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46HJbBG1031594; Wed, 17 Jul 2024 20:07:35 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 40dwexugm1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Jul 2024 20:07:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=obBGr4I8KZ960gCY2GseLrSq8ExxoDbiAMMGnRFUltnFB6bOfbiAoSxwUO/FC/nev5QO6kXhqc5h4GquHALFVprCI1ZSZTfJBDjQCa9tKthojmmIpvCtG8YiUllyqCwvs5xS54TpVlFAUgYHxTE4PiesnQyMN3uV07NyRAlNCqpLLoP8Xdh/P8q8gHBNvlb2F3m9a8v2zLl+L+LlrBBjumNWdR45/z/454UhP8keYSgayVkGpEzO1ThMyqvQEZwKTuUQit+hr2K/nLGMub/QFNLxN7RJe1CI/CfNKPCcdUQU15i/sCwF0UT20QCg9UhxBth49ydxe1ceQ7T1lllZKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=LArHVtRPmTnLL4Ka/8b8U968Rn79AaiiLYmA/o/M1Rk=; b=BeFR2QXhKkiBecpgHGQVdRusWjdyYdCBNVh6g5Snm+JIRVfF+likh8Opp1Yk6r7uensTSAkoa9qUKs/iwbBVItWF8hoD2U2put/Ihi5er7u1KmpeZyQ3RHEuPSU923GZi0HuO1LuDLmtTkP+lc0UaessujRVUR7rS5tEzWOwF/Zox2o0VBK0IzVGr612OlYpSJkWp22AiCJGPgT7p00YN3itnmCu6U7ua8/3H9rccK9R6hfhpiUi48qt5i6BXePNKw0yUfUOpXQXjW2L+yigyYN4QDvDIn4JgMe0ZVblonpMrorJQ8X6PmNLX/2eia3P0shmg5k+r7OeMS+ECdfH1A== 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=LArHVtRPmTnLL4Ka/8b8U968Rn79AaiiLYmA/o/M1Rk=; b=gRdLmOrsmYgbKwkN2IRTRnzii38TAxpQu0jytbhkXO+OmES4ROSQchMdT9iIQfHjb9kA4JSckGzrfaVtfk08EsVRkEKmdiTGl5Af2MJZtNXaY2J++XCJlkkwh60LlWky9ByYNZNTT6oNEj+KA50L16KKkJXy5f3kSLJKW8R2XfQ= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by IA0PR10MB7303.namprd10.prod.outlook.com (2603:10b6:208:40d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Wed, 17 Jul 2024 20:07:31 +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.7784.016; Wed, 17 Jul 2024 20:07:31 +0000 From: "Liam R. Howlett" <Liam.Howlett@oracle.com> To: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org> Cc: Suren Baghdasaryan <surenb@google.com>, Vlastimil Babka <vbabka@suse.cz>, Lorenzo Stoakes <lstoakes@gmail.com>, Matthew Wilcox <willy@infradead.org>, sidhartha.kumar@oracle.com, "Paul E . McKenney" <paulmck@kernel.org>, Bert Karwatzki <spasswolf@web.de>, Jiri Olsa <olsajiri@gmail.com>, linux-kernel@vger.kernel.org, Kees Cook <kees@kernel.org>, Jeff Xu <jeffxu@chromium.org>, "Liam R. Howlett" <Liam.Howlett@Oracle.com>, Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Subject: [PATCH v5 08/21] mm/mmap: Inline munmap operation in mmap_region() Date: Wed, 17 Jul 2024 16:06:56 -0400 Message-ID: <20240717200709.1552558-9-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240717200709.1552558-1-Liam.Howlett@oracle.com> References: <20240717200709.1552558-1-Liam.Howlett@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: YT4PR01CA0108.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d7::7) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|IA0PR10MB7303:EE_ X-MS-Office365-Filtering-Correlation-Id: 79b33095-407f-4e47-bd6b-08dca69c16f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: VtiqM40uxJX7F0NidoNF0nGx7Ppm2TEWN2JAkHwGa3B8PhvOiB10Hwyh1JvJGXwQCDTDtPuZYwBHT9g5RhaSDh5svtYbo8isASJIDzVtJhkxiT3VFL792SKs4CXtQy0wghJhO/4i4tvWU42hN/UXceKm3Sjyu3iUTEmm9PatoWHV0eVKa37x8yXrE0Y4I1QLH8MW2UVD5M53mdEKklJc5iunaqjBYWkbVwp0j1JeUlxwLlk6mF7SjAI1ZuTi92PYnpZlDMtAanKWNHSMy/OtzhrUmXE58rJep/H8tUZdi10T28JywznEYH5HH+8XkqUFfePmW+OjL83DRD6rtLPMhd3GSV8ylDB6Lt03XiTptpDd7ADKukmb8x7770WQpHmD0D7aY+lKxrn4QRJa6oeXO088Yj1KVVE3hAmZQl41Nj+H4oYPFTM/B3ogrb1wOjLc0Rpw2NM8YuschadxBZ5dEPU0eXAZm46RL+aZhiFMDhjhszWzA++QCoSQxkmjIjhDtngrP4UIBn4Mdz5+n8VpnKdDlMXJGKEEfQbjYGaT27XO3d9ODD9D6K++4bqWo2gWsTZWFlJ8FOLGr/hX7DB6/Eqj5f2iAn1+uZPpg53REWQ4G2oI2Io6Mio4esqU5GjtF//15D7IOy2Jpx/AMhq6gWxfD5yFn5P5rsMykqhcXoAJdalqgFYvm/wrxaZ13AwpwvtIj5ej/JSDMuwAo3Lc//ych3o+oxdPTwuoy3OGXvwFwav8vjA3msaSWXcKFmvxqfHNtIgNbgaMFCMAshg6GwCgzgkAYyZeXqILW6kTD8lVpPu96Fyi5s7AVl4F4VWQ/i2NPJQpZ+Ax165h7GWmF+b0OJPryjgU0QztbplR/5gntCr0sN4UaFaw4MfB0MrZtxX0VtaCd4P8tgJgvWLj7HMZpmSGeIgGPJ1h1GW1lFSGE2fNMq2N87NeghzsgNjI/pqoZuYnodZXVLRdATCeXuOB6lGoCXPDP82ZrWgfgBxVv+moCTCKG/6uy2HlVIc+hJ2GnFyUd4BgDfCeIceoUY/x+1wNcpVK6FL7l83TOCn662P5hD8E9FO7e6oaaRMo1jZ+30+QEkGyjeC3WopXGnj790iXK/D6YMhaime4sBC/iHzzY05bTkjR/T/m2vnM3b3ObMQoHNQiTjp3OjkDLOouPJpaHoYeXNQfGJpmw0E5MxNnCckFcNla8lkNus765/xUS6BgvthzBIVVDWUdRExcfSJxflLk5bREkkKg4EcdbK4JupPiNX1YPPCX2zdQGLLBff9S1wIUaxgYzs6Anj7pqLsXrSWNqemX1xUxhouOMDl2b5N6QR42Qn7Q4BpcERobCRIBuQm8qtNmweDbdA== 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)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: z7WN8qd3KH7iEiTEK1PxhX6oByaCv6RImUO//W5OkfxVvppVsPEldeIs4r1/DoTFsBv+B+SdIPDhSK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z0bMVDEbqKmvFX7rblPmPuddAjSyUZcdTj34KE2hY2XylhS5GZ85krwnv8hRsUxFBrFvbP+nFnHnDHxM1m0ZdiLWnxaq5w+ah8d3xLleHlTQ/D2yPWRH/VqDlbTtK4mkVIkWl1KyW2Ae0hwcv80pnN8nLPvj+jJFwvC2QTnIZUXvqCNXIvx5V02dqoNfW3YPIhafQBaZ5toSV/6JsOierPf+uKGPICD4VYkQ4GkufwE08FAnVNfsfNdsPMX9RGJklR1FVRLHWcll0rGS7gFiEwl0RrtL/QqUsVMwca7ceVllcAp65kSNAoMCH5yMaJctjq0XABJ06QkCvlKAVewDbLnIQZ80CiS3LI0qDkRFBwqqvnXCqLLA8JeqacxQpEVUC+xxdjew7REaUNRvKip1iHN35zbX0VtWwO7itiSVaD4SNdDQbD2jckZy44yE/YO7iQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: hg04Y/uoTAYKoHdE23ks33lRiMzFCV8JFUb1SCHZub7a2/CGvDFZ2/0GZI3jPC1o+fN6dtru6qvH7/Xxew9gMI9KjyosM5yyV3tjBlItWaRdnm0XgCx28P6L1B9Ff3bPs9arvc/kfUSa9adNRNXpqayybwtc9QUhSFF4GsqQMUetkUoute7l8wTdsTkdQzKc6Hb8D+3ot2bgC205A0inQPzjxahXFMfcdHeNFSctKKKbmueI9TQtw5nDKKRWQmohE+wvfPW7bpmBTtvE4rJIQC2DN+yyTgQnUerNB5MHyUbDhy2vO5zcKo72Lvr4hPueh/eXZqan0i5C38QfTXd9Co19vJUVHDWaguaH7wEGde3akALf0TjoeAPeRQHclgTNPvXSOGY/wRst7cmfQ59h288SC5iPP7GPWsHdu4ixxdHrwQ3CJ7ertvI4pBJZq6bIh7335zWKRO/HA3AjazH9C1GtLMrE38ORXHFYx42xd6Mqki3xDmhQa1LYY3V7AvuzDO0aBedE/QJU2B1uEKbmHLeRRAcr8uHAzZxRgBxIijHlxaNbVWv/4eXkoiT+nU27JnQs346jXQKg3K1LNfYeeZuNTGYr7vgBD4vhDOEjZhc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79b33095-407f-4e47-bd6b-08dca69c16f5 X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2024 20:07:31.0914 (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: tFaQsn6pQtmetdFzbtlWdRTaTAlTWXHEwr8nyGoNxtoG4FNNpIJ58AAcfsale5Nuric7ooHTbT2rQcDBmTcCrA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7303 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-17_15,2024-07-17_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=993 suspectscore=0 mlxscore=0 spamscore=0 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2407170152 X-Proofpoint-GUID: IseVej541CAnO5fNrz3YmBtFU580LOpk X-Proofpoint-ORIG-GUID: IseVej541CAnO5fNrz3YmBtFU580LOpk X-Stat-Signature: nfco5ufwpkxa4tpq6sd4r3d6ki6987x8 X-Rspam-User: X-Rspamd-Queue-Id: 2CBC11C000F X-Rspamd-Server: rspam02 X-HE-Tag: 1721246864-520981 X-HE-Meta: U2FsdGVkX18FJ0jx2hqn6hWq1Mf8vp9tzhQLeElSM2FJb34AA/WtKaAAmDfvCloKjmFBilP5gUIioJVT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n8Vw3yafsJL5xBMHSWOzDCQ+vxrg4Tlep05mYJh/CU1KWqOo8yrmjlN6F9x1vDqmL2V9IgjChuoN3JxrnwNwyHvasfVMPQt11qNRM7CEXLFy5ugr/JLUAf2bqKpGKF+JRy8Y39hihPBzH5XKlCZmr7iEgQa3utnXpyl8r0OP/NkVp4FNRMjOSeIaJcjuWfkef7DnBZzT22ufkuJILE+EqAgb6taI2DxCp7rUfTxNWvt09356SV2u0Ex0zQWfI++D/s5G+6NSfo8wgo2fK+Ulu0y6Hh4GGpYeX7CMCtGeJtye9aQwTp+r1LvigK26pqKvEG/mIgaebdW9gtG7s1lU+VM 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Avoid MAP_FIXED gap exposure
|
expand
|
diff --git a/mm/mmap.c b/mm/mmap.c index 1c9016fb6b5c..49b3ab406353 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2938,12 +2938,21 @@ unsigned long mmap_region(struct file *file, unsigned long addr, return -ENOMEM; } - /* Unmap any existing mapping in the area */ - error = do_vmi_munmap(&vmi, mm, addr, len, uf, false); - if (error == -EPERM) - return error; - else if (error) - return -ENOMEM; + + if (unlikely(!can_modify_mm(mm, addr, end))) + return -EPERM; + + /* arch_unmap() might do unmaps itself. */ + arch_unmap(mm, addr, end); + + /* Find the first overlapping VMA */ + vma = vma_find(&vmi, end); + if (vma) { + /* Unmap any existing mapping in the area */ + if (do_vmi_align_munmap(&vmi, vma, mm, addr, end, uf, false)) + return -ENOMEM; + vma = NULL; + } /* * Private writable mapping: check memory availability