Message ID | 20240710192250.4114783-16-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 0D5C0C3DA41 for <linux-mm@archiver.kernel.org>; Wed, 10 Jul 2024 19:23:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AF4476B00A7; Wed, 10 Jul 2024 15:23:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AA38E6B00AA; Wed, 10 Jul 2024 15:23:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 76EEB6B00A8; Wed, 10 Jul 2024 15:23:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 4E6BF6B00A6 for <linux-mm@kvack.org>; Wed, 10 Jul 2024 15:23:46 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id C1D46A01B7 for <linux-mm@kvack.org>; Wed, 10 Jul 2024 19:23:45 +0000 (UTC) X-FDA: 82324817610.30.5D0E7F1 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf01.hostedemail.com (Postfix) with ESMTP id 487BA4000B for <linux-mm@kvack.org>; Wed, 10 Jul 2024 19:23:42 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=l+qDmCce; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=sB9ZtkIw; spf=pass (imf01.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=1720639406; a=rsa-sha256; cv=pass; b=gQiCUO/XfUTaxz9dxH55qIzRaw4JkBuD6hAWSeVuxvlAvcHSC5ZhX+76T6fFHo7vpiVbwS SomUHmtKr88aNlsSJ3w1pHVpR3ROTsFq9A7IzFU7n3W+zbMBBbIVT+eUGS6hzzH+66wpcQ jdhLmcc0qOftxb4FGJqj41fZlR+C0QE= ARC-Authentication-Results: i=2; imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=l+qDmCce; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=sB9ZtkIw; spf=pass (imf01.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=1720639406; 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=oYE9TanO+Z1FGPVLMiWPHUAAimqauAH0W6HKo0s5T20=; b=lJ6pu2fATqKiRrds2eZSzIJsyQbMaD9Jc3nKi5wvQTSjJHN4va0xvnGtzEmbipQ7NEbXOo 3KI3ySc+VyuvThyPDOynV5XFdfK0uzD/yuWtXw8aJZffkReCSRTmzU9dWGEKvFXeV9kPW1 OmIPVGM5VgMXqamYRsnSaFcnitqbGII= 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 46AFxAlS019275; Wed, 10 Jul 2024 19:23:34 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=oYE9TanO+Z1FGPVLMiWPHUAAimqauAH0W6HKo0s5T20=; b= l+qDmCceprSUi87Q9/Kh/pKEht2mMRgT5wsQKDIFOS1sDwyV3HLsJ3lgsAWOQtWc GmFxLpaNq8vFqxAMSSoiyy+sc4tZ1Sr3mIlh3D0u4S56mICpXPNwloKlX+0uacPM 3lyV/7g27J2VVn9kzvTA7pgWwmEKrV4n7TJvIxfvqpE45nbeacu9O36nlYHzBXRC 7AZM6U1ZJxNzq+Qcm0H6Wkkk/5wzowuGuovGRSaHBw7SCsKyTiMdXwVmYdT3EcEr TZ05Y/2q91rZvN7/F3pdhQl8nq2AlenPOJ0261KC76E8oEk1SO9fYr4AsjrCKo25 u6kuN7IBr6hBzFHgkpOhtw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 406wky83qh-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 (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 46AInZeq030164; Wed, 10 Jul 2024 19:23:33 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 409vva93av-2 (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=P7sN2DYJnQh7VxCiggWgW4vzjHq2vmP8rODTaNed5M0R4ovJ7OpyU1igh51YBAKH/abHoEShZ+nocU2eusNgtkNBYba9M+Z7+ql6AIAKrTZjze/9PBKGs43A8Y2htNzqfZoFapJyDfrOmHeahEKmxWDhFmY9mR+rjzM2671NalggMhU2n6RrxZdTL7fF+yyeoh+WKliuYPqpsGiVTZt7wYvUIeE/+lN4uQ0pIor1rTojg6spxRSOkKVzCpS7geTxwIIJ2Kq+uhBM449rnwrdazq6IvnK5Jv86CBW9411FV9/4TJ65jcs7vjyKFRC3lWOn5ngn6tWkDvTAUM8pe3UcQ== 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=oYE9TanO+Z1FGPVLMiWPHUAAimqauAH0W6HKo0s5T20=; b=ZF6tzsenl9PqTk5tsmkzhaV9F11DlapfswD/otebgTa2T6qFBPa33cQGKvfdcnxazYyv0+pb2S8molj1/KJpvOFHYL8bchSKJPAtudbLUVDjPvB2clSHUvX1kOU5rWc/LbZLfj3KVN+LTtI1Gz18UfpeeYnEPVamUO/B7cFE1UbrDz2+vaK9VK6X/TG7VfP4OF1w9dl+hPKlW/TCzTJv2S2MC18lUMf1xdpDX/gXdJsCbnrOVsV7nO3MsI69sjGnkTRF/iKzVTCW/zKd9U8zS3/WiCKU8UtAxnFjG41j7rEDlsDj6DLwsI3fQKjGE4GcrWtcQvW3yol928rfpAjRTw== 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=oYE9TanO+Z1FGPVLMiWPHUAAimqauAH0W6HKo0s5T20=; b=sB9ZtkIw9iVDi9FdJAep7oqUdd6Am4jTeJZ9Qpwj2gfw4EnDtjIhtE5PccXXs/J+bCrdJpcuXjRkftnBI7SfeU0kxtyU3wG8UMp16oEG/1h+6wnNvJO73LDytjDCrko8HNsGBlQusEz+uOrJKvN5n+96aqDPz/6+bzoERg701ng= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by PH7PR10MB6106.namprd10.prod.outlook.com (2603:10b6:510:1fa::7) 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:29 +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:29 +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 15/21] mm/mmap: Use PHYS_PFN in mmap_region() Date: Wed, 10 Jul 2024 15:22:44 -0400 Message-ID: <20240710192250.4114783-16-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: YT4PR01CA0269.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:109::25) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|PH7PR10MB6106:EE_ X-MS-Office365-Filtering-Correlation-Id: a51f58a8-47e0-4473-b088-08dca115c794 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: ZYZbgz03HUd0sHjA1zcXJymq1DhZlH6Ng2h0ZV0M/F85blNuNgJYYVzAVFozVvvofjK5xJS4Vp8Bpn2rKIs+aIItGd/oNifEDWbfVbsg1LsaeJ6TJos5kRvE8cTjCZN5N3rFMUOqV/6cmwiZI85fhityirLZZS+KGkuDjIrd1znGTk73rwPtpDUSfz9t7xFVgSzE93Dj8TXTg849jPombdpAUNKtPa/m+VPPPhbtB9Poa69ohcwjG9f5OvZ6Q6zhidt11vGDTYJkOupjXU0VZt8/p4mIhXyovPACkItN9GnXFuDrSQEGs9iU4JcycV+Wtne+A3ICOR99uY6UMrk5JRdvn3oGunPd/VnVKaXESvB/hPaz+Gcfy8T2nj6I2EuhpNwBPUAAbST6GLcWcP26DEkvnrDvSzhdBWDqpsYzoOLn1MtHE4cEYDbnNRJSsSNQMK28+DsHRFYDvcnfAda4kGWbVYFM3EPUYNqAfXCbWr8sWDVDY806d0NVrZPTqpxu9Fid+rO3bHUDtx151p3mUR6oWVlBetlB964QjJFYrzTz9cBQswOnGOy03Jk+88Phbd23Fxu5jr1i9ECv1PLOXp5oLtLBzLsUpUmi/C/b5qsigsdlKCrNB2qSBEdUZxrsf1OKAVF+XiHdRK0VkDgn26o8q4oHIOT2A/qQ1oFzMKcaPhMwpJAeWWsGwoyvIo1Qe97LU5M86meUlZMwWdhWo9fHe5ukNv8UnBzDAM8yTVaobbiyTxsigHwNsw2trNvDasTXHNYWcTiCi4SdTGavnPZv4CjnIRVR3FNrOLtvFYqg3Wbfvd7xCxPGDrgb03GzKEQPILDtVRomw08WC2hJddDN8PE6o65ErQ9dJRoohjg8nDKgPI0Gn9EHeMAwlrQe3y1jIk/X6VQUE4YM0s0nVhT+8GVOrdZOTlyabQySKy9AJYkqhIsSYJV3D3gN2p2u7j9WgvNUbdCJGljiHaN2UJ3pZATL5BYEa+Ako1aY8lVShvHAZvH8faWjFEsV0t8520tbdfDppx4BfhzAaiBEKaRa+AS/4E/C4JeyZETWy7gAsNZ31EVRhhV33Kj34pPWWXFyRbCXwsRlCZ+H6IfAZXmyEutVi7Sr1DFXodd4m9ETFg4tVRwGp1XvxfUT/Pudzhkapv+RaKJlqtDAMrKqD2u7uvOvfhjaWP063C4Mf9xDR+iveXqvmsuHYgDDfeO+FKpedFiurfqsZXprtFZf5vBmlUSZ2smksyWyEWVLBGBbM3SRBzhRSDf91so9kHf96RzrlOZtuJLckejhfLgiSR7CBqTqslYUG98acLmCUQIYJFBkgz4SH+wWxJvIqlYujAu/IcfU8JD1UZhjgIL48w== 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: wYt0GiCFsG1fDERsaICPUfd1WffZ5jnJRXachH8ENxBjlzaVDGOOyBsv+r81qFAT+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Z1xZtEk/am/4ZNXjBzaclqL2t9/nsPj3YKEvYrT21Wmmjbo8J2T1wryIZ71j0jBYyt/99kXiKgfUnsZijyMV+jzHmSB0tyCXYqr3A= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a51f58a8-47e0-4473-b088-08dca115c794 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:29.5336 (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: 2AF4g3L344/3c6xCUp8OyjAiLvu6ft7ex7M5L6BNgmGCV9QEz+Y08SHhQKFZmoJsZNt0pLe+ZOPqbq1f9g2dLQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6106 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 bulkscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 phishscore=0 adultscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2406180000 definitions=main-2407100137 X-Proofpoint-ORIG-GUID: nUJcXoE4jcUrxdA1aSpuiFGVDgbGJoax X-Proofpoint-GUID: nUJcXoE4jcUrxdA1aSpuiFGVDgbGJoax X-Stat-Signature: kod3fkcrac5tgdauujoyiwz7rig4gmza X-Rspamd-Queue-Id: 487BA4000B X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1720639422-27150 X-HE-Meta: U2FsdGVkX18zKbs4Xvrn7knZ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ecXoOs0cV1FEN2SLfRp0d9JO6j1zNQvgylFUzO66r2JT+0Bd6OfewWZCugfHmD9K3ycV+ugTsPPyyrI/tZeq6z+MQ0h0CiDKCEBIm8lXNFYu1iP1+a37l12RoDhn4qJAknTq+UF7LFKSiANOKovTXyZbja43IlN3GD5KSisUomZRTx3Aai1eV63lyePNroJ/HU+nHc148kUgK7BWvocIqFuzLGI30K28fEVaS8OD52q1Pu7KYCSSw+8nCZw6uZ6jHgI5Eizzk+2b0UNlq94CmH5vhX/zlznWUR0g0+IE2LmhG4E6QUc4e7j1t+3VM+BS2po00P92R3/2OugyZnP3mN61edyHnS8kRbg+WhT1wTuPSRV7vOKYLKWgEAiqHA= 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 58cf42e22bfe..e13f032fa69e 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2943,7 +2943,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr, struct mm_struct *mm = current->mm; struct vm_area_struct *vma = NULL; struct vm_area_struct *next, *prev, *merge; - pgoff_t pglen = len >> PAGE_SHIFT; + pgoff_t pglen = PHYS_PFN(len); unsigned long charged = 0; struct vma_munmap_struct vms; struct ma_state mas_detach; @@ -2963,7 +2963,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr, * MAP_FIXED may remove pages of mappings that intersects with requested * mapping. Account for the pages it would unmap. */ - if (!may_expand_vm(mm, vm_flags, (len >> PAGE_SHIFT) - nr_pages)) + if (!may_expand_vm(mm, vm_flags, pglen - nr_pages)) return -ENOMEM; if (unlikely(!can_modify_mm(mm, addr, end))) @@ -2998,7 +2998,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr, * Private writable mapping: check memory availability */ if (accountable_mapping(file, vm_flags)) { - charged = len >> PAGE_SHIFT; + charged = pglen; charged -= nr_accounted; if (security_vm_enough_memory_mm(mm, charged)) goto abort_munmap; @@ -3157,14 +3157,14 @@ unsigned long mmap_region(struct file *file, unsigned long addr, if (vms.nr_pages) vms_complete_munmap_vmas(&vms, &mas_detach); - vm_stat_account(mm, vm_flags, len >> PAGE_SHIFT); + vm_stat_account(mm, vm_flags, pglen); if (vm_flags & VM_LOCKED) { if ((vm_flags & VM_SPECIAL) || vma_is_dax(vma) || is_vm_hugetlb_page(vma) || vma == get_gate_vma(current->mm)) vm_flags_clear(vma, VM_LOCKED_MASK); else - mm->locked_vm += (len >> PAGE_SHIFT); + mm->locked_vm += pglen; } if (file)