Message ID | 20240717200709.1552558-10-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 2D388C3DA5D for <linux-mm@archiver.kernel.org>; Wed, 17 Jul 2024 20:08:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 29FEE6B009E; Wed, 17 Jul 2024 16:07:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 229596B009F; Wed, 17 Jul 2024 16:07:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ED5976B00A0; Wed, 17 Jul 2024 16:07: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 CE4856B009E for <linux-mm@kvack.org>; Wed, 17 Jul 2024 16:07:48 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8B37B160CBD for <linux-mm@kvack.org>; Wed, 17 Jul 2024 20:07:48 +0000 (UTC) X-FDA: 82350330216.05.67F797D Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf08.hostedemail.com (Postfix) with ESMTP id 54FE0160017 for <linux-mm@kvack.org>; Wed, 17 Jul 2024 20:07:45 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=RFNTDkub; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="0J7QU0v/"; 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=arcselector10001:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721246846; 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=X3v/lo9AxRmsHNZlKpTsm76kEoN8cW2y2gHVgYbRbTg=; b=dH7zVCiWPOIAKwn6zhdWxYzELsZUtI4cBe2FjA2nVsqZYj6EfR+Ljwko2kfrrTd+WfJKdG YFzeO4T2vuCmbTBk772mx6uwiCVG/0ODrIVaEAuRSSAw87bsYXguAbTLZvNpnM6+fqvAQ5 bRtx+oKJirysPrtv40ZQbL0dxWvnOgQ= ARC-Authentication-Results: i=2; imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=RFNTDkub; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="0J7QU0v/"; 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=arcselector10001:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1721246846; a=rsa-sha256; cv=pass; b=4QB/LCy9PrIkGSNrJxdLkhM2B4IGHjD9BJp+ufE0iiWTZQb8OlbUE/NirKz82HziUYy6Rw Z+ZpEXTAJVr4o0Wzgqql8S0eV9cDqCzUG7DGbgwVk+dO/qcLFoWmlwUWJuN09hQdm+M92/ lD+ShiiPnR1uE33RS97QeHywqMU0bl8= Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46HK03GU028095; Wed, 17 Jul 2024 20:07:37 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=X3v/lo9AxRmsHNZlKpTsm76kEoN8cW2y2gHVgYbRbTg=; b= RFNTDkubyajNzrJwx6ZDN/vhGbvEDpeqiNNi5Mnf8b7JNjeHq/cJsTq/rKcWCctw nYSlz6c8fwzJg/pq6UZ/8gzdkqbrwWN2PE+OizSrk26/ZBInbJSh/yjzubP+OR7k nZGy/5HO/FpYvk5E8VFQZlg6yFgXPi7O39X2RET+q03xuTKGxY7Dr9cIc1ixFCra lbEDuIhZ+Go2el8crt6pPT1G9AJ9oBbt3pHRz6YYe069lZzUnbCnRl+3PSHnBOqO SPtaHgtZpVkQfrUCgp7UVOdWcPukSXUOaUJrI8hzEOy7jWUmT3D10QSgEgUAMnNN yLGtYrkbBKyBuLxihvJVnw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40emkyg19v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Jul 2024 20:07:36 +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 46HJbBG2031594; 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-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Jul 2024 20:07:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hQvRXb8zmbUCmIFsbBkZQxh56Wpz0vk+MYZRGfCuMMBH2s74Nd9ArCzCU0sVvff+H4iusG/zy9YFQVLOotAmhu53CnqxANZ92x5dIKzGPEk+t48JhO2i4TcsIdEt+js4zY6R4yVKsiLGXqhgg7TTlji7ugb22IeVbvpLUuXw92h/XRUUtzju0WkvNIJSBJ/lBfb6ndLlA9UVZ4AmhLh1gcFto2qWvXWLBzIc1CACOtuSnX4BIyzhODTr49XflsHSL7IJv0Kmf7FJuLq6IoltYrA5l4N2wCnQajt2bYFF/kRH3Hn+7vWEv5K3dDVcdYgQiU3t6H+GZZml3yDiD6/TYA== 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=X3v/lo9AxRmsHNZlKpTsm76kEoN8cW2y2gHVgYbRbTg=; b=U7lcyOBhem7ok97IUqR60TLgCUE41U8s/2WYUDdRFkq+KGnrsJH7XupLlGf/b2p/RaIb2K1KZGXmCTt8LveHNJZBch4SKpj3oqjo9rUeHtZtgGoO2cDdy4Kk59Jyum5goq3D5ryDtZadkImBdXXySW0W/t3zitxNZ1AfB4F3Wl06wxzQvmexuGg6LY6QdacQ5GndYtxTUeThct7a5zjo9xng8ICiMm5i3xqMLeVPJhidULRcyjDLz6CzQmHi95rbIfLIKaPLivebrCKIyDRIKCOp5lRHa32jR/JydNfQ+//vXRmNY1mrnxCnnhonubVZkRYmFiHK5bt90QqURSzliQ== 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=X3v/lo9AxRmsHNZlKpTsm76kEoN8cW2y2gHVgYbRbTg=; b=0J7QU0v/k2GR2ZevAnfIOJl8WdKqeRIo8UBdWowgkkioJX8GKFVJnFnkX4Kf14laPxlahfF3gL6DbDYBm6glmw4Wt/giZw4IxSaU14AHi6orPWmoSTCng/sDHqjxwJP2+e700tUQFWyAGuZWTFVMFXcaGpfFUyjP8uGE7tL+YR4= 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:33 +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:33 +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 09/21] mm/mmap: Expand mmap_region() munmap call Date: Wed, 17 Jul 2024 16:06:57 -0400 Message-ID: <20240717200709.1552558-10-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: YT4PR01CA0143.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d5::18) 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: e8a147d9-c97c-4eca-7d80-08dca69c1832 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: 41206tqtRPNEeQ9WhAN39w7Pq4AoKu76S1UzR+/ebq19EOvcNBqnzLhBbgh6ccRyCfiASN1N8Jf5oe5qO73kP1pRHyKIufnSb9bxC82R5c7/rwl7f1sFjcATeu8cdQoFmJMiGNyE7k3BvglPxB8lx2bcWkN4y7YUWOYGbCi93RQeaWSgWTtU4h0/vLGkC3d/SzM9BbHLqRZxyRTrCtckfnSwdeMVf9kFXd4pwIZ6HKqCtTBK6UQ4Qj0q5p/AYoS6vV5HRjPS1Ko70oKjQ9IwLr783DlqVR2OM0xHrAp091MCjUrUFmVX1u01S3D4TB8EkCWZdtAg8ndUcPlZwetzSzyECcvCSbbgBiZwSKvdRtG0+pDi5X5I9bpqd/zW4t4qWBJ38qzB6+RLz7k75ZXLHREn/nZZUACIu6TR2+3c5e6hjO/eEiZnbv6/9d5mYdSeHmEcEAIW75tLUqtQ2zdnYmP4cP61ypcopefEIHBB8MsH9giHqhJRSdtWB3txFbEIFhga5rB5E3fqs9bw+CaN7bwXS9XyfEvDadac/pVkC98AQIhcOJdrKM9Vx5l01fFFWT2NFOSD8VtIAdSvOw813D8sYWBTZDyQeyhUI86IZ9MYCv5VzaXvtqL/NkfR0MxS0cRsNCk3pgDdXmscCc0q3/QoLUL8kF+VojrtNDVfDBs2zjm/SodXoOW7AAS7MUfeMnYWbsnZ5xPVdp11G4+9p8IvuqOOYbyaAUikSbx1l1bwAQ87RaNtUvgdZEwj1cVUFhSpGNFh1ZziLtmh7ewrTKG674N/mRZjGIDlZyjzY9RH/PbfWFo7X31UW/PHDjJ4xGNu9IsA1Kbf5q6E/IaoD7TlF2qyJdrKW/zZbApMi0yIYmvF7OgVgbUwxgZcetiowoXDMT0/nO3b/Jkz0fuwkwjgvJe3mHhsvLUaY5O/R+g7kqRAy4Jm6eFP91vP69E+7eyWXsIcwbMnOelT3EzWJI83gVkJfuGLZZBwhjoMOkuV0ysAYCuLsv3g9SAF0+VDiSXzCLZ1s0UJB+m7yGhhf9s1+B4xuj2oc0wdtVIsImM+x65jhpa9q02AW6PXEtFwxOCaXiJr7mXS95gV+MHqXCWE/Aos7rOH11carGteE+s+UtLyeAhelbBSPlgK0iLU5MVJAxdlAC8+PdKJcpkxdGwwFJa88Ye8CssRUCKezGTFrBN7sVzHFfZ53tiifaeN3fz6HTLql+WGGv1jQKOZXhumDNdxRpgfF8jSRK6Rr5PkbRtRt7oUW5YiYLGMd0aAsO2L8FnbKAZWQzEJ39AYx3aPXTpcAS96bS4MpZa57Ou2zWqAvXnMdlN6wqpPiu1JRPzUQZdrEg0PdyXbRgGUig== 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: WnmxuffSVt9xLy+ocvHFaNjXDLyLn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TAVdBHWd3lpBPlMbaJuomHbCsl5JQG1mNtPOvAAe7/vy4kqoY6cBpP2KOwrUe/50IeXrKpaEpcVn+nlzqCNVha5pr2a3Y2kr6oZ+yoB4zFQNnPd0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e8a147d9-c97c-4eca-7d80-08dca69c1832 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:33.1850 (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: 8hOQI+OhNe6qrhjsDcmGKz/njdzYbLpzB7Ar8GgvlH5FCXg5VLHwqQBw8K90sRKmdlyWE9DrrfY3Me1ENGPV4A== 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=999 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: xWU0oLElLrmHOswr_d-TEfm3l9tGAdl0 X-Proofpoint-ORIG-GUID: xWU0oLElLrmHOswr_d-TEfm3l9tGAdl0 X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 54FE0160017 X-Stat-Signature: gjswwjpa8hsg8h3ce1kup498f8jrrehj X-HE-Tag: 1721246865-560540 X-HE-Meta: U2FsdG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g/7pxFnhK04yBrzMJF9befdRS9vUqdQM/R79Hc3te8JWVAmEFTtmqJ73Z6zuj5yYQaKIj+2HgquSno8dsMpAjqhtygw8yIpreF5sIy8yW7QdwMb8EO+ZRG50hahL8u6l7fwqVKaH1zZWXdzQuYCWhXVy2kWsjvE1M9vIdckgpcA+2foh6WG1xCln17U19Id3w6rGtVZm7pSsafBpAXdlQjGAq7TKd2d9p00Tk3vkiCIe1NaWfuwXfgvrhlE6Ou3GtJXfkvyfByJ1ssKHPV3kgMnItR9LIPbckAXEzz3MeJOtxBm3H5fL/30omFSsQYfjbe8ooEew3BnnAGjfZMysc0IptYKtdInUyH/ux5yi09V/5WxscXlvFZ5B0bQkboqIrBzEhivOJGVL3rPhLNxXWjThxIHAUEUtJDYJh95SOQlojh2J53A6CMIPHl+2rIWISJeqyf1Iihdg= 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 49b3ab406353..a1544a68558e 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2916,6 +2916,9 @@ unsigned long mmap_region(struct file *file, unsigned long addr, struct vm_area_struct *next, *prev, *merge; pgoff_t pglen = len >> PAGE_SHIFT; unsigned long charged = 0; + struct vma_munmap_struct vms; + struct ma_state mas_detach; + struct maple_tree mt_detach; unsigned long end = addr + len; unsigned long merge_start = addr, merge_end = end; bool writable_file_mapping = false; @@ -2948,10 +2951,27 @@ unsigned long mmap_region(struct file *file, unsigned long addr, /* 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)) + 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; + + /* Remove any existing mappings from the vma tree */ + if (vma_iter_clear_gfp(&vmi, addr, end, GFP_KERNEL)) return -ENOMEM; + + /* Unmap any existing mapping in the area */ + vms_complete_munmap_vmas(&vms, &mas_detach); + next = vms.next; + prev = vms.prev; + vma_prev(&vmi); vma = NULL; + } else { + next = vma_next(&vmi); + prev = vma_prev(&vmi); } /* @@ -2964,8 +2984,6 @@ unsigned long mmap_region(struct file *file, unsigned long addr, vm_flags |= VM_ACCOUNT; } - next = vma_next(&vmi); - prev = vma_prev(&vmi); if (vm_flags & VM_SPECIAL) { if (prev) vma_iter_next_range(&vmi);