Message ID | 20240710192250.4114783-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 91A78C3DA42 for <linux-mm@archiver.kernel.org>; Wed, 10 Jul 2024 19:23:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C7BA96B00A2; Wed, 10 Jul 2024 15:23:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C2A996B00A3; Wed, 10 Jul 2024 15:23:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A55676B00A4; Wed, 10 Jul 2024 15:23:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 7FC2A6B00A2 for <linux-mm@kvack.org>; Wed, 10 Jul 2024 15:23:43 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 3A7C6A01FD for <linux-mm@kvack.org>; Wed, 10 Jul 2024 19:23:43 +0000 (UTC) X-FDA: 82324817526.09.492CC13 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf11.hostedemail.com (Postfix) with ESMTP id DDCF140027 for <linux-mm@kvack.org>; Wed, 10 Jul 2024 19:23:39 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=BlYHKinr; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="Xa4/BQHy"; spf=pass (imf11.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=1720639377; 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=LEXzL1tS4WjoBcRYnlcF8BVp/D40ZtbGhNxX7GnBucpdCOQGS+6orCu/K7IhVJYm+eZ4Yx MBa0F2h6F7Zj58WQ/jMGqHR3cgIBHULVImEoa35yHLxlVHzqdEg/txqjf7xfPsczo+9m40 E5wELFxIJ4efOPdhIJNEVEk1OMm4zhE= ARC-Authentication-Results: i=2; imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=BlYHKinr; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="Xa4/BQHy"; spf=pass (imf11.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=1720639377; a=rsa-sha256; cv=pass; b=ouzWZD9D+pbnBpI4K2NHyHGKNYi5Rw5CedptNVUOFYP3iYfmS0h2gzJthAU9GrJEqZ4ARL fAMGtHUR9aWLOM6MmqCO+gF7k3WjaTM49Ut4MSzIH1OFiigGz3c6bffkybJQAoNnNUYgZN 8n3O0Q5xYZLIVCYYg3Ds9oe5NFFmlcY= 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 46AFqbUf019840; Wed, 10 Jul 2024 19:23:33 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= BlYHKinr82YswGyrcvOyNb14MaPu+zvsYJdpdUufMcVtbJdelLgRUzplSzlOotNu ep7JianDBtfn3XYubnjyqn4htnHlcCsBCYmgFgEquU0bX5sUY9coRzl/OuO7Vcl6 Zg7zwM82+zEPBepsQziaxRFpXC0yAFuJdH7JtgrWHk/+LjSoRquqEmV6gUC8+PRc rk1VIivCDTEWx+64zENn33aiopdduvWQ7MPF2IDQpIJV5Ig+MHZCJVFVr3ldD/SA Zkl9iRAzti0XkTYsSiMCavXWcUG0rnZO2IioDZ46rOSpUbdkfIMx9rHOf7U57+Yo qkVxvygLSIYD9qJa2SvdXA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 406wky83qc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Jul 2024 19:23:33 +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 46AIdNi6033802; Wed, 10 Jul 2024 19:23:32 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-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Jul 2024 19:23:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A02j7e0iojj32mXhLwH5dqIplgiu8KPFri9UTEnZ2Wzi561bU+J2bbLA6uXoP+ZeIlCFlFq4h1J5ud+za1u7wNQ231aaqYuI1HmXrbT64xHIyRb1S7VVwa10RiL7oujCUw28AXQvR0ENvu6O91glNDcAJ9vgU1yyhQTRawd2B2GvmG3yzmakQU8JDFhTofxprAIPg70ZpxaTVxKnsJ8NDsfG9wEb1vVuY7dpvs/u1ortAM4DDZYrAObIDOE9Xwgmpmudckv4ssguu0dHcb8JvLSr59GoD5g43rbU9fPOm8dvRUq2fQhenYsVNgfwfd3nHr4757QrP738aPhcw3CIMA== 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=LArHVtRPmTnLL4Ka/8b8U968Rn79AaiiLYmA/o/M1Rk=; b=ipVH1ZFf1vSAv/vxWz+54RNijxYUIQJtf0LveApiU9tdUrUon5TcUCxnuRD3mSB8PaZuUDNa/Qs24vazLgWt7GLWXJf0vhv5SMqU0KTo6o9VDyZ55rRX3dkXgqh9i7vMpv8yx5yCrs30fWRDOBDV80Zsi4D79bIapyudsp9NvyWom6gj+4aXZC8bATtFaNTNOlS8X796O5g22it0Tw5s8Z9s63hMIO7Zs8FbF98q7KGu9Qn1Uvzw4unEY5+pnCkcdOtWGmq9rnkfRklJCdjKpoUHuHlA614Vh2f9YkHUApqXQsLiV90xZUQQylpe+IEC+pcbbXs6v1twWZxTVcIo7A== 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=Xa4/BQHykvbbeG5SNfeiBaykc4q7y3YayV0YHXWhQJYpkdE8W17GfjC1KXdzu15pYoQPMKkQLIbBnPhpFVJAOHxFPLkEPznGnF4J4f3wrwM71cdH6DRlflmg3brmVcdCWORDxSSzU5XGEJskdxIwMIYF7mM1ca8P0EB61E5A8xQ= 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:14 +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:14 +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 08/21] mm/mmap: Inline munmap operation in mmap_region() Date: Wed, 10 Jul 2024 15:22:37 -0400 Message-ID: <20240710192250.4114783-9-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: YT4P288CA0031.CANP288.PROD.OUTLOOK.COM (2603:10b6:b01:d3::9) 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: 77060ebb-325b-427c-7863-08dca115be9a 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: rTXd+9saBLgDXe9JmUOdq2KJFBVlQXs71CJKuBADWgkQYjDqqA/rUUK13cBWTQUSf87h5hfV7xHRKahWUJgBLhk2o/aZCTG123folqAdFywHkIGtl+P2BFvPH0nxv26wj0Zg4MDCdCjYLFaLKmF46m+otLA25/EMduuRcOSmfDfDJyAHJfiDgZruu0N94G+fZD/XVNtXdJCtUIy+WlumiwbCtKD9taHN1IPVD6zODX1MKoghwPZq+e38/YH3HeAe5YG9NKurEk4gNse1yZFTpNKPOrAf3F6LAOmEQIakjAdC3rSVdLDAZobNwZxGETuUrFPISH0O/K0KvZaIlCHxKZkFfK4+G3ZOivWK2J+qP07W4gi3XBMJHRMMvykWakIzIELRoOtvhJ+G4bRjkJdp8wqNNPZj1geI9JlErgAySdIaYKjLeRsRkX5nm4qt5nbHMppjbpQ6CVKq1PX4aEJXRY3iDiGui+zZt03C2R4F/uDWcYiGocKhyU/iBfMx9+66lKPXbDkeli8WoyQl9c56DUpNVb4Stg285pWH5QQj2H6LqBIx7nbzv5XmrXBXOB9xnNtbfMJ8tSFPBBcWP2QzAiqsS3wo6TZAt96CF5TpPG8v48r7tHRPnPSfoZZZ2Gfv9J+iDWco9WXPOeXk+ks0e98DgHMbjqLoaHZNBeAi+VmxVPZlvMSVUXHhEqu2HEOx7XQFzs0K+fu2nMYTnUMlZy8lSpxu0vN3MsIK35sg0L6eculimMKmBKbKBq+ypVJN4kWOctyYQfdUwGZu3VbHuz4h/ceRGjjzgTxSBb2L7MH9YPHfVbigh/7kkINXMww9CNx4yjpCYjzqvX5sY6aAXdNbJ0df7o15X5nkfR4YU6M5HPCCwV7cYObmr5ZVEqo+IujDA1/58EH6Hzq1exP4n5iGuQa+PZ9K82rDRbqM8xWzYz/9ikRuIg59eC7UJPJoPB9KacxNN0k1lqwaxMiQK90qMLvCE8N2Uzd8wwX9cocm4mTNdwgN15bkDcufeAvXvB9C/OA2x3BuQMSMXOFv6lJkeFQLuvZuGxTZxpyta39P7LcHO6YAW+g7Re+w6IVIVUM2IaK54zm3tsntXwjnRgLhsx/bZUajVyA8rbMzL6SVNDls8rS0wCurO00UF2dYRi2/NddLMNnOvjq8FOMTlgsrsySzeoY4DDyora6m2zW5iVHufK4A2UWHgcJfCmGYMkfwZ0P20vXopwQDDT8Cbugw6unjOt3dO/HsOFZFS/upxS+AD1BKW8Dyo0pFlugOSDZj6Sx5XiatrOuO+P+/khh+bjpNuWw0tgO3g4XYvXUFgKun6as4MwGTD8mDy82OQY6aBSCD0GWFTY1E0zqigQ== 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: F7q4+GgKpp+cJbeqwFiEuIAhB1AKM4OLAnO2Ig0OiHrsY3y+hhn8xBDZ/V1RE91pS2yUd6TYETl1FVRPidEgk60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4LzRikc+DH05rFVfk2tqdTM2ecawnT2EXTcBoxh2Zo3jNe7jn/FBVrBa/KDKdaKzQiT6lTtp2Iogp2vLAIAMs= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77060ebb-325b-427c-7863-08dca115be9a 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:14.4756 (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: OIA8rkUZpur6leMIEaKvbAWfwNSk0P3no6T6RQ7iLNWTSGtuxZWKta+xF4Gl6LSbXlH5eXJbO2yFx38EId5KyA== 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=989 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2406180000 definitions=main-2407100137 X-Proofpoint-ORIG-GUID: h64IlDrb024vwkfQzkZDau3q1xp2pUri X-Proofpoint-GUID: h64IlDrb024vwkfQzkZDau3q1xp2pUri X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: DDCF140027 X-Stat-Signature: 39uemocjixqssh8z44wzsr1mj4pxrqn9 X-Rspam-User: X-HE-Tag: 1720639419-659346 X-HE-Meta: U2FsdGVkX19XWgHazNnF3tb0RGn0LJBLxI8PWjIWQOIqSku+8U6f3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73ykUV6jdRC8Ssi11OxuuhJZuvDblltPXSrC2VdX/Kh+1KJATSajK3d0nqWFMuSKFrSHeBNtucP/b0+60iZHaTuFh81WpM9MyyC+5YrINg85+5V0Bjs4qd8ivyEx5cxWatn04CDSSiBq9iXqNADC/m7FT+h7cnMTZiT0zwY+G8Rwd5lw6fHNtAiO7SjrOoVoDEaZP3zHEvQbDKsnbhA6UQzPWHu3uCFtCUBGWp1vqIz9VMoH6IRn2ud5eh+tJMKs1mIRvRPskwrT69nkiM3YY2LiuDVanDoOg02tYy4P7VpatmCx32v5SBCOI/q6IEK/GYe01QkiArTlHyjffFauq1H+gEVuXC7gviR/RXYE+Npb51VN2TiT5y9VMRbxPpJV0mAcSNQVw9sv/YpMG8k2vd8U42ZORp4M0M36biSM= 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