From patchwork Thu Jul 4 18:27:09 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: 13724173 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 94A79C30653 for ; Thu, 4 Jul 2024 18:28:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1880E6B009F; Thu, 4 Jul 2024 14:27:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 134C16B00A0; Thu, 4 Jul 2024 14:27:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E5D506B00A1; Thu, 4 Jul 2024 14:27:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id C673B6B009F for ; Thu, 4 Jul 2024 14:27:54 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 7E3C41211EC for ; Thu, 4 Jul 2024 18:27:54 +0000 (UTC) X-FDA: 82302904068.06.DBEA469 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf18.hostedemail.com (Postfix) with ESMTP id 3D43F1C0002 for ; Thu, 4 Jul 2024 18:27:51 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=YNaccPlN; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=HWhd+YOh; spf=pass (imf18.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=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720117637; 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=piltnTByFrtmgy9GlOmuLW0JbDdTYktoJ0ISndNfSNw=; b=1mISgj0BBt7BcFMAzih3w4JDgRa5+ck9jk+o4zWpZNWTOVZqUrdXXM3t77Z7s2KFJrVOGf ITB3XtJ3U/qGtXOTJy26N9XUf00T3KfCLLlvqVx5F+RgOoXM+EAuZt5Cv4aSAOY3qELViq VDFp6p1RRPuUmWpwbRPna4KNfRayh0s= ARC-Authentication-Results: i=2; imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=YNaccPlN; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=HWhd+YOh; spf=pass (imf18.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=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1720117637; a=rsa-sha256; cv=pass; b=ElK4RQVG/fF7+byI46EFGw5XMHVmfJuKSd9y+D4NdzIeLwH6AU3Rb9uVXxvYmBn9aHknhr Ec8jCYZe5bCRLZRrjEjNoL9dfujIkYIH6qECSK9wuyHt06+sbDs10quvDi9I2vknrhWQuD ldMBM8Oy9wWppvWSY6zFd4Q8S3ER8Vk= 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 464DQn4S013142; Thu, 4 Jul 2024 18:27:43 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=piltnTByFrtmgy9GlOmuLW0JbDdTYktoJ0ISndNfSNw=; b= YNaccPlN+Op4KzApCwLRBhYZGA2a6Tqv6gtRxf9EC0WD1DEwNtsWdxEULnkmbaw9 8pldx5mHHCPnPiOvxTgfJKlm+AygIOm20P5xVVOLPAHs64LTDCWT57z/jNWv5P0B riQVrq0xgb9868vWfk1cP56YXLy3n7hzy23mLXJ47exLkHdfwLZwv6qLNZr5+vhw ClDGRb75uGZ3knvPUKd2TKVa3tbLe4yOS6/WSNkF720Gne4rIHmuktd/ajVG2ZuJ mM1oJgma/+44myjYRE9OiYlicBHNpbMR3aP811nGQ//iJgbPTj8U875+jMEdd/fi k+y4+Jw/hNacIo5DMK8ZsQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 404nxgm8av-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Jul 2024 18:27:43 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 464G46hw035991; Thu, 4 Jul 2024 18:27:42 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2040.outbound.protection.outlook.com [104.47.56.40]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 4028qacukd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Jul 2024 18:27:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f1PT2LOVQPTe6JnzPWK8O0Y3naHRN6p5yAS+KpkdqFLUx70rMv7/hQF31O9czsBpTXjb9RuyOqtjAlZOQoTRmSYf7kYvMWNbntR9zwosCLl2+7zKODuhZOAlAhXksuCxbE7Tfeowgugb2yqShDPCCih5/eoRJE4ZePDDAzzzbLu74UMQ+t11QixpGETyM75i6eLqYxq88as9i0PZAaG+aOzseXUGo5U2Th3Sf+AhtB69ZlFiQVx5x6FpIJ6jmNAHaqqzfO61w5/XvjyW0XJni7fEjYNlyCroKgVS4zD2HGVfF9bSA/6aI0YPxfgBfDlydTmXeMuoq7VXYHu0+6iE9g== 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=piltnTByFrtmgy9GlOmuLW0JbDdTYktoJ0ISndNfSNw=; b=kKw5awA/LnTKKOYa9lxOX0JO1t2EDn7cE5RAQXi0BtBB6msB9AUnsY7cr6MbKHTrHGabEazbcxAS/tKIN1/Z9F15qKRdHMWOBQblHHohpt6AQa1p6TFcyBCH1kbFFBSX7KjKqYvL/cuwW9oUQrnvDnSZgeLPgPFyxVHUbpC5qnsf+hzexhTN2vHPICRMw2jIQtxjTkdRdXBv+8JcbLmSSufNhWzAnnWMDYMa5zKyPeoDiNjNtS0KY5bBfDc8JzkxuY8T+7IOKSg7wj6YJgM55XN0I0otuxtpjno9ygob8Hh09rVRkIkPlb5GUpaSgolUNYdDrPtDhycJpCRXLWR26Q== 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=piltnTByFrtmgy9GlOmuLW0JbDdTYktoJ0ISndNfSNw=; b=HWhd+YOhP5HbKhmhxgGK2WR/vqv/u+XAMzACe5HjOcyZctLHDpvl4fyrvDXXo6HaOUSeDH5lNPVatj0ov3o2oUbSIDdAI7aWmS+Tslm+0a2Eg4rFvhb8ag/RgKrmOLRyclQpncKsYLAlEx4EKMZclIUJhiPMrtqHeSeLMyhVQc8= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by BY5PR10MB4242.namprd10.prod.outlook.com (2603:10b6:a03:20d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.29; Thu, 4 Jul 2024 18:27:39 +0000 Received: from DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490]) by DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490%5]) with mapi id 15.20.7741.027; Thu, 4 Jul 2024 18:27:37 +0000 From: "Liam R. Howlett" To: linux-mm@kvack.org, Andrew Morton Cc: Suren Baghdasaryan , Vlastimil Babka , Lorenzo Stoakes , Matthew Wilcox , sidhartha.kumar@oracle.com, "Paul E . McKenney" , Bert Karwatzki , Jiri Olsa , linux-kernel@vger.kernel.org, Kees Cook , "Liam R. Howlett" Subject: [PATCH v3 07/16] mm/mmap: Extract validate_mm() from vma_complete() Date: Thu, 4 Jul 2024 14:27:09 -0400 Message-ID: <20240704182718.2653918-8-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240704182718.2653918-1-Liam.Howlett@oracle.com> References: <20240704182718.2653918-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0012.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d1::13) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|BY5PR10MB4242:EE_ X-MS-Office365-Filtering-Correlation-Id: 7e437039-e045-4221-a094-08dc9c56fb12 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: r5wwN2vl9snbJEdW3ZyQiOaFRxYL5aDAblklsBkFV8m6i+c+iMnj50gy4MIBHLzS/xHuryJL4JuE0CgF1sHiSw0Ki9o8mrZYe5Kg247wksXrT/BZZplqRLQzMky3uhNGgCSnFBSCZgoU9FrXkQWvErtffu2qmeXQoPTfeHlGL6J5lIdyPgt1zax9TC+FM2QLaDOpCRDN85fo+woNBZGqyeBj+5Cc53RY8rt2LZzQfuWNfLVqy9F9lsC2w50k0o8/fE2+Q9RMimIYcNhXW78aMmU1CUJSwTCSrHw+KBXTSfGADtO9Jid0fWxFPujufT+EBkX2M0zlhGrMTLpQ/sf8Z+9O2g/jbIepdV0TlfIR1YLJub2WmKtz1yzwngbpfzuxTKtjo1e/DK2K8fcqrsFtivwPpVNDtuozWKBnXDUobSrGMafT22/kMCd7zRLxkFVe/Oiqkeuu6VKrcbGyh59NkSMMWH0Cu3NZD/YlJnOQmqsCizKo8lzR3O0n2Cwp4FiMAzk2b5iQGIkIcTK8DjFpx6LUPI/1JJlBsfscxm5KbgxQYu+TJk9+imshBfeAEyPjBTZNXEkWojYcQYKqWGMr6PH3ZVsTBqu0u2Dmf8PEhUmTHwWyZ7csH5Kuly4M3F3XXQroxp+BQbCyKgvYnwAZXUJCuK+3pCsllPxy8SKvT8mH/EhRufbH/uuQMM1RvdE5CSd6qFnRNGAeVBKj2IYhwLz4VjdbRLCaZp2zhvTjMh+9YFQckHou8Dyo0FkRzOCuXxgasoiNZ2QzOxwDDhYeWh/Vvo80ZksbmybshZ3jN+FDiyOQSMMoy7KmQjA8JCjBfr6Gso61WdkVt2dIMdI7u3Qm9i4gpdLI+4dv+VyWVq7GZuMz8Xtt6MQwvaOU8JdpOLczBjNd5CsJ0UPQX7vuk3O7tuA0uxa1+354vVYwyGGviQRbbj3iH+roCgzM5dzLKcv/m3ospj5zND9QHKWDB1sKqg26wgmhbkuPmMOB5PEG43/w79ZIKZSmqr+e86t/Kl2YHxS1eyw0IUN4btTNw7g+WURBP7p+Cy7lqZdq2xsMde62JkmHMF+K11/I0btVnMX1PrQLNDWATmX0eOBfKHc5gTUXk6RfviOKcQb0hDZoXNle1NvWlFIFqNX9vb5oavS4EFY9psX8Ihielb+iqPQSUm6lEs5siCoZ/wiwYjJHHC5G5anMXb0uRlQeUwEkO2sset5tfptLdtVDNsTJtxhyKp45ZEZB7hFyBBAuHp6rfOJ0DRIX1spYbut4ZqkbXqR/ZmFT37pgYQqpmQVYInIplrtenDOZWxNJhhtmSP8OsI/48T0muSNDpGkNOcOjvpljBo9kP/1ainUaR4y3NA== 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)(7416014)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1t3KZRU7R/s3LvLSH6iyCyXWYkMZu9b+1zhsfWZPH+gBt0VztAPb+eSkQVEsEnszsvQ9bYVxIpScdA37ZyJmk4ZICouGwojKs/0J33yXRw94T/EKqZULCcYzmCVrwn0GTq7FnLoQtWsEwS2l+e9dy0r/uxRorWdBCfoZL8EZW1c04B8YNMeasK4UkUK73J5BvTe1XlmB3D1RPQFG5vMDGpr2zCIIIJG02V8A1bf/diqCdlbR5L8d5OvDev4FL/WY0uJ8AEbqDa3cFJYFIGn5RCmWOvBMvveF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EYsuPy7s1pjA3Ow9jGisZBd4Kh+8juL6jMUAv0H0vS//bkn6uE2VMIa9ZUwYT4Mt6uHTLnRQRom9xTFuBjcUqquZMa5aPj5gq3ZSRfEQ7j9elp43rgWsVRyp4oC3sxDk2OsUnDMmzolVBKALLNv2jkeSXN2M8QIDOsajj5IjTPv3dNNkqXwDdfVzQ09pI/ijAei12cgiMx/FymLyoLGH//acuCP8Ce X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 9GtCMKcF+T6j7XS/5kfa3EH0I0xBjttnczG2sJoPFxMkeKl+XGcThaWU7p04QytVEBwfwHqLHvX53Qtj7+ofTnVKwqkE1VWkZhUz10rJPh5zWH+kFq2zI39/XdKQCKL57PdTdKSmwnrySWY+OdwRzJ1yXuFVUUhEJNEr7VhaoWpRWcsKmN4ZkIew2ff6MI9U97qDOROwN1KQhlt6P5lEdlktrvl2P2bkOUsDiijJ/Rr+xabfTZ+cQnoOpLyBzoWcnPLvntM/ffFd4b52YvjNHHMS+uool1Rz4yAQWI87xUnknzUOiNX9PsPgA8hKjeKT+wJpl6DSNLtX+SKA48uAechGMtlk3KyHPHkP8prO0JEVcdp4bq2aK5ZOydy4jdky3QMdQeCVJ4UHZNeh97Z3Fu5W1GlZXcJw7wuJ4P0C3RC34TSnqKyeYMN7w8G4lnh4SPZzJUFJuHqRdlkMMbzBdJ11JfXCOKHEPPnOLdyFuFr7QhOMY/jNsEqhKGizXx9z+iUzdyFbhOV1C4SMRPUSX5mi4lFRPUx4tdBex1Z9LFl7LzV6pUI9IvUQEadEKIrV+x4ZWyWH+hFDRFy8aOFweWsGXQ6CZMjgazDru+pVABw= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e437039-e045-4221-a094-08dc9c56fb12 X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2024 18:27:37.4039 (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: ZlvP3qITeR6HjAzTFEJwNeNnDc4WUABgXsSbZ+67tTyWlpqnmzaTSsV42rEJUI7i76o5DF/UtDMGvoVGYBclfw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4242 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-04_14,2024-07-03_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2406180000 definitions=main-2407040134 X-Proofpoint-GUID: OmqTb5j7iZz6skuVwHvQX8O8_6BNGWUy X-Proofpoint-ORIG-GUID: OmqTb5j7iZz6skuVwHvQX8O8_6BNGWUy X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 3D43F1C0002 X-Stat-Signature: wpu634uresbzub5kymuycu4himeecbxr X-Rspam-User: X-HE-Tag: 1720117671-270463 X-HE-Meta: U2FsdGVkX1+YCy0T1ZlevHiJXwjQ6BsGjKkbicy6acj6HY2dCg9AIe+/4xlfl16XmiQfDgN9uj13MxjTHmPS83JIBlUYDSOGEWZcJtxVpjKKF2mMtqoAxWQXFFZEW6hiriyHkkv9P22gLMsnmJMHZqZVPe3bAWc1+cIAFWoiuaCxOf3W1ttYUGwMAqniRAoLThyNc+hb2IjWsjulQJntZfWGHpR/ncohRKGUB8suvUSbCuqBhjJXggJHm2LR45Kk6OUJB2hA3m1iOryk7HRkGmRoqr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EDK5SfKo6cpaEiTPl5rxb3JM2fAtwlHU2l6SktVhZInYdXcEng2eFi+MjA1/k0huNXZnxKSh/hBTcGtb5eLDZQkIEIj6UogASIRK+6s8C12PTLEqSq82Gy04zrtlM3L1sC 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: vma_complete() will need to be called during an unsafe time to call validate_mm(). Extract the call in all places now so that only one location can be modified in the next change. Signed-off-by: Liam R. Howlett Reviewed-by: Lorenzo Stoakes Reviewed-by: Suren Baghdasaryan --- mm/mmap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/mmap.c b/mm/mmap.c index 2a1a49f98fa3..8d9be791997a 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -646,7 +646,6 @@ static inline void vma_complete(struct vma_prepare *vp, } if (vp->insert && vp->file) uprobe_mmap(vp->insert); - validate_mm(mm); } /* @@ -734,6 +733,7 @@ int vma_expand(struct vma_iterator *vmi, struct vm_area_struct *vma, vma_iter_store(vmi, vma); vma_complete(&vp, vmi, vma->vm_mm); + validate_mm(vma->vm_mm); return 0; nomem: @@ -775,6 +775,7 @@ int vma_shrink(struct vma_iterator *vmi, struct vm_area_struct *vma, vma_iter_clear(vmi); vma_set_range(vma, start, end, pgoff); vma_complete(&vp, vmi, vma->vm_mm); + validate_mm(vma->vm_mm); return 0; } @@ -1103,6 +1104,7 @@ static struct vm_area_struct } vma_complete(&vp, vmi, mm); + validate_mm(mm); khugepaged_enter_vma(res, vm_flags); return res; @@ -2481,6 +2483,7 @@ static int __split_vma(struct vma_iterator *vmi, struct vm_area_struct *vma, /* vma_complete stores the new vma */ vma_complete(&vp, vmi, vma->vm_mm); + validate_mm(vma->vm_mm); /* Success. */ if (new_below) @@ -3353,6 +3356,7 @@ static int do_brk_flags(struct vma_iterator *vmi, struct vm_area_struct *vma, vma_iter_store(vmi, vma); vma_complete(&vp, vmi, mm); + validate_mm(mm); khugepaged_enter_vma(vma, flags); goto out; }