From patchwork Tue Jun 25 19:11:37 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: 13711862 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 95A42C2BBCA for ; Tue, 25 Jun 2024 19:12:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 61C5D6B00B3; Tue, 25 Jun 2024 15:12:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5CC616B00B6; Tue, 25 Jun 2024 15:12:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2BF1B6B00B7; Tue, 25 Jun 2024 15:12:22 -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 075036B00B3 for ; Tue, 25 Jun 2024 15:12:22 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id C56B0C0565 for ; Tue, 25 Jun 2024 19:12:21 +0000 (UTC) X-FDA: 82270356882.20.8158FD1 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf15.hostedemail.com (Postfix) with ESMTP id 7B073A001F for ; Tue, 25 Jun 2024 19:12:18 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=UBxLI7bU; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=j3bwJdP0; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf15.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-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719342724; 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=1UFcXJOr6Nl82p3TPtHa3zL5xDw7Fqy/NwkM5f/H3ltoqJu/R2Gb9r9D6ChFAAzSnIfghx IDHb2t043HNZBFTzExhxlkm3VYQprBcDk0MRELvVrujrDI52WB31mZ2hSWKpC9nnBmiZKb xu0eN/00kQs2UQmHBKW3HWnM6c4fFvA= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1719342724; a=rsa-sha256; cv=pass; b=5ppjGO/PSMZGJsS3zvaNMfDu/wJUbljjxGnCiEDgKF9ZP0Vdphd0hJ21XcbfTrPEs8W4ut 54mghRcr+ZnxCTdEjcb1T/gg6T9D5YJh0A8Iiu/+K5+dhUa8oOcLA3/R6W4RxR/R+j9nN7 ELICjdCFE6vxnKQEVO+AxI4q/qaFKe4= ARC-Authentication-Results: i=2; imf15.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=UBxLI7bU; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=j3bwJdP0; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf15.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 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45PIfTnH012802; Tue, 25 Jun 2024 19:12:10 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= UBxLI7bUcEAsyFW+Jq9cNnNP3aYY8IwswQYwtJQWKwkJPpzXMow/Vyryx1w82vse 4ujW4T4nOxUYBAgH7/svRtmGm7j95y4iIVfrytMP2paj0PPzGYpC3BcPjnVKjnwR 8HyrjaS+u4HJoc9dQ+3272vqY6Nk85cthRbmyUnHSu2/zhPj2MRTLMA5Xuf6XK6E j/F6pCfxuuxLObVRm/An1Muapy8JgsZ2gwjS0PfslQQC733DpGgu3FcY2cdpze+0 siynMztvwb0Zv4QAQtqKrfB5PJiPJkD74YfgXM+7yor7p94U2GrTHimvDh+8ksf1 WPf+U1VY0Atd4prv3qsjWg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ywpnc9ub4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Jun 2024 19:12:09 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 45PHonQi022616; Tue, 25 Jun 2024 19:12:09 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2041.outbound.protection.outlook.com [104.47.56.41]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3yxys4xa89-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Jun 2024 19:12:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KBviEvCxPsvuXHyws+sQvPeLWcv9udH8BcQihPhQ8wanYkMjoy6UjV8pnSvc0okpcYdpgsdBosPwdOljCx7YZD6Pm3AzBn0HbdXWFEFZc4sVdys6U0KyLEonESOkSpovJSr1EZhsvjm5AVTNJve1kNhziMm5nfal0h+dAhA+NqSK8q909iGLX0BhsDRag48Bnc7J9Yeo7V+grlTLn48UK+P1HfrKKQ9QTkntQ4vBuS0BsuEPlVJawmWb3hCx/CczZcwfVMrAwG2qXTk4F2MFtplAzrVWEEbzhPhzVISl+P1jRccH8GztN2Rj/q8y7lXZPm7xp/eBhAbeEXXMkcXzfg== 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=QxXzlQ/gI4uOlCMfkpjmKhCjID1756JXKlx/YEvtqBNb/tFG/RFyYB/tnSLMu0/2ePqGv9pjQ4V3jMaQ4ipF5YBItipL3Qz3rQFJvWCCzMAhcJ/IE1uLJ0ejf505gzMIgQNmd6GXN5kS6DqCBw4axfH1q9nnMce3UPryZNd3yULXZn/jTS64BvSRe+OJLXx+xdfLfGrHprNOvsIxqSTp0IPp7PFE6QF9H8I7AjapNUPzK33jfVp3Tw+c+AGMlUKl6/GrQKrjoc5JJncDebung0GnWhvxdOk7MQcwlOgm1+wjOPQDUA+QOUSaQ3GLDYVQidJr5pT7zS2lCtNNLg/T+g== 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=j3bwJdP0Mj5Soy0vUqIljN3Ubf3WM3QPJuUa7XoqadTCNv/B2n8ccI7Gz2dnwS8+ilGOOF3Dmr4GqPZckeziLKsA6AeB+6ptfJfsxKKHrma12gzpuwhmhWZUoqBdmKmjToMjZzz6AVaV7rq7OnYR0vACDuNj7WDd2I7ZOGb4kP8= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by CO1PR10MB4707.namprd10.prod.outlook.com (2603:10b6:303:92::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.30; Tue, 25 Jun 2024 19:12:07 +0000 Received: from DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490]) by DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490%4]) with mapi id 15.20.7698.025; Tue, 25 Jun 2024 19:12:07 +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 v2 07/15] mm/mmap: Extract validate_mm() from vma_complete() Date: Tue, 25 Jun 2024 15:11:37 -0400 Message-ID: <20240625191145.3382793-8-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240625191145.3382793-1-Liam.Howlett@oracle.com> References: <20240625191145.3382793-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4P288CA0074.CANP288.PROD.OUTLOOK.COM (2603:10b6:b01:d0::7) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|CO1PR10MB4707:EE_ X-MS-Office365-Filtering-Correlation-Id: 1f2ee483-99f2-4bfa-815c-08dc954ab47d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230038|366014|376012|7416012|1800799022; X-Microsoft-Antispam-Message-Info: bVnz0EOH576OqxSRSvRehCQGeXhbLoV1DZrXdSNXeSbhMUdJTf4hWQuvA4NxSxgzuOsdU2OscNFJ06QtVFf3sqK/F9Q+3yiC2e3Z/gZKDOcjC49Fk4B5VB77Y45BeSZjpGaMGBWOpF8/4xONQf71wv8qKAFzxXzDVT1Awq/71Zb5VQXvKnTr3DIoyuoGxXAF5REGT0tpg8YcAwTyRpZkVZy+bHwejFcemvb4iZ54bbUZ3WUIIgvrBTkQD9FxMTSNp73c+yyxdhjMMxFc4/uTGly9RGDDIfx0U+MjTjZ7WTpSPAf/fBV6akn8sQUyJ3kfsjoFEwONpjyaiob/RSYkHciM1XlAne1oJwhioIwsG3sPraLrxG5ZhuA2K1gOu/yKssal54bnQCcQEnBEMnOTMRx3m4ZsKjTSyw5X50jorQMMWvn7NiXFOYcwh7vMTPf6eDQpyDBNCj0VgDSvFWSyuirJ59mVGA1nOLnUTklTTWy9qgNd51Lq5opVMH3xwgQU0T6SSkTSp2pxEg21/wJfJPKAdtYPsSVS8EGU9QEc/OxPQ9rSnBAJE7WdQHgmLkWbKKih65921bG0SqkUoEXL92swiSGYPn3GtBa3ZmFCCGf+iwH97aX8sRNVrVK/3iGICJkWQph/i6j9dWu3IJ5tR6+5Sev4umiU1t7YZq65/AlEO9Gs3hWXh+tJjnc7GJCacBRgJVgjkKHXQqa4/1+9OuIHrKVuj6iKD7xtX/RgC+vO0vhjgQyRPZoksS+ZS7RewS3qD7Thf5MvqWLIlKQiq7TTLxABT/bAfWpd3bTLYST24v0W3+cqqULmrEL+Q5DzHlG4YXhYBiA27pVuLI9U/QbZyppknJl0PATKQig6L/u6ilDq37MlyRBs8Rxc0aGKaNWrbyY9ZOWSEQBWWFGI7+8cIj/iQkC45ldOS5o2HfSv2WlH0J/Pw4fgoM6d1Vzdi5W/niFyPz97Fx1sLj6Q958NWaFEIJLJ5ah9stgMbYlEvTZUyeV3c6eDziaSBImb77Quq0jhjK6A7Z4wpg59RZmyWz+mW9uZGcu8ns0xhNFj9raRGvRJ0t5H0KJcskWwrWB9UxTNSQ5njV4VZCG88XeO9y2Pi+QdGk7VPj0K49Nzi2EczUYSNe7iDoor76glBwFjndXYzChqvZJcOsKcJJsMylgppwknM4tMTBIR5nt8U4wEl09qGy8hIkkfxGkC1VjEXXnEeFZscnHFBcr4GeCiPFq+2ntWTSUUxv56ty1FbCkI3jQ+Z90a4GdWyD4QGrfS4xVLJ7f7cMqzUxOD95dNuMEFKHXXJpnjE5wW8/uGTAB/g3aQMNweZFSaeRhY 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:(13230038)(366014)(376012)(7416012)(1800799022);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xAko54osaQgQYp0inu0tSjJcqHNp+gyXWGLV8e2CLWxUw9ROF/j819zGDKZriXoB4WZqX4bRD6UxFBZvIgCcXuDhXmm940o25Nb0/Vv2FOi6JqThtQ7xLFQRVdgeFVe1SyBowidIYZUyPJ9MGYFr5QEXr1j3e/tiQdLFkNYTeSf0UCCMK7GrlXn3L4f+Qq8CFqc26C+/9Luy1ZJdxsoLccBLTy2FZ/heW1GhlEa3hshZHrA3Vh/o9L0FIE0A2vV1StCkKwC6ape/dPplnE+ALh9tIWr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JDMsq5M4zap+NFAvdlTV4ZdTWPA3TzFiKXC60292tVPDo8fOnMv5t1jWbMy7LGhGIV4AuqK4yvyU2sGCAwkMGRXF6lScPvicQceEtsOddIJbdmN+Nv6up9p35o1Ac/J8jv13fLtIAKzbCSX7j7xzknjIseMHZI5Xb1W/cvcXIgLwDmftWJmVFeiVifs8PCM6rY5QdfYeT69hfa3kfUbY7/p2D/Kzq/7N1TXr4th0kji1fruXj5HdLQbm3Lo4UwWl4PvQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: nYpsYqD6gtYk3TjOUt84VBFny66zHF1jdSdxQss+hFYLoRop4CtGk9X5GzsCtKnWv0I1eVM7SChN2kXJmsWjMLxhncqaRmMS34lizBx7w5AopL++zMbSbASrY1v1Nahkg7+YyAchmW0jcODRFiL4eQu3DT65ZkWnxQEg7qaKgV7Nx2s8ydE1cVzPL6nv5Yw7i4NEwIK2cFMKRLvpNLcLfqlc56FzzWenU5+Tq/ERABoyRbhVDAvyUNqcbfz9mYZ/2BAjHRUvuN9Jv0C/vgV6CKiWjRhAoIpH2nU/U+jHQyS8EYaljPwQ1L35ubt40mlxyx0tNd9G9PHQGLlvmTNekTdIoo67pgz2RUxarz76dwa1azEI9vMsHCkfFB5h8AZ+EXNztw0+c6tKsO3VOTZN/6TYd+DYjRRJMv92zO7bkEtv9BDsYxx/nGC6MScfeC/8wjXkcQnFTsqV8sUljXGWLSrBNOSs/gnhaw1wwvMMjh4RJyfs73VXClOoFTXd4Z6R9s2ZzD9E7dxCboXPU59V72/ckeJA5EBm+AOQrQKH+WVZexaOwbc6Y3ppBgxv58uMC167KfvEWSHa8dyiSYeuTLiXIvRWlCKdiR2RDWA/548= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f2ee483-99f2-4bfa-815c-08dc954ab47d X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2024 19:12:06.8934 (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: HG6HzSEihWllR3si/dgUK8ZNiml+01U4kF5nCJtWOaCbJ4oHncRwVwwx7bvbPeiRWeix7FNmfadPUtLPm3zQXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4707 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-06-25_14,2024-06-25_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 suspectscore=0 bulkscore=0 phishscore=0 spamscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2406180000 definitions=main-2406250141 X-Proofpoint-GUID: gvt01nU0efeSsIA4YmeX9foVf-PRWNiF X-Proofpoint-ORIG-GUID: gvt01nU0efeSsIA4YmeX9foVf-PRWNiF X-Rspamd-Queue-Id: 7B073A001F X-Stat-Signature: 9bq1gomhkacae5cm9x6w9muxghet59b3 X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1719342738-242351 X-HE-Meta: U2FsdGVkX1/mEM7mfzrDMXy07XarkQXv50Of4NiaeR4htxL6JM3putfDh9DcU3x8jBBgojRSgbbN+vyE350+ZY6l/J/pjBjwB+fQz5mwBs1jWqxbA28e0L9udzE4idb90bkqrVZx5zxhZMloqT4RNSQiHqb/V0RMI/MOdr28hZDbkbKpCfhwR85zKHUO6lSMtto1PO17mlCqQX/PL8QTxJ9J2xy84Vavxw4CDyuZTmH/LK3SNAGBUE+Fd9O6IftH5HQ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uvGiGp741sBTuQc8CofzeSrGNrTeN+TQ3RQAIaKGjRhrpCN/ulJUYaowTeSUm5WOAofLkVC5W0wdDeSKHvP07IFuQPLGAj7Xice9nFP3NYOJ/540K4G2rf7AKaNpupVoy 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 --- 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; }