From patchwork Tue Aug 20 23:57:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13770668 Return-Path: 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 ECAFEC5320E for ; Tue, 20 Aug 2024 23:58:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 377BB6B009E; Tue, 20 Aug 2024 19:58:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2FF916B00A0; Tue, 20 Aug 2024 19:58:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 088F96B009F; Tue, 20 Aug 2024 19:58:18 -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 D51D86B009D for ; Tue, 20 Aug 2024 19:58:18 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 9671CC057F for ; Tue, 20 Aug 2024 23:58:18 +0000 (UTC) X-FDA: 82474290276.06.6D76639 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf12.hostedemail.com (Postfix) with ESMTP id 5877440012 for ; Tue, 20 Aug 2024 23:58:15 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=Pnm5X5XV; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=YEZh1KgX; dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf12.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@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=1724198207; 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=MpWIi7cMQmivMHPf3/Pmr7r1vB9/WxBvplax7ihq6P8=; b=iJVGRCxsQA+PlCjzsouDjRGmhZ38YbZGxbQ32H2Ezef9rzp89qpNWhSM6Jb2DoDcbxJrbu TvWl17mY0ypktrHh5YtOheE0Fp89UF2n8RP7cBz1W/g2099qmADznpAqstBKGSwCEFBdU8 GzYF4S/U9hWP4vttUBROOkLpkXxQ63o= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1724198207; a=rsa-sha256; cv=pass; b=MT+T0fmXq+uGM847LDOHr/qjC427DEqYdTul7+6MbwmASpxR+MuAszE/FLCQUoPUVE4BOj klg7VOYWWNmwgV58Ij9Xz2lU/YsS24DV5d6XGhJUMjL2EzUobcJGOJCxtvRF3dn02AA1cr bSJBzLM/VshXu5EzB3/K98R2ACzfrj0= ARC-Authentication-Results: i=2; imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=Pnm5X5XV; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=YEZh1KgX; dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf12.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") 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 47KMBWNt020404; Tue, 20 Aug 2024 23:58:08 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=MpWIi7cMQmivMHPf3/Pmr7r1vB9/WxBvplax7ihq6P8=; b= Pnm5X5XV4KrFS2zZyrDlkxGTHoRnuQlL2sFY7G2j/0Nqb9NG24VMom0WcueKChob 2qVAAgJYvzcZ5cNM1qWPaCtXxXPWvGqs6He4JGFo4GyJ5H8G52176nASFEkmFBV3 DEW5DxXg2H7tdJg6j31NT1+FhsyAPyz/Nrc4L6Fm8v8Z95uxN2Tg79azcnkHvt/j 3odMpDDjDjJtUO/I8BBOW79/7mbFmxDoZOxSB1I8LBHRUe9V1EJMDSDDyhylnMmT sD7+Wv4UbVfSWdxPxAo0InSfI86hGcwtGVZACVaan42uwaOD+pHt2ZIbv7dmw1Td zNwRk/pWYygwGdCkT7KUxw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 412m6ged1y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Aug 2024 23:58:08 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 47KMJJkI040123; Tue, 20 Aug 2024 23:58:07 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 4153u2tbef-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Aug 2024 23:58:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jdF7PHGespa4a/IVKDr6kefniyRGoGg6qNqcTzebTIzrOkoViTprp5bRRfcj9OckSkZUiwHwVe0z4gYNsM1jr70BaP8kCCeyZ7PbnH1fC3ikvmfHnzXbPQQ3/BVQu0XiOJ9AcNAoU794WGWNfgLtwSL8RKnUcXvuMxFqE6jiHpHMShWFRry1x3EbensNmTwrX5VpL7JBgRaaOSMsqC4UN5d3eNMnz+qllUKKWCYVO+gmyZnSbTW+24TOfVlKgB/jr7FxL+7m0lkt0eoiUK9Rp6qFP/XbOTT0m/W8+wV1/MDo/4WUMrqhOj1/iduef4/OYVh3XkTXZITfWMdJR3zeMg== 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=MpWIi7cMQmivMHPf3/Pmr7r1vB9/WxBvplax7ihq6P8=; b=EN2O6stzmMzONnBmYMhIKPGq8+9W+N941D+OEnEw+ul/gpjmZAFmXiFZhrs1/CVWQtIe1f2ZqhAUqNAUWRxGlVnf4T84VXpFC96Ljw4vvBPOKfBwr4TLNx3tw6lqMt5jgXdX8mcy/Xye7bpYe8wCHoaPLFkgjdmXlXWuqqAY2opHPfXH9cDjrrmrBxNp6EPwPZwsEn2D5ujA1TMgRp3SaCYwfov0/IRbahEsOVmRFGdY6BleYdC2ijESOSZwUiug2tEMfxsMtxc/qBDGVB5L4aYa6814453PLA8li0ul9ZEARfBY1y+UmeJAmWeZ/gvDDn/+P1oTHeFDpOgtwb6AGg== 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=MpWIi7cMQmivMHPf3/Pmr7r1vB9/WxBvplax7ihq6P8=; b=YEZh1KgX3ZA+Z+1tu8PPtdNReCx/gJyRPcQhz/jiyt+WIZ769KjtR6AxbdoqvdMjRc1CNbwY0dsdHE853plnJ0GzGaw/fpxijpktKyalHZl6eBvFtJlLwutfPw1aj1Yl/6VUT2dqSrKNAWx73ENC4MrTTIekmB+7ta6yvAYksJc= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by PH0PR10MB7099.namprd10.prod.outlook.com (2603:10b6:510:26d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.13; Tue, 20 Aug 2024 23:58:02 +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.7897.010; Tue, 20 Aug 2024 23:58:02 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Suren Baghdasaryan , Lorenzo Stoakes , Matthew Wilcox , Vlastimil Babka , sidhartha.kumar@oracle.com, Bert Karwatzki , Jiri Olsa , Kees Cook , "Paul E . McKenney" , "Liam R. Howlett" Subject: [PATCH v6 08/20] mm/vma: Inline munmap operation in mmap_region() Date: Tue, 20 Aug 2024 19:57:17 -0400 Message-ID: <20240820235730.2852400-9-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240820235730.2852400-1-Liam.Howlett@oracle.com> References: <20240820235730.2852400-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0018.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d1::26) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|PH0PR10MB7099:EE_ X-MS-Office365-Filtering-Correlation-Id: 1bc5c620-27d7-472e-d6fd-08dcc173ed0e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014; X-Microsoft-Antispam-Message-Info: kpuNkhYEzdYEhmlNxQYMuwQnjDfTjUpnoT7Sa1BQaih8ijN3wydnpmRgyPJl8RbWT7iHssIBPOmB3qxK5S/GXzfTYhZYPgmWYvLg2VnaAqJrs2mAt+gL4+D8cmpaYnEzG0ql9W4QBSNOPv1voKRavBNhgDUTzu1rMlouvNq8vzkU5XVrQE0zL/MbjZ37V8vhfYkeHeek/mKkDZdDcigL4kB93bcnmRhMJdP7l3nBCa9ItER4I1AVo+8KfHUq2Z+m75N91C+Eac045qzdEgOTHxXqSPbubGjhJVZdLqmS3WWvMCakXJsumvKXmiwFWTbbamBQhunkHKn1s6u5F6lYxWa5I/vdrDL6ql0S6srPfm8LDne3lFd4WRzb3o4G0JfwZSOPVc+b/c3KvvnnETkuc/kUAix9SzJTkJG5MgOy4HONPketZB77ME+QmLKxOD7zWnUuKA97Y8tlF3wZRN/2Oq+3KQLrGSPtoR/OQZOtKoqPvwuVIyAkOej5VRggJMagp86bOjyfQVZtvCEqUmPtyMNQjza1dypJMtLDV3YLgzRtspcWB/8jfjAyaWPFYf2eYs6wcDkrmOW296ahL7CWUqLnm2R8JG+YRjDnW5CAj4mCNQrhnnESFVDB9d8zDjb0dI170nQqGZO10FPkXIcoRX5h7qHHKiqj4qtpFAfM/gbd2x7ln/tQcsRihpA3APxdXNtcZO/uOiOea65NGoWz6ftk2IL5QQkYefVX91E3ahURoGmd4xdDo+Seyt7cirEyK87zqckO5XjMMzV72TyR9zYDbaIhSqTvytAC7X3GZTix8tbmLO88gGlu23fg87iDR6pRRlURB4on+32cQs3toY+g9FCajUcBB9TL1hOffHgQDthflpBIKwg1ix5Dxadr1TPCM7fKnbuvKdwv49d731RZCyZ8k5Ov8P8OeRUbDGBRZkxUyOt9Rd4RJ9vW2uPqeKRxGf5KnBO/G3TC5hufnhYqKo733zwAhj622fgfPW6qDsX/tI2cLCwJEks78G5OHfhWNsse0blP+OY1VN1XtasTxYfpddiX8u2YO3kAMQkiwQZsR7iEJMaliF8/9KAnyHPBXc6muPdiC/ftmNIeZxM2euYydwhF7fYX7UKx8vVOdfnM/LfXRNgS3olRS9sSfSj9cTtdUa+FTZqtifGay8FbK0QMGzBo6Y4nxgdUe7yBgR6qi5Qz+Pcyi/UBjqX/jeEb8czRqx41dnwstjSAye/yhe6M55eY/jAkSB5HXdUl7DO/6sT0lYWUCQUt7m/1FL5x80JNp0oKKzSRqgxlZunOapNhv/6/RrZlsxsjb/c78i193rFCo58p2P2wVDBfdqyGECnhyVoM/CL9wF9mYA== 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)(366016)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: O36XFwkPlQ83TJU1F66dTN54hYduJqH+VocpsGmiePKAjvct+RwxSPyjGFMpt8DecMYgZZgOS2T76RPHGu9LGaMGbyNitMcPy6px4x8ximMrT/DvxrFY7o6vVrU0c4/p1VfybJL3TLi/PrkMjPzIjbjlpe3Ak1yGBaxzrKPW0KX7scvHw6OSBdWFz5mIHCZAWpPbKT2lrks/IaHii9PE6FGJ4f1jWmAIC3HIazTECOuoVlHDWbG3SY0S8BMpI24oRAtk3A3LxLUFVQm59XsTJNszE9oa6TyaJpteMgHwLg7Up1b+C8BhB3KfC37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duAoPI7Qd2sjXa7LoN9cNOsOOZI/Qgpf/P7B8iznEvuZrvPaOJa81JZcOXAFoDx99FkDvnwKxAZLDCRqekHWUSJZcgmb3WHty2T8G6AObxujuFx9ItI4dPVvwIhrrqZrnYhhOmLDKOmpaf9ZSgsIwX6shTfs3vyyUT8Ye7QDgBhcKZGnT76QP7UO9v7nBOUNyV2NYIHoYyxVhTjLpI9nWhWQFVg== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: u28HWtD6Ew+yIupblqiGZFn/Zt23hDRiru0+ciU1PsLmVM6eMHR8Q+D0suMaxK3jglPM1RRaCgrhB8CM9LknB3C0d2/E53MXJdPivBRSN0zRHk8nPIqiIDuhhVxhSWwxaKvdUuFAdJSzrYCT1XwxdcGXkp2YziLYZ3MhNAbYB5zCKj1zq87nryR6hjt9cquYQ7kggdaCSDYWIXmA6xKj27lTXPjZ5rpyVM1WOQU5cLQGXZPz4RuqCCKqrmuwQPS5y/68oBB//UG+9+zs245sldtJsAoY4Vy2HcKrDGvpVkDofKk+MD03ng3B1nCHqGyK6GA2rGekXi6dLAm1Z+U2a1MZTh093yWMZ0agQHcLWV6Lak0m2Bg6vi0kwOmL4kR7Iqc/TN52z+8/UHklNCpuPvCxHU/5nTUL/bN7G69/Ba5GnjJmaWqgexTZ4e6XTh3/QXlRnPImJHHSiAQs207FQ1vOdRQYsKNiCqrJPBfQS3QulBO0Xg22ZYUmC+kL2QGR0aOILezFIYEv8wWou8Q8FkuK5yqZQdD/QzdFREPh9EQAGYBH0ifdo0gbvPRAAE1SL7/V3xY0cxWjO1KjeCorLAzQaRiAnSMjfS0SaDrinYc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1bc5c620-27d7-472e-d6fd-08dcc173ed0e X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2024 23:58:02.3399 (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: zGOU31m/hrJUV7CSmRYtfLdND9U2Jg/ZR8T1fOB6v/g0FN2B8JUd8eARJq2YD57yDvLdNyndMnOVTn0r5iY2Wg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB7099 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-08-20_18,2024-08-19_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=925 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408200176 X-Proofpoint-ORIG-GUID: siyvEitxUJgjuO-g00DHOC-mBaJlVNYL X-Proofpoint-GUID: siyvEitxUJgjuO-g00DHOC-mBaJlVNYL X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 5877440012 X-Stat-Signature: nr4bk9yb3w8sx8ebg67ggqwr4asq35pu X-Rspam-User: X-HE-Tag: 1724198295-938924 X-HE-Meta: U2FsdGVkX1/mIU9bOFEGZTDvMcqJw5HNF8mCFFN+xyUR6l6srr36rv6acsSF9bbNdnfA68Af+sj+ag2u/v04MTPXC12/ArI5zyjTTcx8C4tuGHyPlYuJmR7z5VxZxHYPV4rdyXXhJrfGf+BG6UwvRl8AFqdpxBDxCKtsd1vE7G8dP5qmMis+XIR0c6/Dj4tMi7HEU7ofpxFPNHh2NP6WRaZFqReDwsjAtNqsCb8e4biNN18Ifqmxx7f6F3F0DyvSMkWMSxPnFX/XfyDrEZi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B4pqQWUIYc0CdAMI9UmPOT4+pfapRrp7tUVT/mv3oXMS221ebvWoiAGOVcx+PgKW+xJDnxYr/yDBHN5iHnpWqVD8FMjEZ13jWRLIMD7ow18Qi64NAacFTOP6f2NbdG02jBK2nbBbl4w4JpAP+2+hyyzmIxbxtPxms+6q/k5b6Vzau5yOMIwz3JAUY3jC+C8= 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: List-Subscribe: List-Unsubscribe: From: "Liam R. Howlett" mmap_region is already passed sanitized addr and len, so change the call to do_vmi_munmap() to do_vmi_align_munmap() and inline the other checks. The inlining of the function and checks is an intermediate step in the series so future patches are easier to follow. Signed-off-by: Liam R. Howlett Reviewed-by: Lorenzo Stoakes --- mm/mmap.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 112f2111c457..0f5be29d48b6 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1388,12 +1388,14 @@ 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; + /* 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