From patchwork Tue Aug 20 23:57:26 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: 13770678 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 B4F02C3DA4A for ; Tue, 20 Aug 2024 23:59:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D2DF76B00B3; Tue, 20 Aug 2024 19:58:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C95506B00B6; Tue, 20 Aug 2024 19:58:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8C8656B00B4; Tue, 20 Aug 2024 19:58:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 5A81E6B00B3 for ; Tue, 20 Aug 2024 19:58:34 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 24C671A064C for ; Tue, 20 Aug 2024 23:58:34 +0000 (UTC) X-FDA: 82474290948.28.E5C833F Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf17.hostedemail.com (Postfix) with ESMTP id C87F540008 for ; Tue, 20 Aug 2024 23:58:30 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=SPDSiMuB; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=PIzNBwH3; dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf17.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.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=1724198222; 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=YdZVOBe/SNp5Gyamos6vbsGOr9rKM7FOBCFAvFJ838I=; b=AG46TtUy6H6HfXxhem5CVBfcuGSDrb+Tvvx4AbmQ9xnBTKrrfUrrVmV+OdkaDmFlYREi7l tdvqiDjjoIm8fQ0hq80Nie5cpSsi4Ly2cphFtjOu/2b6pSfEFlVBw+xvF/3qYeX03ovBQS FyLoahDMCU/tA2rJDEvT0LEVIEqlJrc= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1724198222; a=rsa-sha256; cv=pass; b=2NkbfLD1OetTJ7zkzC6BkSwj8zEioI4Hhghk3/aOq+VGZBt4qxMrOU0wNOCEcnm3uGVFLK 1Ll/5pE26arCmNwhharV5xBV6L1Ypukauee/0lhGO8H6j72t4n8ACoKTIfXkeeGwBKcEj9 FHyk6HtbPDSEVqVCn+kG2rEnRZwdbsU= ARC-Authentication-Results: i=2; imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=SPDSiMuB; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=PIzNBwH3; dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf17.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") 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 47KMBXLo032213; Tue, 20 Aug 2024 23:58:24 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=YdZVOBe/SNp5Gyamos6vbsGOr9rKM7FOBCFAvFJ838I=; b= SPDSiMuBVgmFyZ1IIa5G7NUixs114aVSUM5dFdjecLs4ZuAoyCI0ciHVUVF8J3/o yap0kVUd2dupyHSG/xxkhEfKMb6FCzDhJna3Z5KQsSvIq1f6oz3lfXa5DLmMrimX a44PIc7kwWPaIyIN/aKan2uA+tBN9qeWr70qjdBeVEU8duAvFIjyeeUir5wYBU+g faNaXLMw2FZYwUPfrHhB6QUXy/e+8oK9FfSUUBOWpFb8yb7ElXResUcasntIm9mE 9oq4ckKJj66gf2EdM6Xhje2s7AEV/X5iya3Kq8gFaMZDnO0arzj/S5iO3aJUuWy7 uUWbMbQ+38grf1EP+p3TNA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 412m4uxbks-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Aug 2024 23:58:23 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 47KNY1IO023382; Tue, 20 Aug 2024 23:58:22 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2173.outbound.protection.outlook.com [104.47.58.173]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 4154x78g2k-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Aug 2024 23:58:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZaTl0iPLw7vGliZ/7FCuPPXs8x5ySunuuJMlJSZNpMV1u95CsjDGoTl9xvitaJZf0KXC9P1vHFDYC2JPzLX52taiUhJ55M0fdvLmtT6ASQyi0qp6MaQ796hQ5VDjM7aqmpxtVri0PM/5AbLiol9W84WsDEVMozvUCCOjUB+LT5Xycoy+Ixwp+9uGoRbLJjOV97sV+bSQNzpt5sB4divv+Hiv9boQKUvorpF3PbyVnZoNyfvOddaGibwHsckLzhn7/r45xVPekMLFLt48Q29nmbBt+PIbYE9gn0lJTTPvp/Q98m8+r5u7n4fbYiXuBU9NTBgno3yIAzNz9cLL0B3IPQ== 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=YdZVOBe/SNp5Gyamos6vbsGOr9rKM7FOBCFAvFJ838I=; b=vOmFC0OeJSBsuEURv2gkwmuz3dhdXTZ5r/BWL2oYHtVHtb4Zw/LMo3Auhr1RAw/VoXKfGbi4uD3LkOcGRNmCkO1DxzGQJiilY8arI5uFDrAwtNIn2ToyKxK+MOiXnZdSQJTrd791gj0XJFrFbFeY8H/Y+H4Aak7l17kwpfCQXMEgRdQiIwv51sQQ54Ti3VXcOiYwU0x/3yrK5qGpre+R4lZJIZ3ZQHxLSF94+6Pes2T6n0i79apOivDDP32ONYptxZg65OgUvSUhkRbpRnl4ijThUXkVfL2vHoMA8IcyC/rnsis1w+CoY9s698GQadsbjv5Y74TgzdGm+eGio1MASw== 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=YdZVOBe/SNp5Gyamos6vbsGOr9rKM7FOBCFAvFJ838I=; b=PIzNBwH3yo+MMFouS+WbdBsRIMZCxZ8fp/rC7c8nSgAlF2S5/JgjN7AWyV5BnfXpQBGEr6uMTzscstO7FIUDBMu7h7TSYe+Z5J9CrVnC4jFLfp3hDo8givgMANnPLZg8M4zwEIeoH0bsvRcpP9J2R1ZfHmKaGsyW3peaBx64Yho= 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:18 +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:18 +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" , linux-security-module@vger.kernel.org Subject: [PATCH v6 17/20] mm/mmap: Use vms accounted pages in mmap_region() Date: Tue, 20 Aug 2024 19:57:26 -0400 Message-ID: <20240820235730.2852400-18-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: YT4PR01CA0360.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:fc::17) 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: 2193816c-a38a-4e79-1918-08dcc173f6b8 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: ugGUhwENs7VZ9v5D1QMnsLcJLeiWIggF0i2Usfsw8eKN09fnAJk7G0gniWkA+YXDci4OtdBVkK3LJSugKmdEZGnRz7N39HQW1ynm81mVZFBjbrfP5mnZo9xHn99lA3Vkq2Q4yIpf5T0qEu7TW+23sxiz37gRAAl1TyQpCPwSVSuXAlv1l8den6n5FJCuG3fLqXXoPgyNjvpVPvEAmo+l31aI6Roa57R5kkA4qSAtotflgoOw6sHhgG+vl6puckbQxxqFYB5YFhfhgoC4LyXNIex7yuJe9CwApvpTp3eN5/uVb60nFyCkVfA8y5VEm0Psan7Mqw6FMpc+GYEDmn6mG2A0xVUtXwlb5Pc2akxF17jusaK4rTnIgd4GDskP2yx5J2EamhYXeHRBz3Hlsml0ZVRkSrYvb7zCCbL8DzoEp981AjUdHyaiqsqJFS6eEOQYydC+eEcW76XIob16MYU6a5O+nMcQf4K5r1jupw+y5XDnKGf52INU2OBxFtPcjXcm9dmwu+WsgOL0om8KrF0KpV3/fCBxJFkSRReXeHxOB0XhiwpXv2Dts3mCLIRbD2Nce4wMtJ551Na8o8dGTvuNbxLNw4gtpDQPN6s5jgXNmzR42GJ6PWX4qUmJ1EyCRWSZuA7EzEgHIxOD3nIfNDRgAMZ2yOvJwefDV9oAkrmI+gI6njjebz/S/X2EozaCv0/02onDPDMZoVJZFIjW5itxmkKLLQxvrOeofTTaif198HoySwzsM8lRaa6zD+FyjLBHURhx717tmzpeIWl1Juj9ESaYP1zxqx6A/88le369qU3ylJ/5pJLvbUd9KMhYZ2d9AWRNb41e2PMMX9SBa7wBLvJYnFon2oAP6cbrw0PC+N0NzNY/tYp4CtX1dWZEV+zbFh1nwUJOlkoBTb1o3siuvjH02Hn4jITmFbp338YwdHkh/GpvELFzjcliR751WTt0FIJ5iyNVo1ieFz9uKH1nkSGPHnuD3mIubwaNeORsqBDydUNe3kVKBwBXSEVH5jh1xYjQCYuAt1FG8Xda1Z1Lpk77ggDuTQEKueYNy0oElrw57Gf+XgszmD439rmD5gnK2vLmcTBPwZt2T9ERXT5d/rU7sSSBD37dT0/jPv6CexiNqy0bDxMEpi49oA0aWx0nvh8kBUOWyt+AjryuJc/05YTG0txDBHHm0UAmG6UqdZy9pXN7hScsbD2n5tPs8Mj3gwDz0gS371z4yh4wiWAutAkgjx8gRvLDZpc5RpCnk3WJuxKoxauOCFTTWmWIfMZfAmcgTFFSljKUAaFFTRytDgnf1N2UntMw94QB4ZqcyRq5Qe5mUz41PaFww6VWmrkADnbfdvFoQZFb5kswYdZuuA== 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: TacRV8UCP5dQNxg0Rg4XsDdZZzT5pKWsiEQzggnVT+HZIsSkIwmpPhATT0Xg+Un8p/SXWRh8WcgW0CIBMgqaUsXRHgH6GiLs2Nq3gWam31/X7MW60KpeGz8L6f7JXcGUqUiI1ZD5LrKP8RTKO8Or82HNXPuB6/P1WiVaWokMdTsGSyExcgKY2ywXC5pcM/Qry/mTrhGmMoSC2YbEQZwFlvHDwTtdIc0Pa58BpFLU4S1gASgn6mnOGxwFh0cQJ6AczpkyERcZr5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eKbM1cJ0u3Q5efZ0+15qr7+1/xmM7jgVn96h5v/GOGG8lF8MyW0N03h2lGBrYvJY5QrIz9JR93i4T80aAmxCFaPcoytWDdL8ynwoy0z3RjaeDyEZx4pv2s+DTn6m+GNZiUpJn5YmzbSBgoYSw9V1PVMqBBXuo5Xp2214XS3S8WmQ5Hd576SBll7BhRftzPVyolh3zNDi6rM4vUZseNepOvYlTDYRGrEMhQ18ucum80KrbjheuaB+3TyY1KYZwrwHWr2UY+J4upGMPTLAg== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 0znNVfVx2+edekKECh5vd/FQ32lUrovxkBQLOk9Ox9pX3EZkhdmw6F4cfNL0gny84CKvwYTxN9FBHinvpBj+ju7+WN+YOWFexyJhOBjHlatHxaZsukXmSQmk1EUTbg+6xRI28xG+bJGV0qUmvCIPVuyUR+/hEBl9tlNXuCNVNKVmQuhANpeAdZyb+ah+SOoWOACcqBcP6o8IgQToDwF4fHkrzWhRl8EpkoPfBPz7LFtdg41i2Dqaoyfr5zRU7nh6QM+6n9WtQR+iJfhyL9/oHa5vXNTfkBAAWFaU1p093q3oXaSn4/t29zaMWZmZmXwuX0Ejg4RNktncrJCkJrBoJKDjw5pNOlO2wG0ixTMM3UfXN23p34DGHtaEe2JYpOaknPcEKzW+KKNjXRUFk2OJXjywOrIZHkRyqErW6rEaDVyhfUcI3xby8hjlNwFS6pti2GNQT/EnVRh6ko+NVlU1an6tC2QoUKsoGVkjlXiUOC9//db/rO5jRRdG9kki0pnSKPfdAaQUD1zxcUIvPYdhBkYpLpCrDYISc/L7oX0RPkHttrU3veU8IcznW59tZp+D5A2U4WIvFqi5VNsqmx7uKfl7WuNcE5e6LcEL3lKqR88= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2193816c-a38a-4e79-1918-08dcc173f6b8 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:18.5569 (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: 1Jj2PIDkCJD4oWjXiw9tY3lMwC/PRFLQhmHvo6ei71lPhmto05fKv+GIhF99984VGHU2DNGJfQryRavaVBhryQ== 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 mlxscore=0 phishscore=0 bulkscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408200176 X-Proofpoint-ORIG-GUID: ygTRTKSU41nIUsQshqcdOFq9RGQOWhFt X-Proofpoint-GUID: ygTRTKSU41nIUsQshqcdOFq9RGQOWhFt X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: C87F540008 X-Stat-Signature: 97to4mq6joxswksghay7m73pofyp9jzj X-Rspam-User: X-HE-Tag: 1724198310-942427 X-HE-Meta: U2FsdGVkX1+0Vydd/YzIG3HzDc7h2bHyZA39xvtOKB0z4CtPkvw0x+uGNbTsf235M1zk5VGMGjqE3LWAt0XmUawSkVLt9kwfPsQotmYjbS1MC8c9XKIXD4/QO0ZODf0b9iWp3dBr3mqpiN5ax3xA4XFNpxYrjEGgzBlO4lcXdIRIppQR6xVXu8LIC2TUShzCfRpNUSGClL2M34E8SNmW4X6/KQuI6Wgml9ARjxCMl4FVN2eKqp1it2qB13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ksYd32OLPF0UYqTwpEeDq4++3tGGLVUxLRoD+UlrcRfqDkTOlhjv5YU7WCiHD2FVs5RM31x+w+NVhF/JAGd0loy7502Rbp1Tq0ZgwFMOaCXaZFQuYYw1knrTDqXEyqAh1CYjdIYTsDeN96ognWYPqBUrA/tdKSwJ0YAjviHFxH6fY5W8M22SAY4Ow2t/oPCUjyFF6rsAt2QbNJoNFFJEILVvJ0NF7ZXmM0HYWhHsQuFAcp8Mbn7OfR5y1jICsIyeeCJekSqXB/DZDMIqI/jn6Y= 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 19dac138f913..2a4f1df96f94 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1413,9 +1413,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; }