Message ID | 20240710192250.4114783-12-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 BE221C3DA41 for <linux-mm@archiver.kernel.org>; Wed, 10 Jul 2024 19:24:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B936C6B00B0; Wed, 10 Jul 2024 15:23:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B25B36B00B1; Wed, 10 Jul 2024 15:23:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8D0886B00B2; Wed, 10 Jul 2024 15:23:50 -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 69C746B00B0 for <linux-mm@kvack.org>; Wed, 10 Jul 2024 15:23:50 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 2487E1401A2 for <linux-mm@kvack.org>; Wed, 10 Jul 2024 19:23:50 +0000 (UTC) X-FDA: 82324817820.19.F07AB1D Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf07.hostedemail.com (Postfix) with ESMTP id C37094001E for <linux-mm@kvack.org>; Wed, 10 Jul 2024 19:23:46 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=Hi0nUBWW; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=zS2JARnp; spf=pass (imf07.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=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=1720639411; 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=hg3aFPLWINSO4oMDTznqetTX5TxBmdh5A/x7jDixEvM=; b=HoFBOwaJeTVW359/WJBTqIXLTWI9iDCamCLX1VwQOL/F9kIkVJabhFZWT179dGwcmrN507 i+0Wp+ee2lWoON+J7mXvApuy4fRWcSgGqA7bR1N58aCLoeUaEYfMRW+9+t5waKcHBlELDr i1ZSqfs7KYySWGq46zl5RuMD6qARDxU= ARC-Authentication-Results: i=2; imf07.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=Hi0nUBWW; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=zS2JARnp; spf=pass (imf07.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=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1720639411; a=rsa-sha256; cv=pass; b=LHDxtkad2rNj/ar9g5olbTChyLRB9uEQ9yCJVbYtKMChQRq0eZqEuyJ6pJ/LrmQn3QcOYG LuGLtmgi7CusowY3Oo3vsDMhTG8rXjKzexf5XsWjLVnYOup7wc7YSFtC1dp7oy23o4Dl6G 1ZZB5CPqkbomoTtQNJ87qjWNtlp3/C8= Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46AFqbUj019840; Wed, 10 Jul 2024 19:23:38 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=hg3aFPLWINSO4oMDTznqetTX5TxBmdh5A/x7jDixEvM=; b= Hi0nUBWWrDJ3BflUfOKE+R9MwI/Gt47JGLZPciVNkA2yl7FkjvXfJltFUSk6gt4B SrHxYIit2dz96tgbt3ozwI3SFlhXQNa8W+gMsFDUaACojscFDghlrS/sr71j+cCF fG6ba7bEcjvjsxrmkiZ81UdC9NLMy5prKoDx0auHi5k9Q3v8CU9uDYbtldSDnkV9 SuHTPijLrMCvuHPr36Z3T8mK6yWV6TI1x0N77KT7eyPzL1Q/pxlIY/fRC2pAxGPQ 1M6zafIPNqwdAvt1fNb9r2Oe+c3t2Zm3pB/k2joxWA7sfAfpItxvuNsIB+wfz66R OJ57pLPg+PfOzGuFCTA+/g== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 406wky83qq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Jul 2024 19:23:37 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46AIs3bj022604; Wed, 10 Jul 2024 19:23:36 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2047.outbound.protection.outlook.com [104.47.55.47]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 409vv1gwv5-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Jul 2024 19:23:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gtAOjk0fZQYQWgqAeT86tAOdD6HKU7GEBn3NouG7FQPuaS1/H7lIICj/8u+gzql31UCuW2Wi6Vmd6lvOB1v89CSo5+Pb6pFxlLS7ysPaJ9xCOm43vLg1SGuU0go1UCSbX6A1swSgRGFJSJVeX5m0Zwb+1UOVlExPVBVdkUXXTRxoaOH286JcaloGW2FyvIshlL4O8cl2tIYJIk+O8iEoH1CfRkjBqhntLwgw8PdHzdetqCi+SV/ovkNcZqo2PrJ9yXsWNJEHkHEkw8SUw0lnyF0swusroShI4OnYcCa+tqT8wWgjPOZHBKJPkKw3fffjH5t3palUEpX2LSpLA550+w== 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=hg3aFPLWINSO4oMDTznqetTX5TxBmdh5A/x7jDixEvM=; b=lp8/csz21We9cB7hckyYG2IzWzI7YcLJqNk6uTmRQXwpA7yR3D70l9uMHEK9XEPhzH4sJLDtf2DS4PfX/5X1VflCcPAz1cwFPspBpjnwVVl6TqGnrzyShiWz3Ge9ZCmxu+6q/j2j1wLfoCw75oPB0oOSo9czddDogW0UVwJgRYL+AgpHxn0rxZWtT+pGTQ2TiT7bcYYvkOLs2G2y3MZ4fJQ7rYzN7W4NhvwjxBUeD3C4wxlnNkYYcGr3woj366bJ424yizyhkvux3+VIw1EKGj+mXdZ2uJHcJ1orIFUm9rQeYrv/Cj7KSRS5myFjq8LyhsoZB3Mr8PJvN0MQlv8nzg== 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=hg3aFPLWINSO4oMDTznqetTX5TxBmdh5A/x7jDixEvM=; b=zS2JARnpyjU+77PGuH5245D7xyRmzDM92UIpS+Y9T1r9X/L9EJ72sRBudUE3Fcl+mtIblig+sOQIT5TLXco8R3saHUGZrCdRzGNNgWjaKVPROzpMvS+SpzTDHin94IHm+XnrGC8yj4HgXESLOujKHZ1Et/OrUqKpgqIAKgig3I8= 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:20 +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:20 +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>, "Liam R. Howlett" <Liam.Howlett@Oracle.com>, Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Subject: [PATCH v4 11/21] mm/mmap: Reposition vma iterator in mmap_region() Date: Wed, 10 Jul 2024 15:22:40 -0400 Message-ID: <20240710192250.4114783-12-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> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: YT3PR01CA0012.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:86::8) 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: 801165c0-6f47-4972-809e-08dca115c235 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: nKNaiMhJLz/6l2vbGpn9LqD3MIv6W12Q7WMzAG1p8HNfJl9fObYxnqlNXxzK09aHuTsuDdpNcB89DmWi5Y4mEg4IWy2rKiyxkGQM6DkfQu+3ffKRxtk+MmUhs5nqBr+CA7DFisEdqZku5iiq07aBVpsfutvybppYzy9ouAfTLVvvzDh5kFNX0dCe+oLPP+TFxj3+jh5RL4rDn73elH5XAiBoRqQAmWaS4iL85YP8ZIzP3aa+OxBUd0zHaW7HYVkIpGI3tiRo3XR/+McD9mEq5mnm+5TIcfsKMdG2N7Akjs2j0nZoq3dfZOZ196xIoKFXQiPkI8V501jpXtk/wKTK3YVO2Y3NR8s6iXDJJBtpCNsFLMjDouPFGwOMdQXmT7JYoSu4fAe/iJdygjrv+ve0cpsxlGbHgwdNTEgKh3XtRG2BnYGscNgxKgKmdIPVfU6yOPCPP0WpcrMGly/Pbo2trl922U5jAdCiFwM1lvTHw44HwrjXlyrHlIw0g2kc6JK8YBWZE9DLZVwkMo580XL20O7kLmYoyhW1m8CAKoiSvzrvm7SC+aQ8IsYD7A9abIW6TfhJsMMlNEty+5rzZPyJOThj0gzT+QBU3Dzb2t+vQr2wfQg+WP/BJCxOu12tkCd2ymxeRR30dUjMevtoHXzU5OnS32CX97TDFE5tmekLFn2JtYuEpXPJiMJoDKcvTTuE+mOPMOWUlr4bMymKEO5sd96kxcMDjciqPG6yblFZSE4fe/CNq9TbtMoLZltzE3w5TNikUYTzWcR9bo+sYNyeyrZrSQzAFh0wND34tDxfUTWZwaOkmemFJoVHYVV/IapkWYcsYj/pCoidYo644NjM2S4gz8lHf44BqkF58AkYH7q0CZNtgalcmSn7JRhO/2i9RLSNC/Gg1XEHmOcjjUPY2klPN3h8zQobPHp3CChyuloi4nWw5DmnhvV9yy4Cs/m65XW/nVM5HKrMBfSV5qnohbSAIZWAlIF0LrcA0j76YjlZ2ssmZkrO9m383A8oMb14ysFOOzH4J3zun4Xfu8kjwDdIkAAGaKkPg8aBNyCqv5uks8Z/8apaA29yxNfeQQ+zq693uy29Am1Fabo28bxq/O310R32vqOUotLzcy+baDGFYwJFkAF0b3qeWm3+Lx/SZDxfQGCJ4fBCNYs9tozdH8A9TTPOHdRx6fCGcWllq0rFaLVu2MTwKTC1pdvkDWQOb+0YYcWQcJXadhl+B/R+9ENsecb1ZoOUsT535r7ieu4+aGIofkQNcOIIuZIr70fME71KHO5GNEVi7Vpf6dbB1GHMeFBGOQx9pptqrwzFvRccyM2Ns30h3M4sCGmNq7o4/tafNBZcqQxL02K3q7AztA== 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: PSJxlsyQeavdBmQon+b5+4V7sXqLCOiQVobj3liUHun6Fjwt/h4PKChUomnupDUvb/H3MrzY80jI4eAqrdW9bfKey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k9oC4Ao/OzuppBR0RzZV3CYCVtizI5BX0XalRSEO1SYm+kCBUhBEWZ7B3x9TgFf+IxVP7OCAGVG4OhodiBQokhXCMGEKzAY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 801165c0-6f47-4972-809e-08dca115c235 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:20.5792 (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: ZCNkXRnF+C4TXEACPx/hYvdUCX/h4woq+xTzVWyKyXMiBUdyUjx0ZnH5Dip5EdBi+LjBXqWPLYVVdgacozBZ2w== 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 suspectscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2406180000 definitions=main-2407100137 X-Proofpoint-ORIG-GUID: v4G7A5CXxBOJnuJZDHpxDaL9wuC8DnUk X-Proofpoint-GUID: v4G7A5CXxBOJnuJZDHpxDaL9wuC8DnUk X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: C37094001E X-Stat-Signature: 1fk79tt7h9iw1ry8w14yx9ahk6wqfybp X-HE-Tag: 1720639426-277773 X-HE-Meta: U2FsdGVkX1+cIEnaszyFLIgBnSduZg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gJPyBeLYH/9ZsOX08cikUf/mhC57FkWwWe9kpjf5txPJbUAED2igi5MZfLl4diYUyAP4ybxiYQdmpDMKHaFiYSt8BIwLCK3jNvZfBGRgSZ6Khy1RxfOqziR0KDhSxQ3yC2Z9xZDHzkrF0vY/I7eRrL+ok8TcAjXtQ9po/DxpdGpBZKEG1t9W6cEi04WBJqMgR/HRfg3Up8XomlKv6S3Gmb9M/I0CFn9bDsDpv+s96KKWOAGVSklWP2YP7d3ZiBrtlmKKBcXXw7YhE+66KKDhhZXGf+RLS8WBXlX55wSW1M68/nJwnZKXuV4hpcGQFar8g3FPtu4Ffh/OWy3uxv4Dd95lJMZl0IdNb+AOAr/UHzR2Wy6V1eIL9Tor17GOe+yFaTiq7+f4VVg== 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 e2e6b3202c25..83cfe575c114 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2959,21 +2959,22 @@ unsigned long mmap_region(struct file *file, unsigned long addr, mas_init(&mas_detach, &mt_detach, /* addr = */ 0); /* Prepare to unmap any existing mapping in the area */ if (vms_gather_munmap_vmas(&vms, &mas_detach)) - return -ENOMEM; + goto gather_failed; /* Remove any existing mappings from the vma tree */ if (vma_iter_clear_gfp(&vmi, addr, end, GFP_KERNEL)) - return -ENOMEM; + goto clear_tree_failed; /* 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); + if (prev) + vma_iter_next_range(&vmi); } /* @@ -2986,11 +2987,8 @@ unsigned long mmap_region(struct file *file, unsigned long addr, vm_flags |= VM_ACCOUNT; } - if (vm_flags & VM_SPECIAL) { - if (prev) - vma_iter_next_range(&vmi); + if (vm_flags & VM_SPECIAL) goto cannot_expand; - } /* Attempt to expand an old mapping */ /* Check next */ @@ -3011,19 +3009,21 @@ unsigned long mmap_region(struct file *file, unsigned long addr, merge_start = prev->vm_start; vma = prev; vm_pgoff = prev->vm_pgoff; - } else if (prev) { - vma_iter_next_range(&vmi); + vma_prev(&vmi); /* Equivalent to going to the previous range */ } - /* Actually expand, if possible */ - if (vma && - !vma_expand(&vmi, vma, merge_start, merge_end, vm_pgoff, next)) { - khugepaged_enter_vma(vma, vm_flags); - goto expanded; + if (vma) { + /* Actually expand, if possible */ + if (!vma_expand(&vmi, vma, merge_start, merge_end, vm_pgoff, next)) { + khugepaged_enter_vma(vma, vm_flags); + goto expanded; + } + + /* If the expand fails, then reposition the vma iterator */ + if (unlikely(vma == prev)) + vma_iter_set(&vmi, addr); } - if (vma == prev) - vma_iter_set(&vmi, addr); cannot_expand: /* @@ -3184,6 +3184,12 @@ unsigned long mmap_region(struct file *file, unsigned long addr, vm_unacct_memory(charged); validate_mm(mm); return error; + +clear_tree_failed: + abort_munmap_vmas(&mas_detach); +gather_failed: + validate_mm(mm); + return -ENOMEM; } static int __vm_munmap(unsigned long start, size_t len, bool unlock)