From patchwork Thu Oct 31 19:36:08 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: 13858315 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 5FC3AD767FA for ; Thu, 31 Oct 2024 19:36:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D28006B0082; Thu, 31 Oct 2024 15:36:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CD7BF6B0083; Thu, 31 Oct 2024 15:36:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B2A3B6B0085; Thu, 31 Oct 2024 15:36:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 93D136B0082 for ; Thu, 31 Oct 2024 15:36:48 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 37B7F8187E for ; Thu, 31 Oct 2024 19:36:48 +0000 (UTC) X-FDA: 82734904392.11.F93A6D0 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf19.hostedemail.com (Postfix) with ESMTP id AAACB1A0019 for ; Thu, 31 Oct 2024 19:36:10 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=nh3F3BpY; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=wwXUoE3g; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf19.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=1730403360; 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: references:dkim-signature; bh=nNqC0MbqfEx+oQLVE6fCxxrXvKyhvBNCi/r1d36lGuk=; b=uiTjmfK9F/+hS/blqIeQNa5oA5OtFMagn1p3IKSVncELMJPZP1dG6hb1AEfkE9VDpKrJK0 KnG0CRZhI6Ykgy98zUFup3XMwZ3eCiUcS+3B4kq/i8vthFL+7wwTDCcOgQjsMwcBIY1xG/ 3TvakWZ7gY7bvgIED/jR729PkjRAF00= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1730403360; a=rsa-sha256; cv=pass; b=oHaNC0hJknDNkCvTzKwHAG/LUjj85kIpwMLCIpmlfHp9AhmlKDMESu2k07pdMsxiTC4dZn BD5v/UWh+5DYsAIavbNZpTbuXiLcGmIf8Yfc1mJxFQb7Jf8kVC2mUq3LA/eMRcZGZYi5QZ VwisG34v7O3Amg3MliOysmbGc9CMdwc= ARC-Authentication-Results: i=2; imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=nh3F3BpY; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=wwXUoE3g; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf19.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 (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49VJBYeT016279; Thu, 31 Oct 2024 19:36:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=corp-2023-11-20; bh=nNqC0MbqfEx+oQLV E6fCxxrXvKyhvBNCi/r1d36lGuk=; b=nh3F3BpYE86iuau6ppZ861bd/gMlCoD7 VggtvWUMXHw4sb2vvOETw8ZhIP27pBXh5CnDMs6Q2NTyWfdziScj33Ubbu/gIebI f7002V/U039elHm1X7v4MsvjDg09e6Rw6GbonIU6O5IPPFdjgS0v8k1gAvP/ObxW FxVNYmBkJXfzbLHfA414NoD0/NsZTj14DcVEJvIzGvNn2VdHa/G0ABJrAI6RYUE7 GJWx+JJsAMuogveumhD/osGUkYKso9iDJQixJSg7hlc55O0Sm3lgy4DA1uVA1Cp7 rZJhOoEqc3sJzyWFNxheEgnH3eo8GPyB5ZmiSsAnrydyya8PDSRVKg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42grdxu355-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 31 Oct 2024 19:36:41 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 49VHp2Hp004745; Thu, 31 Oct 2024 19:36:40 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2049.outbound.protection.outlook.com [104.47.56.49]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 42jb2xbrve-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 31 Oct 2024 19:36:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WMSKju8MibgiL9YPEA93DwbNHkfglRjHC2ra8TEgjjTQxI+1glbiI+ISLZ5VVnCeZrVQLD/zFbt9zV7yqW7ylITM3yB/R9dEqCj6LzJmmsccuxT+abOheaPjE0fysR0dcdOmAeDObRnfxu2XamFZWL9PqjwVhLcfkjpAfpnhiztHwuPodhHo9tUAN3t+Qes03UcV4uq64j+2bn5XNuacjuCLuxilYCiAEyUjzBtWd2pw37JE6WzH8QX0xoJeoDCjW54n47vtpJ1Hv5NQ0fErexLCmQpiNt38YrYUw/3+5m23wjOhgsL4VmWyVeFX9sSo9I9jsgH9vqDgv3qjo3kMFA== 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=nNqC0MbqfEx+oQLVE6fCxxrXvKyhvBNCi/r1d36lGuk=; b=c9d1i6lTI/HAzwqybY4M3DqUCn08DfyD2CVd8t6qzFNNmcrN9zeClIyHMoD9EL3BK+i5ythHKDouYSISoFy4wuklqB9z6uvBtLLRVktekyBGU7Gexi4Tig6Bd6aOgkNQVCJGUVwF71l3qGpwjkoSrFMQPy41hZ88MMD8is545tgwup3AS5LOLtUi9+sbsv8um8F2s52T7OfQGNYmGWdG0dsbEKCLXELo0CmF55G2AjXNLXFRPTvUzYnBiNDsQo0jw3EF98GNYPc7pOOzKeg0VF7w5OOggs2LiHu0OuwnUSa2rMgeTbzRntosBK4vMxyevQVWUvhmA9xD1z/aUsUgCQ== 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=nNqC0MbqfEx+oQLVE6fCxxrXvKyhvBNCi/r1d36lGuk=; b=wwXUoE3g8cKn1bw8t1qt60yAu9gsxtw+ePJfwEHkNu2RH6GQfCiZrb8H6LrqCj9GAt1np5q2fufpQ7C+Zcro9Yc5F2ebagpW626XUrcKTQElrjKkz6nWsrlXgL5JGatASPqsApZHlV+tkhrvAG4ueefm6a0ivK/9erGI+StAG3k= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by MN2PR10MB4271.namprd10.prod.outlook.com (2603:10b6:208:199::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.24; Thu, 31 Oct 2024 19:36:37 +0000 Received: from DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490]) by DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490%7]) with mapi id 15.20.8093.027; Thu, 31 Oct 2024 19:36:37 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Liam R. Howlett" , Lorenzo Stoakes , Vlastimil Babka , Jann Horn Subject: [PATCH v2] vma: Detect infinite loop in vma tree Date: Thu, 31 Oct 2024 15:36:08 -0400 Message-ID: <20241031193608.1965366-1-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 X-ClientProxiedBy: YT4PR01CA0044.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:fe::19) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|MN2PR10MB4271:EE_ X-MS-Office365-Filtering-Correlation-Id: d20dd6e8-1890-4c2f-8951-08dcf9e355fc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: /KMqxWjQxa00UnFi0NBUuy4y0esIQAqd8ueyMq9CRQUewVpSwTqnwDx2ZVFw8QgApB+KpVcPAzdccG+GKO/dYFAUpqKG6WhQ46Akh50Muzb2q5awMpxLSwWI6u/+OEJm464WzDddV5rlatKg5GR0vs7WxI8CfI9vhXI9g3tX848OkgUW+A7NAeyv0h5b24dVKcIcJsuzE0vcWGeDcPkVnSmW791o3pezwY8wowCZ1Y/ss6yZoRTLOxsMs0FYNqHwdlk0B/RLhI3gbWMD8tQVCundHbgoq6arMwM3T2nOCNv+164qr92oc8PW2pa8vQLqBFmq5wSfBABdX+SzuIf4ahGE7dibMuDB8pugGGIJWugogqnqnHGK6f6wvI/qSojrUgjH4joEIujQbklsxTqteyAYsyScMsLXPC5jt7+0TC+1rJ456qN36uOkONb8DNdPtCo7S8zZC26eQhmrzAUtj1gyHe2taf3kV+1nZvnvC/MXJh2N4zIRe3iILEyt8xQ+uZwpexeiy23xFpxUL51/5T0wawUD93dRIGhHuMNZ1P6cTV3ZjXp7r4eGqRAaUBt4VSEZWsKAyxYX+JYs8d8ULf1OPXHGjdScF2DUezOZBdY50EudSXtGdflJhr1bhOo78GxGsxsSJN6fWzY4fQANhscQ4++vxUfpVyHQWv/q7YgX7dIYZyMztHIbOUjtWOpQ0ZP5gQF+UesU1dWSXaKBXUq+cljSelD0lyl1Q+pTHvkE6P/jvDwKiO1Wy+VR6UluGKFLvNJmKYlmOexIotWeAwoV/C0JTRKT6bDHEFjkGOuOoARhZRiKtAwy8qsy/Nw6VNAEC5i52HouAgxEwKwN8qqhbk85RVvXg9sZ4yg7L5rrX1hkzfLrfo6Sk+5/0I3cFWfI89zrcxygerhA0fldaOIxs1yWT+CGCoSM2LqcUy1a7rT1QIdIJHKRxfSPV9auHFgxn88asJhK2j50zQPyWLSpG4rCBoM3EFaCh/P7MoQ2ssu0/vbIZaG4PENgCkJVAzrs1JivLZDkoe2Hv9IVWiTLCoPbj19U4f0UonTyeSLMuHFeD2UpAu+X44ataIfzjHoQCGKTGa/mmHknAbuzvvvmkmWeDacOcYvzkB/DHHH/9JDReBIVduHZUIJ8+athzPShMc4IkaNzrtx+bdDpxOalOz3CdPD9DQ+svzJnhBEibr14qr5kRcLuDik9tMPYDqeYiJCAL9rHuG/L16i1g45Zqt4fY4EryFDmXLiAQaTuR19tnN4lRa0V+bVBr8cn+4IGJ9BgMyyXoddkwPrM4qffMx9UlU6DM2pja13MMnYhtrQ9yBNFuvXl159Y7t3L 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)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 21HSL+BK/pj88Kf/yJdTZim0i7FttI/gBxQlRbNDj23cS6qYR9mCHCt0/hmfCSBeIWmbkdbWj0wfW6Ryp4ZGQi1vFLLgKlm7CnfalQDW0LZVytK8CjP0rlzjrkHP4OPMXhGULWWde4ZXZVDZ1VonLTbl4Ri8ZDWLQ8PaR8E2J3C/01QfKt/uu6swWsC3HmxOFIh4eEHK60BjV7QF+FfrK/dF7T264bDaTfsnYkYro+9GIDqX9ptQ5pYvIq9P7MfEMFW9nMqUXTdw9OOWz3ppK6t3IHUyR2iyLrFNLdRDYo9mGNWfn/PJxSpfjrjRycxc4SyycD5UZQZ1eJWknQ+U/B6ndk/DGq9J1VjJT/yKEU2xOpEuz7Ryu89gw6l7WF5YvWw4XWUHGNW3TaXnSAP3LC7aFxZ02zfPfO7QNwL7dtUXFpxhRJrohNa37BRa4MpAtW3OnhitYK+qTJ4hwpMeKaPJKPMBoK7Y0qsAuamfmVBT0YVh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9hT8273XAtNAHUIFzD7RtXS X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: jN9ZLCR909Kk8ujYORdbMpgkjCzPMJI4qD7ke0idzUYSoiXRcWDwlEYwkroVLdgn4n0jlXamXr4Kb97k+WHEguFRh4CHhuO4oblTIROv61ClomnkHVOGdU/rxRITaXc66ERKaG5Gp4/dWiEAw2Y2XcNaDB86x/D0veKcxB8GckQmogTf4og7BIf+aBzoUMsodGRDaYua/2ILQuWW2TEYbKXN7weemjIqAXf53HQqTs58e86V2M8QYiKbbcQgVt8z9MIUVJRbMcqinfBqI0hULgVv1fMjGooTIzv7XVXjH0HSX3rhHJ/3yhNo0Mudq0wrNBtDW0efYT0ukW009ei0IJn8N4OO2e+64fMdtVXFXF6TW0G8h2ZfJ9WV1gjCszV8pt0GiB0ITw23Tj5CX91jDEnoO8pTK6ZNXPt2XVlYZak8EcqK2HseKSS6tWI/wENSNcKKON625AD/LwjwXQqMk7M8QBGh9zCl53FIBv8ZIWq/IqMXByZVJCKTHy3fkTHIyulB+uOPYhZBEvuw35iMEC95q3dhBbO3wSCm5cGtWHjNI/g9pJxox1U073ApUHK8klmQ5+hoWz/YqTpYpzQ/TzS7YGqI0JqGWViy1pHDq8s= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d20dd6e8-1890-4c2f-8951-08dcf9e355fc X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 19:36:37.7316 (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: 5kvakmwe69gboKksGQAQWmW90T6J+wR/TTngL3xgo2v3+P2wXlUqs1b2jFgs/l+pnUBLJ0ryjpbKItMK7qlFCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4271 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-31_10,2024-10-31_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 bulkscore=0 adultscore=0 phishscore=0 malwarescore=0 mlxlogscore=818 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410310148 X-Proofpoint-GUID: Ek16I4ON8IcULoYFWbXZkGn8mzefRBkV X-Proofpoint-ORIG-GUID: Ek16I4ON8IcULoYFWbXZkGn8mzefRBkV X-Stat-Signature: et6c8ac6eg89qy95ma1n4q1x35g9q5ud X-Rspam-User: X-Rspamd-Queue-Id: AAACB1A0019 X-Rspamd-Server: rspam02 X-HE-Tag: 1730403370-44770 X-HE-Meta: U2FsdGVkX18/lQwf475jeWLGrNqChaRpuziREx5oqpEpUr8Vd1xiHkkwz7Ev4mrmgZqCqrhD0Y5BUtRoUN+YOWt6/aFxgKDVlBBbQyQFFe3RTDPoQyWGSFa6NGYgBeewCkijUrkxcak+Rv0m1rxn0/HbPzrByA60dRmvFg2XRMPUTcTlTFBUQvpZsLeo3mm7uim/ifd2gsyU9AhvI90BQfbgiXxlrflIzqrgoPhpHs4kfY8LTYQ4kfR/XqV+RHOclYSAvIuc6Cv1iPgSgn2bYf8uJ5r7LRDTVbSVjWC4jzQI3GfM/Vfmqj3PikmXMDAv60n5etLy5A0lpKp4QW9EQ/d/SsbItxuRpQG7P7NRx8KIo8Rq1Q1PXcFpHPjTRMYqq7dTtc6b7ILlILDywkklnEuQ51hGYf/9kI7BDg5SZdwANJN+Qiaj6//IaFwvWE/6n3yZV23qLtoFhOJYOmTs/1iDPFg8W24f9tinb2Fag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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" There have been no reported infinite loops in the tree, but checking the detection of an infinite loop during validation is simple enough. Add the detection to the validate_mm() function so that error reports are clear and don't just report stalls. This does not protect against internal maple tree issues, but it does detect too many vmas being returned from the tree. The variance of +10 is to allow for the debugging output to be more useful for nearly correct counts. In the event of more than 10 over the map_count, the count will be set to -1 for easier identification of a potential infinite loop. Note that the mmap lock is held to ensure a consistent tree state during the validation process. Signed-off-by: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Vlastimil Babka Cc: Jann Horn Reviewed-by: David Hildenbrand Reviewed-by: Vlastimil Babka --- mm/vma.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mm/vma.c b/mm/vma.c index 68138e8c153e..283e6bc4884f 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -615,7 +615,10 @@ void validate_mm(struct mm_struct *mm) anon_vma_unlock_read(anon_vma); } #endif - i++; + if (++i > mm->map_count + 10) { + i = -1; + break; + } } if (i != mm->map_count) { pr_emerg("map_count %d vma iterator %d\n", mm->map_count, i);