From patchwork Fri Aug 30 04:00:57 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: 13784196 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 E72CDCA0EDA for ; Fri, 30 Aug 2024 04:02:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F3B6C6B00AB; Fri, 30 Aug 2024 00:02:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EC1306B00AD; Fri, 30 Aug 2024 00:02:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C77F56B00AC; Fri, 30 Aug 2024 00:02:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A1A646B00AB for ; Fri, 30 Aug 2024 00:02:07 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 296621413F3 for ; Fri, 30 Aug 2024 04:02:07 +0000 (UTC) X-FDA: 82507563894.08.9C75CA7 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf26.hostedemail.com (Postfix) with ESMTP id AAF7B14000B for ; Fri, 30 Aug 2024 04:02:02 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=AW8qP50Z; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=zOX0Lq1h; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf26.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-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724990432; 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=Fh3l+ME+2D7vTnslOnVr5R+ASSp1cx2+4oj0ezr+S0o=; b=Mkoxes1vx1q3gE+hZLFpUmquxA2xzy5SdvJjCMA4IbthhLz3YXPnkn+YUHOYdteg4kak01 4RIbnBMyHE09BJxYb+2MezbuefhFiPBL/rMNJwvyfUm+ePbJKIkTq5283ISDhasdUo3Mvz 23EbEJY4R30kgsMlgAhIiIuDEOJV2+8= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1724990432; a=rsa-sha256; cv=pass; b=mU3WfjfJp6C6GBsZNQ3Zlk/uKtiigtseEs3wrcj7WaRMnW//r2jmABal4DUXHePIqk+F0w zyM6CenWfvq8lW/j0n2uW9i5ju3YdeviNd5CV+016M8TXpqcBisS0SZ2tyxLgJJ5U8ypGy R5MfKtWtyULv4KLV6f+1UFUKx7P8gVc= ARC-Authentication-Results: i=2; imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=AW8qP50Z; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=zOX0Lq1h; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf26.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 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47U2spMJ011846; Fri, 30 Aug 2024 04:01:54 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=Fh3l+ME+2D7vTnslOnVr5R+ASSp1cx2+4oj0ezr+S0o=; b= AW8qP50ZdPrr59k0Awon0f7KVdHmNpQrg7DMAvLeIzrTQQmhWtoWiJJ4AtFPc1aF 9La/UHDdTtIfDDKAfdLLVXfpDHJUTlNIu5XPrFdtlgBi1a62bLs4D6z9Wc+D5hjA d5lolj5Rd5iKbpSJXRX/41feo1UFvExpNp7k2A4J4CHPuIZ2Jgy+V3UBkIPacmQM 0riDZcYKvhEUEVI9Cuc4i7iEhvw+GtVEfQFZpgAR0ZUnGWruOi1Lh1mHq0D1dmTr Ji8LKK1cg+Jme8F+bYGxb11b+DSnReNo2daOGaWC5lgwAWzW8j6oRl6DAY6KIOkR OIzRrVTXhytj0D4GtzUrcQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41b5q3r1vt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 04:01:53 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 47U0LvZl036604; Fri, 30 Aug 2024 04:01:52 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 4189jp2tga-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 04:01:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AVg/LzYQS2LiG4JE1LgW87riTPnFevCF/vBEXKvGQBGtEppzcGZis0QsF4+pa8iaax/d+5jFMzst4Vg9OFNBBBkNIY93exbajigYPcRJSLFqQiogBp0UG46/696+NMTV/sF1PtK421N/+71pIfHpDmltceE/HMRyVVgyML22wgI21mRG4NtN9w3sd34ULUqfoflsi38aqKyKEsifJw4Gj/ltElwxWcLlftsDBPSu8qYytURjz+And/HIjxwTEVgQ/H1bOdNghTubexI19/tiJCQBz9w6nZ8hrwuqog5R6bIdzkGfVIz3TBgebECOlKUH0P3pG/KsceBm/g/qv/USyg== 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=Fh3l+ME+2D7vTnslOnVr5R+ASSp1cx2+4oj0ezr+S0o=; b=VYFAcJ6lY8BddNaoQV+/bchKu/odF0gPZLXn+AILZwx8P1AMnF8AZdwUNrjXWfhWJrAdYjTZRw2hzbIR7bzhD9itm6seN6SaKPDSq9TEjdWoZ0cJi5TAdkGIgI8h+J7RZOff277Tp7nLqdvOkH5AYZgBgcFTWGSB80HxFW/z2LmX80MWco1gJ1RzTKn8QR84GrlCF/cOjM5um2tZop0E/B2PBrysxc4VdJ++Gomtf9Wpjd6Kz0CryivKepa83zB7FEjxwN2z/CU6tgFS8gv1955fbUGS87ExN+QuaxA5bZtViYRYvm6DOkmBCBcXjsrGGLxzAKz8NNFmDfpWrDcYwg== 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=Fh3l+ME+2D7vTnslOnVr5R+ASSp1cx2+4oj0ezr+S0o=; b=zOX0Lq1hj2KUseFK1BpoKXzRr1RiLEd3Ugr6EWY5trF5Qq/qiNpbTJtTHpoKzdXovIo8ywOhaOLS+QwLs8Bs+bI5w3sJCWt4rx/52vBjFHWA2a1lYe9+w0PwECrz0PASqFsFKL5dOT2LlXglCY+r37SRhpauKg+NCTs/p9eBOHw= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by IA3PR10MB8115.namprd10.prod.outlook.com (2603:10b6:208:506::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.19; Fri, 30 Aug 2024 04:01:45 +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.7918.019; Fri, 30 Aug 2024 04:01:45 +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" , Jeff Xu , "Liam R. Howlett" , linux-security-module@vger.kernel.org, Paul Moore Subject: [PATCH v8 17/21] mm/mmap: Use vms accounted pages in mmap_region() Date: Fri, 30 Aug 2024 00:00:57 -0400 Message-ID: <20240830040101.822209-18-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240830040101.822209-1-Liam.Howlett@oracle.com> References: <20240830040101.822209-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0471.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d6::22) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|IA3PR10MB8115:EE_ X-MS-Office365-Filtering-Correlation-Id: b703611d-698d-4682-b586-08dcc8a876aa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|7416014; X-Microsoft-Antispam-Message-Info: MbKYf82IheOWPipB6jwqnALZ9QWjS2XCQoSs+NLxlWTTvQPaRmdPEFHS/96mmS+0z9DO5OZRVc7w4saf5zbmf0ggKkE+vqgT0rMLmY+UkJbgVPRrBaJA3lCYzYzibqFUgBljCYkKaB0NseDe0vc9zOPuGPmuafXEakCDJVuQEjW1SZdsgdxcMHPjrzLbG6PgVGfmrllgyieJ1RiG018Q3UihvJ2jjuTu1L98pw5n+zq3Ng5b6mo6SHxlpm16/eVVgPh/j3KLIrUgWaYRMliFIYodWvviT9bPsGxpHRe4QhSCeNmE2Xzj+HZSJsES7pi6vqncv1utS6Uy3NidhjnAWJ5vwTcRNajbEr9WprLWx+aK4EQhe3mgabnZqf63oABigQKcu7nY6AVys8f9//BjGHoDzXAOX1TwYGReJkSCW3qZmeZEzDsNzGgYbapf6z7xp4yanzBX8FE3q7YpJDsnab23Ke+GlHQajclX8KAHE1xrtQoh8W//7UfWFuo7Ax8Ih5Zok5Gxn/IXSzSi+nbYefhZeyYk3+XDO2ktPa+fRtScgM7Lo/ycrj1mSZnS0OEKUV/kW5dlQUzGqfmYWOxGaEFFuQ6pxOnO25sH3JXI1kZ72lrNbmc3rdDc4q7YDVEgYQSwsd3ta9HtrU0fj4kTnUNBwwkxifeV1hrvPdPlxVsQblEHn2zUiOBrjlr9dm0fYATDFzEEfsjxkZ3yn4fiTd6H/JAjm3fIwGhIJuI5eoIYDiD5xhW3esLEWkipfWiAxHEnOh72xf1Tjqgz0KTzAzGaFCRVco9jcdC9Qg1nrwneIEmHkPFKLz7IXS4ov2y2hWEmhkrVr1tG+IqNXg7HRJJqVGPwzKioB38duFVs1ciM1FQo5lYUGwJjlsbTBMSFNc+YVALts2N936db/EesBX2+y9h+NISRm8TN1EGu6pc8+3E2yMibHoQu7ESWYsiXvlCkc4Rz4CqevHqnLDOLYSufB+9Hl6x4jT0vQnmqkjCAB/QRkw0v91r1fUwKajsAsvuH0tecV67RhjvCFYMO1x4ut7FPvKXk3nf5VM/3E/69qFb2Wk5/ndFRh5wzeS7gKuKOWrHt2lsCUHYfLZQo9LqB2E7DySkFQ30J9vaZZAydoj9vyOENp2T8UXcJjZGYzO+j/0i3Fisd3aZpzPv7qkZGrsMJXoMTzs98R0esJUeSbWWlDi/qSvjA4V/y/8vnTy8WZKlMB+yEoHQvtmezPBlCbiCf5O6Rh3qRuB8B7gxbiZXAUIGKop8IixPgP81Q2HO9wiXPHeyYVdgKGUiW04r5JAAmXiE9UMlGymXGHoojjwBbf5odYrga/0QX7xCr75ccFthZzurL/PqVqmxHDQ== 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)(1800799024)(366016)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: H/OP+8isgW2W26K7s+IcK0vFBt9txn7E4pDhvgHYPgzs6qsci+UcrzxO9ZrXTYz9S4DQLx5R8KSVGAoXTYbAjPrnuEdRihpy+1fboK39wFUIFwwCRM59WYxtsLTw6j1tkJJEz040YmoLeLfjK+XFN1sVWCESkJNz4KxxAhRXe5gS+P1alP/7KmqUjZ/BhBN0jEXSV91v+aiS0o56RhExFDAdY2Lx+N3SQsugRJoNi4EBhg/nf4aOV1ilxSjxz5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q/fwiFS2dHHHG5qVFxkfsatOuNUSUPOpPW05m6jncOiQmVPYmBwAA7aPG5o21wowx+5xFSAHNKcr1z3kV0y7RRTg67sAWYEF2mTMhGBs4FopBhw6CFq3TYrRAVStxOBZuezqogfOULebqy1qQ2t/p9Mrti0kyCadzFUbBLwMpRLuFnZNcHfvi67Zzka79SjGq/CbllsT01oAANmPjLGAakh+XBgwm613XULqQBZHlakZB61fPlt9KPbsUHarCXo3rrXX0KrPa9meGi1dtG4zEv5ehazl91fGXvX1gyUSPInTDQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: O5BnPQCHS421i/dEpaqvmRWx7eRO17/7t7QUSgJyV7CgfeyLvpNT93TBtpAU0V2YdmikyvHOuKysjsxtG6Fr3YIAJXHh3naO18sj9ELzmPJocOES0JNdf4fFrejUN7eMk8OTLYMoRcAMSgEAyARmvVhZtnK2kX17okeoYLEtOwpRkL+jFQmj10eAVQs+mTpdVHXybhMmTpjK7QW4nvJ8to1v4Uet8bR/s+AswRT+t7dy5ERL4+RLC2d06tdkTZLYXLgcFaNbh63mk7givJTQG/rfkJ2ZXlNFAonY+SvMTeQhysZHWAIS02LFUZU6tISilzFKWl33Uu2oPIMOaFfz8QQve3J3N0QJCOdSinUqxVXKxNmTW3UjI/UNhf5LvwVMF3COBzQC0jfkhsOVftVmpuJKYmA1AKndxS2jfbocBpTfa2jE5QUGxPu1YQhcHaLMEeHKLdMEtW9P21tNHQ/lRdCOpDJ+jahsar/kaywcc7SB9WAETe8ZuFwIMxvViV5PCUDldrNKzu9e/Nik1D7COUI4Y/gP2i+0yAkg/4eXk/0Aq0MKjZmRKQk08yeDFj/J+IEzFTx8XISnU6ayeUBoef5iYO6jbJqW+vMo/aFFClM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b703611d-698d-4682-b586-08dcc8a876aa X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 04:01:45.1835 (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: 8DSCd3HTkjiHgUd8TIevB3CaQsSSvjkuHDqJJT/P5MHoaYGv9kfvqh6DMqFnDw2mK23C53tyliYZipVgb37dcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA3PR10MB8115 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-30_02,2024-08-29_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 suspectscore=0 phishscore=0 malwarescore=0 bulkscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408300028 X-Proofpoint-GUID: FmX4xC3_iodGktVw-_nHx0pwMM3pcAdl X-Proofpoint-ORIG-GUID: FmX4xC3_iodGktVw-_nHx0pwMM3pcAdl X-Stat-Signature: mynym5tur8enut9z4germ6u6j3ptd3r1 X-Rspamd-Queue-Id: AAF7B14000B X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1724990522-578246 X-HE-Meta: U2FsdGVkX19NynDZSOIuPe6npSHult66AUjIcYgYnZjHrsyOoslGADfWlnDJl4nEYl3X6lLSrbJMvj140bSNN+4+UwSUlcMADyDJN89MDtouBwCEZjJKVfKCQKwmskTc+ePgBJY7qLx4Ms+AQT5odgmbybprVIFO9Xyj9XP4QekI8vYNeo2msKldedEpc2iw9Y09Tgfxjh1js4ZLNRIupQ6YhWa6jQL94CoMfRvVO649qwRY+pgJy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+EjGapOnZcrMu1Fc8rN9YtM4MRJbe6RGFa7bHtICAjt23WaTq66dSTJxa1FlcPBqP1IedpCACsoeNO49nWalHhAJ61ETc1SZOkprT4jlmdc8ztvwaW6F/fTB+KbD5Zxb38aRLJpNmAKZO7ZKCfzIAyOeqmo5lOq6L5rux9OXwfwhKa6RbzvVtZtDJ8oC/AXm5DFM344zO4UicRMI0U8/hSzf2jWdhxxLp7qHvvUXnwrOAUiynmkZQwHrVdZQ4p4NK10McH2CH0blfCnMRJpK4dzz8qNo08yMpyBdS49Ac= 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" Change from nr_pages variable to vms.nr_accounted for the charged pages calculation. This is necessary for a future patch. This also avoids checking security_vm_enough_memory_mm() if the amount of memory won't change. Signed-off-by: Liam R. Howlett Cc: Kees Cook Cc: linux-security-module@vger.kernel.org Reviewed-by: Kees Cook Reviewed-by: Lorenzo Stoakes Reviewed-by: Suren Baghdasaryan Acked-by: Paul Moore (LSM) --- mm/mmap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index cd09dd164e85..4faadc54e89d 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1414,9 +1414,10 @@ unsigned long mmap_region(struct file *file, unsigned long addr, */ if (accountable_mapping(file, vm_flags)) { charged = pglen; - charged -= nr_accounted; - if (security_vm_enough_memory_mm(mm, charged)) + charged -= vms.nr_accounted; + if (charged && security_vm_enough_memory_mm(mm, charged)) goto abort_munmap; + vms.nr_accounted = 0; vm_flags |= VM_ACCOUNT; }