Message ID | 20240717200709.1552558-17-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 022A1C3DA60 for <linux-mm@archiver.kernel.org>; Wed, 17 Jul 2024 20:08:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EAF0C6B00A9; Wed, 17 Jul 2024 16:08:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E37186B00AA; Wed, 17 Jul 2024 16:08:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C3C1B6B00AB; Wed, 17 Jul 2024 16:08:05 -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 A077E6B00A9 for <linux-mm@kvack.org>; Wed, 17 Jul 2024 16:08:05 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 5C5BE817D8 for <linux-mm@kvack.org>; Wed, 17 Jul 2024 20:08:05 +0000 (UTC) X-FDA: 82350330930.30.2210262 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf01.hostedemail.com (Postfix) with ESMTP id 1C0D640026 for <linux-mm@kvack.org>; Wed, 17 Jul 2024 20:08:01 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=fbcbr5Pg; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="iV0/F2gR"; spf=pass (imf01.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1721246861; a=rsa-sha256; cv=pass; b=eq6lIT42X0QMWU92M9faceGYChyScRcw1KOZyVU++Ri7v9cgNQz/rXFfsq/4PNbdS8S6Nb ykE5T490klchI4hawtF0Q/rzT5CYyb0HZ/zpit1BiQkILUZEBzgAVHUNviWAX3hyFCUUCC sDcVwO+Y2UJeJ+OABPb/3ZMK9BxRhr8= ARC-Authentication-Results: i=2; imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=fbcbr5Pg; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="iV0/F2gR"; spf=pass (imf01.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=reject) header.from=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=1721246861; 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=MCbfSOiY26c0tug8tqf4PmH91ko+wJF0zouXoNIkQsY=; b=qO1cvpkymHjHkQuivmhaFqs29uMnwTQYDsI4MAfwQjO5CeRPL+dw/frqByDfC0xi9psNxQ kbNhfyMbEqRFOFqZXU/cRF58Nsp38HpWfSEAk0/qeldaKbu9ZtErrUlhUH31mSiO0XS+ad o3img0sbvKxVC1oR9++R7el2q9M0sGA= Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46HK506K001775; Wed, 17 Jul 2024 20:07: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=MCbfSOiY26c0tug8tqf4PmH91ko+wJF0zouXoNIkQsY=; b= fbcbr5PgkKibnorf25EFp7YP1VgRx2+IcisNa1tOhzkpGfdp3g2qB5oN9IYljiNt /xXevkti+GUGbig9fNxm605fo1v57uryEIlw8pnGNxdVvNvw5P8vIy/GgDNcz49b xevGR5C3foGAplAT8jTFnBCi7g4vXrKIduGhhnfLFZ5u3ODfqOcTyX3ZKHv8aYGs K70QFk9F6rUl+s7n2Zn6j/y41qM9Os+F/xEjjMa2wEvlLEPEJq4YfMegNKlEsETi ZFzZRY36B9um4IQOlmP575cfFej2bUqMTEq3aYfSvQG68J9t+gqpKJ9W2ObVuzJG mMs6dDGKPomOAs0546tUng== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40emp5r08d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Jul 2024 20:07:54 +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 46HJ4sqC003630; Wed, 17 Jul 2024 20:07:53 GMT Received: from outbound.mail.protection.outlook.com (mail-mw2nam10lp2049.outbound.protection.outlook.com [104.47.55.49]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 40dweyhkte-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Jul 2024 20:07:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=isvng2+bqIeHvnXEkQjGv6omCKsHzE0pwv8YMikhufc27wzT8Bs5MttC1e56YQ56fAWzTgCCxJemYzorMWaO0aDIpEQ7cJY2cCXOGWSdR6vCjUkeQaEYXq6YBzibZxiS7G/FhmRtYzDnUx1duRESG+xoHVRKV2r1VBIZrMltC2M1bmqtaNebbw4wAuKoZFa+9iFR7C1h7VGr3bCO1220Jd1uOm1Bmo0HYPU32kezGwG6iX6hMnyYPLzqRGC0vI/2t1uUsbZRR9Gvt8kzfM/7Uu5X3p6/w+TgDuvbBhzdPomQjInppwLN6bQALMEsCDwXfJGGKTixxi1RXAeBhVarWQ== 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=MCbfSOiY26c0tug8tqf4PmH91ko+wJF0zouXoNIkQsY=; b=tiGj2uaxoL+JVuF3YBwvED8hYABrcR8ZeJQo3F4SdcIVNCWhCbGx2oAQfIfwzx0s9789Zz3mWmyVv2L+RtLDNGJFCJcCFBaqZ8tDxvP9dXSc1J6YeEciIhL57PzZEQOSUgbaaMYvYrsVjbFlHF3iSxcT21UxNNLZOlKXlj9neGAtsSdvSRobW1Ro/EHR3OSMlJCwhTwitJj/dHY21zRlmfo2F0XxuJ5AvJea4hq3I98m+cLiLupjZ2bTjzBPAHiTbZjLt12oY4Oc41EeA35bWPAlh8z4h5CCtCvjHzpXc56Mo7PRKUw4+O4/+Ys5QlLKJ1w7rtIFahqIa+YAUJLlMQ== 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=MCbfSOiY26c0tug8tqf4PmH91ko+wJF0zouXoNIkQsY=; b=iV0/F2gRQRAVbH66OCrIl1dJy98XxjJHGQbD1Ow2xptRKwvHW5S3g2lUOXHIOm0M/ZIhaxdt9cTpLTVs2YnzL6QzHT0t3MJRdHAIQ8MPnXMtrGn+WXoTrSIVrmneCTgusS3UGC3QkpGHl53EA/kbm41Z4s4mbQWMNkiv0/Wb2ro= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by PH7PR10MB7694.namprd10.prod.outlook.com (2603:10b6:510:2e5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.15; Wed, 17 Jul 2024 20:07:49 +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.7784.016; Wed, 17 Jul 2024 20:07:48 +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>, Jeff Xu <jeffxu@chromium.org>, "Liam R. Howlett" <Liam.Howlett@Oracle.com>, linux-security-module@vger.kernel.org, Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Subject: [PATCH v5 16/21] mm/mmap: Use vms accounted pages in mmap_region() Date: Wed, 17 Jul 2024 16:07:04 -0400 Message-ID: <20240717200709.1552558-17-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240717200709.1552558-1-Liam.Howlett@oracle.com> References: <20240717200709.1552558-1-Liam.Howlett@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: YT1P288CA0003.CANP288.PROD.OUTLOOK.COM (2603:10b6:b01::16) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|PH7PR10MB7694:EE_ X-MS-Office365-Filtering-Correlation-Id: 9cc32298-6e7c-4f7a-3ad0-08dca69c213f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016; X-Microsoft-Antispam-Message-Info: TAyRJDSWQDWgGC+3RxkdDK5lS91gdClMsni/yUfZ0V/BsUGi25uwLYhAQNTr0Wor/4Abj33AoNFdoHEpvoHCsoXQZSybJ5Ry4UnKSFKiK43wmKTAAJtlu/8epX15b6wxTLUmf+s1EjZM1TES0bKb7jFLRUK7YYv4f7pBxvqY50HnrV3CGO26WAm6GTuxgVl4/vTh94n5jnURFfPzmzt1K3Ce2nlCfRGtbgC1LZoaYu28u6uZafVHMEM+RoDxJiCbhid/sx7cE7bETvMHZFc5NHmpD6xXvIv+A9v0VMqct11g5TR+zNUdnwUACzMONpcigp3860bUIxtn6nsgsLADqA7Q1HvmCNCBSGHW9ipD5rtPtImPS6CNPm22u6zP857cIPFdXXR2nuzllnZdS/9cHVjLBM3HUR/RCiDUmTEsaI3RhykfKzguYXt0ErD4zhOnCxNNHjnYJjbfL/aUQRHaZubUsn5GkEZxWXL2j9mbGSsc7nlhyqRncC3KbyZ54LVdIWy0t702ZZkuxZAHUptRQM1ndxlJWX1Kce6Dov7LwfInndgSrcbH9DnWmieTQOfFgZZvhBMx11dYdkpuo5T4uBMWcTXzClUwcGBezzcXdMDE5iIvCCFvRFKhk1nfaC4HUZQIaX3brABIiHBCvFakDL2fiq9mI4ZW9MGlR7UclnkbI7GLdec0y4Gk0C9RqHJCZnSHJ+RCp5rKEwau5ZwwcuIzpqfWukQyslgeURxXPJVaVy2ia8c4k58M8rtqtG+ynA/Yd1ftOXUkEzq7blJaYK3IEasMefsLyFPsucvWemfn/wGUZHk37moyyYxpYPV9qgsJ5SOEvdYAJvFnizvp+u7kcNvwiLKNIqdS42ZpRWxhKRM4LAs6DTtgNnrdESO6wYOQB1qfzf3pJqqZRoiZaZTcvjYlGbKodW67Mvc3rDECDH3r4tPqOfPXLx15QBwCopXmqQHLM2IXTrGEI9Vo9Wm4X/8st/WEGeU774kieJJWqhPZAVrJabdya6gOeeDWIf1ydG4ZBvwJh6ECCDluwAqPIbk+cA9QdC6dbhFN/X00m0BgcuOZbQBijc3C+b/NE5aI0XOjVOolLbZjk46/HHXmqv/14awV/lbtkfWdrvt6CVcEgduiciMoURi2IDmiV75QiODChZOogAwBqLkao3M1YOsXpMmyNlZJI7WoWosNTwQaiCh4dFHOyP/KROuf38LsA3U4N9IZefpn2EbBOvPDOUgJYrlyOlxbF4N5gusPjRfIH1JuBpo9+edzoHSg6P68FQvOokstyJAfPdnHwdYr+T0YHiRLbzgeAw6aY88dYm/6VAZtVfOJDPYIyTAwFLAoj8hNpB+ZJGn8mRRMIw== 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)(1800799024)(376014)(7416014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RsHnykufyRporE+RyPOFAcvrQl9fDrnoSfcdG1NEVil2DTSYJFcgYuS6TqILeP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bkFVnCjlAwJk0YvoJRkG9V0LZknoIadwfW4/EAvYmawykMXW5sD45e292Fuy6TOxnpKvUx7Ym6uHx8bIgNOR80o= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9cc32298-6e7c-4f7a-3ad0-08dca69c213f X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2024 20:07:48.3854 (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: JTolng7QH+bo7vQZGWFyqcjAOUnyUv0F1QMzjdyn+RkSdlKISRlnX7CAeMJAe+apWGHz8231pI9qqsUROJv79g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB7694 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-17_15,2024-07-17_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 phishscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2407170152 X-Proofpoint-GUID: E8g3xFjVZzLUZjxdi8zZspmxq34O1EtV X-Proofpoint-ORIG-GUID: E8g3xFjVZzLUZjxdi8zZspmxq34O1EtV X-Stat-Signature: hk9nscftrhbi7pm9dfu93twm1qzw5a5m X-Rspamd-Queue-Id: 1C0D640026 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1721246881-1392 X-HE-Meta: U2FsdGVkX1/n0dyPFFnEHm/wUx6rLeWAjJU9HIe1SZx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lwRmBUqVR6P60tx9KDVk+rXZLjwwfjbkFKxGFKzE5RrWJx2CSTXyG8nYM0zH1dyfpkAglms6pnDN8m7R2mW76o+GI+zV8w7R3msypv1AM3hzQedZVxhdYwYO9HKYlcYI6sDJD5Y8bmJBKlFVXuSDh3hEEDU5W47t7nZ5Mw1utxTTiyiZzJyqQx0P+BQk4LZ0/9Cs0lAw72k8BAUYTkEcFcfbaKWiM+NCGM5XJJRwJ6dmHB6KLP4Sd3DVXu+KdOryMaGbzCsiP4CVkU5W4bY3kymetcqWZtfPGMZP9PCqWBHU752yxER/OoUXNLnkmLqE7gx3yT0LfymIqgE8uDVWhYosViXlKnh7BrZzSAf+cxOkKW+RV9iaB3QApWnMgb14wV251nwiGTX1fMDzyBaH2WytiROkHXyAkU38v7xA0c9V+SbvShNOFvyFOfHULBgz7sDmR7OWCYoJvi 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
|
On Wed, Jul 17, 2024 at 4:11 PM Liam R. Howlett <Liam.Howlett@oracle.com> wrote: > > From: "Liam R. Howlett" <Liam.Howlett@Oracle.com> > > 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 <Liam.Howlett@Oracle.com> > Cc: Kees Cook <kees@kernel.org> > Cc: linux-security-module@vger.kernel.org > Reviewed-by: Kees Cook <kees@kernel.org> > Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> > Reviewed-by: Suren Baghdasaryan <surenb@google.com> > --- > mm/mmap.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) Acked-by: Paul Moore <paul@paul-moore.com> (LSM)
diff --git a/mm/mmap.c b/mm/mmap.c index 45fb8725a6c5..9f870e715a47 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -3026,9 +3026,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; }