From mboxrd@z Thu Jan 1 00:00:00 1970 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BA996CE8D5E for ; Fri, 14 Nov 2025 17:18:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 225C78E0041; Fri, 14 Nov 2025 12:18:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1D68A8E0014; Fri, 14 Nov 2025 12:18:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0774A8E0041; Fri, 14 Nov 2025 12:18:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id E51458E0014 for ; Fri, 14 Nov 2025 12:18:45 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8DA231603F4 for ; Fri, 14 Nov 2025 17:18:45 +0000 (UTC) X-FDA: 84109872210.21.254CBD9 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf28.hostedemail.com (Postfix) with ESMTP id D4CA5C0014 for ; Fri, 14 Nov 2025 17:18:41 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2025-04-25 header.b=WwJWUxWv; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tzv8pkNC; dmarc=pass (policy=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf28.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1763140722; a=rsa-sha256; cv=pass; b=XV62TWnMNUQq+TM9Ztv0AOxyTkA169bGf6VrjPapCCsZDKQq/MEEVZVFr6TZihszSfjHl3 80m2SDXBK78Zj2UvrqLtTiG00DNuU17+wBVVIRZyYK5K3OXybMFuZeQBoSHwNgXh1DiNOc LNkH3563UYHX+N6IgLCkJF6vadZPq0Y= ARC-Authentication-Results: i=2; imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2025-04-25 header.b=WwJWUxWv; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tzv8pkNC; dmarc=pass (policy=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf28.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1763140722; 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=qIbFXfjwBds44nvSKJ74LgKLVgp6kaxNLbsC/a2vw3g=; b=0I74GbDjipoz5KpKu3zpWAib5UzrN0Ke9u5eljDbXYhAuLQ25XzKSTuEB5JeiIQVFF46x8 WgpOqNV90pWVVXpnVBv6+DWjEPKwmyFP3Hbeg8GC3B/kWuQFNd/qPQNh/s7TKJOzIjQslT y8f4iPt7J7HpWnZdG1+WmzW5uffxikg= Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5AEGuIeC015308; Fri, 14 Nov 2025 17:18:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2025-04-25; bh=qIbFXfjwBds44nvSKJ74LgKLVgp6kaxNLbsC/a2vw3g=; b= WwJWUxWvwLEbZ6SIkG57tgqfxPLNopZT5WRz0fN0DmOqDgzNJXpERNuL7It31I59 sugbJvo8KbAHs1kjdr9STiNS276u9Fhe4H87N9r+WawLEb2aB8KiYyf0MgVKYaK1 F/IuWplB5aYO8BzBgPLa/J3wK8HJSrEmY9VOZ5mjdsXK75UG+sOJ2fuOF9bUB+Ma 6D/Qsqs4g41V2Jlp8spA8m5M10/TCu0uPG48DHL5oK9BR9jFHQUCEcpk9YxTwM46 3InpQjQteHqdUtiD6mDPWjkcUDRLmbfVCVcHXqQCmTriHtb7p3p9HCxu0+6zdRTR A6/lipbx7ts6JRlK82qYvQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4adr8uhk18-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Nov 2025 17:18:30 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 5AEFduNr000425; Fri, 14 Nov 2025 17:18:29 GMT Received: from ch4pr04cu002.outbound.protection.outlook.com (mail-northcentralusazon11013053.outbound.protection.outlook.com [40.107.201.53]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 4a9vahbjae-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Nov 2025 17:18:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cbwagJS2hLnlBiz2GdDGY6q1tHUuJ+ITQeALRScPdB95Q0o49taafwCXwkw7/J5HtX/oqKDJFTnIryr8QKryaEkKUa2c06bAEuzjCbLNt4cMfq8OfcfqPNW6ZR2GhAci+CJWlDZ8kg1OAFUsvVpVGJL2uaX0WCSSclFA7Eilmm2SLyEHqhf3CSAgzYs1uwJd15vFaSg/+QdXY4/5cBypuyZowju57fL450HDJuH9bqq/vi1jha4Rbu12P7Xxg8n/kzecLgumo1RrW6WYiDax0+BANgd6PXO9oCqx0UiNYRYwMJyzfjcDus1PtUzEyjnDEkxOsQe5uFCLKVeSZYRqHQ== 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=qIbFXfjwBds44nvSKJ74LgKLVgp6kaxNLbsC/a2vw3g=; b=lX9BlalXoYrGRe8pCzCvcqrpOVN5yhDClNBBJ6D0F3SsEnqbaCNieJiPFUBroUUqLUSaJS859lE4JYBX0HbiUop5CgdosDxg7l9rAxI/AS016fgYzL2FORjK3JgqcfNNnX8gikXrzjtJv5K1EtIZWE7VkY5EeB1ZYVClbD1OmliT08ulBMFLQR0TCxbrtOks/RXTymU5n6Srhr67B/Rzcum6httxHFIw03ToiJJwnCsNVRsFB2ggaXsfLQVdKbTCh9t936Xa+YszQxwURhE4M2pouuS8Xj1csN5qdlI8HYLFnoW8YmWFLB6VPlQSLxSfOwuH4dU2+gK+TnBtxOc2Mw== 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=qIbFXfjwBds44nvSKJ74LgKLVgp6kaxNLbsC/a2vw3g=; b=tzv8pkNC31yhLAQ2S6t5mxvcpQZk/dCuSvfPzVoPTaYbmua8f/aHdm2bau6isH9cY85wRngjVnh11OovTtqmIPRZPqi3PT/HJ/kMzfRofSn9rKRr6ZKF6k8W7qW1kGjYw2kBfkh1tsRwdCtz38dwNrKHSi8sFWtfJg+7UNgAhbY= Received: from PH0PR10MB5777.namprd10.prod.outlook.com (2603:10b6:510:128::16) by SJ0PR10MB4576.namprd10.prod.outlook.com (2603:10b6:a03:2ae::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.18; Fri, 14 Nov 2025 17:18:26 +0000 Received: from PH0PR10MB5777.namprd10.prod.outlook.com ([fe80::75a8:21cc:f343:f68c]) by PH0PR10MB5777.namprd10.prod.outlook.com ([fe80::75a8:21cc:f343:f68c%7]) with mapi id 15.20.9320.018; Fri, 14 Nov 2025 17:18:26 +0000 Date: Fri, 14 Nov 2025 12:18:22 -0500 From: "Liam R. Howlett" To: Lorenzo Stoakes Cc: Matthew Wilcox , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Suren Baghdasaryan , Vlastimil Babka , Shakeel Butt , Jann Horn , stable@vger.kernel.org, syzbot+131f9eb2b5807573275c@syzkaller.appspotmail.com, "Paul E . McKenney" Subject: Re: [PATCH] mm/mmap_lock: Reset maple state on lock_vma_under_rcu() retry Message-ID: <67rs7sdyfvruaykw3xdap35eopeaafbnqw2szcubq3bk2rgrrk@oq3yd2zawoej> Mail-Followup-To: "Liam R. Howlett" , Lorenzo Stoakes , Matthew Wilcox , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Suren Baghdasaryan , Vlastimil Babka , Shakeel Butt , Jann Horn , stable@vger.kernel.org, syzbot+131f9eb2b5807573275c@syzkaller.appspotmail.com, "Paul E . McKenney" References: <20251111215605.1721380-1-Liam.Howlett@oracle.com> <2d93af49-fd76-4b05-aee7-0b4a32b1048e@lucifer.local> <8935c95a-674e-44be-b5cc-dc5154a8db41@lucifer.local> <1885ac9d-1a5e-45a2-90d7-f4ecb5848937@lucifer.local> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <1885ac9d-1a5e-45a2-90d7-f4ecb5848937@lucifer.local> User-Agent: NeoMutt/20250905 X-ClientProxiedBy: YT4P288CA0026.CANP288.PROD.OUTLOOK.COM (2603:10b6:b01:d3::8) To PH0PR10MB5777.namprd10.prod.outlook.com (2603:10b6:510:128::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5777:EE_|SJ0PR10MB4576:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d873e87-8d1f-4e5d-bf96-08de23a1d249 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|7416014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Cf6KC5gUyiWRwjCPBidZPmIvN36imXnUsFFA4pwcoL8Gk8B7kYaqspH1UBZW?= =?us-ascii?Q?q1EinLRXUGiJVzD5Isvgf9dP6YQzpKHuPEgJJi9VC4+1pd4KDuvKWcj+cr2Z?= =?us-ascii?Q?eBeP9Zsl03xZq/A7p9tAxbg76eYI+DEYvHlbLJB5I3ZP6V2IsNlUsXVsip1N?= =?us-ascii?Q?cxWc/1JVLRdYikxA+bJFeGIwlsAWLTs/HbBHQOQjECNQbLU8BPG/3/ToLRpj?= =?us-ascii?Q?p4ppLvLDL94Li+5Yewn5QVtOHJE0vmCtqDGaw2iMbfXsPhgB7kH0ypluc9gb?= =?us-ascii?Q?0C7Q5iA4JBY5BAawlGmNAGoxhnRgSi9e0AHOhRh6I5GWY89iwiYsV6YzyBX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uIYkY/m9VUpK8/P8sioUsvxB?= =?us-ascii?Q?QNT7DPxjI/b+PXN3xA5OkdRlS2xv91wpem8c0E6bPum289188PnjY4Pum22H?= =?us-ascii?Q?SSEWPD+Z1lDZUlWOoel9OmtFTLq+WdHhxkEWu8qqSj4IQU04jIaxv6g4ai7R?= =?us-ascii?Q?GYrbzsMbPM3uPf9XXUi0PaMQ2Bl6o+axQ54g7RjuWmYy4uAoLdhWbaA7V3tR?= =?us-ascii?Q?AHlVVXQoSIEEtHobT2APwiu0Pso9HN3A?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5777.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Qdj4kjEoPVJhBScO7jK29RML6Mk5E+VLZRX+1x6pov8rZfVVEUlaDrn0Fyq1?= =?us-ascii?Q?ckPm+7+ElY+X0+8wlGBreoNCwFKkXsV03s4Tnz20/u2N0Puv/NhmABDWPeNq?= =?us-ascii?Q?IDyIRfF8puTZj9rOGkWUol9ab7fJ2cXClcHUYYaHf8IMLpN6GGdEqmZMbCPp?= =?us-ascii?Q?jey8h45v24yINT9O+ut9tv223tIEdY0ErZQ2LaxfcEYYAwRJskq/3l/kQKea?= =?us-ascii?Q?fAg0e/PLkj911WLx+LTR6bBWLy2RqZ7F6wzPTSJN/1makK6b7XdYD1FC6GUW?= =?us-ascii?Q?0Mwpq+EE+JyPtOMInmQjUkdIgqvH2OEe7Owhhc19lb+SGb+e27Dp1jIwiNo1?= =?us-ascii?Q?i2aamkDrtByOLUw1tdoxFQVEmt2MvFkbcd+9W1cPANn5a5wIzPMaKPWl1FaH?= =?us-ascii?Q?9NYSAkesHqJFsniIzG5n5fNcTEgQgKpLobsUjr7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Debl9ujtPBHWNWCoa+dG6Z6pYctcil9Ncs1GRaJFrJ77j?= =?us-ascii?Q?AthCG7NmSchUONux7+bpoMI1oqQfTqeqrqi8g/wwuN7JxizvnyYxqVwuAE4J?= =?us-ascii?Q?rsXcOWDrX2f+ivPmQNNAawabEVSwW3ZlXKGfE4q3ZQF2e4YIi6QrTaVjtHSf?= =?us-ascii?Q?n2wDQqMVVhGNb0InVluucPiMdHnXG9y6ybw4hAtOooel+cM2D2J3nrQ1+FfD?= =?us-ascii?Q?3CDS49Eu7q9l0N4B23/JZOSGRJtELyeeMtgvoV71?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: QuOUd2OPURv06FDmY8+hso+X4VzaGq75vQ1bHZw/WV0u03sHqncxbBXZMA7jYf0BR9byBawDSPIi8rFSVkn89Y8iB4DN+VvSHTiavwF0zqhOxFDj1YmCvVFlJe6VCO1IMt3KR5rbl7BBt3q7tbF3jLAHNgDNCl0Ivu1N6drlyxVA+RGoPM/nOKORNuONKBtq/tRr5BQFmLhyqZsluHCeXAXsXk93bHH9k42fE87ks/mSJT4z7ICyv5j+J49LKjvXbCiLZH2mqPoc9oxXLRTVYNK4czFKuIg34EK4r/hPeg353LE8s34JFmQqvuceJTJXM4GITH23fJc9KN+qwtmYd9TrUZLbj89ku8giQx01MH4Q37aDc1EgJYU4MYkzbHraj3KIqO5bzlGBUz+TBpa9hxUIyiI2q5VDseA9L4ftlnMuEqYL9XJ+HzwCFeUbaUdzCfag4yVPnD3op8iU8ychrZNwfuzItrpQD1xoC7H0wdDnxvLrPvHTSVDFWsWY5YCAhf7pAsmxRHqtCAYOKizeoQT888bHnEmKqChgnaDvoOIn/ZJfA9DXAWw7spCX0Grp4jxYZXtJxAY0uEcznZt9MP6Wju5G/X0vGwxBm3TMK30= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d873e87-8d1f-4e5d-bf96-08de23a1d249 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5777.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2025 17:18:26.4215 (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: kKxev1jAUzdyrUxWh6MMrxzBwFtxjwPFNIYNjxHDlLKvmMU+VEzIxUGrJ7Yc7/YfM8AdSS2MoGx70Plc2V/wuw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4576 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-14_05,2025-11-13_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 phishscore=0 suspectscore=0 adultscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2510240000 definitions=main-2511140139 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTEzMDE3OCBTYWx0ZWRfX5GnuAPCVmpjp vtDBfx0nYd4olj+AO5mptC5ur7LMwdXjV9lywQ2EJMcb/zB/JI4D1vS03NdAUFD7KXf00ogup3E pjOncXDzoxdTVM3vFn69S1Vn/CRlZa+fK15HeMjtQf03f99ufAg5Dly3u6uJVKTznHXlJ1bkIhu cymAn6GdKZW+OfRpQO8ONnT0GSWGUTG1UkvbxkzDLBxUeHD7gt7e1V3JCtYdV2fDAURLggmSEnf i7ZHGN1V9x4dCIAHkSzDdjZIgG3HpASL8mFUveivbE5OdvG6rEl+pPk7vBwdOa2RrfpAYDXCSu1 iUHL1hYsp17gll57v/txshfau/JL0fsbL71BM7cKhvV5/+MdvXf46W5ztK4EmJnMF7ASSpT7CQ0 Yq3deW8+9IunJeulxbmmtXg7wL8qeVA2Pw75NQYaKogGTPxL7eQ= X-Proofpoint-ORIG-GUID: X_GJQemciKZ5cD1-nv0TTwGVzAYX6RVk X-Authority-Analysis: v=2.4 cv=FKAWBuos c=1 sm=1 tr=0 ts=69176466 b=1 cx=c_pps a=zPCbziy225d3KhSqZt3L1A==:117 a=zPCbziy225d3KhSqZt3L1A==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=6UeiqGixMTsA:10 a=GoEa3M9JfhUA:10 a=VkNPw1HP01LnGYTKEx00:22 a=yPCof4ZbAAAA:8 a=5WB02uL4bhdo-hY3U9kA:9 a=CjuIK1q_8ugA:10 cc=ntf awl=host:12098 X-Proofpoint-GUID: X_GJQemciKZ5cD1-nv0TTwGVzAYX6RVk X-Rspamd-Queue-Id: D4CA5C0014 X-Rspamd-Server: rspam07 X-Stat-Signature: bffxnhump75nxyhjhej7qwq8hb1rak1c X-Rspam-User: X-HE-Tag: 1763140721-814290 X-HE-Meta: U2FsdGVkX19xv400YAN/ToQRziYMDUc+W8upg5Dz3wn7QgM88uUoI/5OJ/yz6CfMNnQDDLHFkGpCBHLU5gcdb9HlIRQ9o4uPVQK8h4yd9M99DfadRJccvq2VqfgmCyRz+091fVI4ST7REwMSmbqwdbFyquMYveswYtO0qeKahzTKWrcDAneXhU6h4+nYHzG/EUnO3rXxKyWbi4BtufZ6qcWfF7GCzqSnOdgs7Vvg2VCOnJ/X8SMV2zXFmupLCn2NqUPTvt8x7yNC4rBrdxNn7oQlmd6NunfECWSPz/54/zVtD67XITjTxzHZ6NTIatclcLLLUHy9y+hCkHJGtH/DpbnghvC0GcCf5lVHwhPq3+gKet/GY3HHiJL5wVXbWUon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xP0m+q4q0hj9dNpVtxAk1gP85BBctvi793lk6tHD3QQcHn4lny3RLVpW0St/BPiiqlZ1E2YHvAetJ1YgeVZvTzK1T7HMYEjQlEfIEyz3y/EAoEpf1tsBjJOrY+B1Q1bmK7QpCn4Y4pfLgHWGsExKXLVqspjKDXoISxU1LgCpDBW2NkiLggqq8DMB5u+eAc67NyNXryI3tD3cwku3ojU9faCK5Z5NyR9u0F8GsiKfcNP3ueA4BBYFY3tCJaXn8nkM/y5gyHXgbtRePK710XFgLnztt/ZX9VbqIEhdmFNOUkojTqMVlIX8EkCo5fnq8nTXWy 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: * Lorenzo Stoakes [251114 06:51]: > On Thu, Nov 13, 2025 at 12:28:58PM -0500, Liam R. Howlett wrote: > > * Lorenzo Stoakes [251113 05:45]: > > > On Thu, Nov 13, 2025 at 12:04:19AM +0000, Matthew Wilcox wrote: > > > > On Wed, Nov 12, 2025 at 03:06:38PM +0000, Lorenzo Stoakes wrote: > > > > > > Any time the rcu read lock is dropped, the maple state must be > > > > > > invalidated. Resetting the address and state to MA_START is th= e safest > > > > > > course of action, which will result in the next operation start= ing from > > > > > > the top of the tree. > > > > > > > > > > Since we all missed it I do wonder if we need some super clear co= mment > > > > > saying 'hey if you drop + re-acquire RCU lock you MUST revalidate= mas state > > > > > by doing 'blah'. > > > > > > > > I mean, this really isn't an RCU thing. This is also bad: > > > > > > > > spin_lock(a); > > > > p =3D *q; > > > > spin_unlock(a); > > > > spin_lock(a); > > > > b =3D *p; > > > > > > > > p could have been freed while you didn't hold lock a. Detecting th= is > > > > kind of thing needs compiler assistence (ie Rust) to let you know t= hat > > > > you don't have the right to do that any more. > > > > > > Right but in your example the use of the pointers is _realy clear_. I= n the > > > mas situation, the pointers are embedded in the helper struct, there'= s a > > > state machine, etc. so it's harder to catch this. > > > > We could modify the above example to use a helper struct and the same > > problem would arise... >=20 > I disagree. >=20 > It's a helper struct with a state machine, manipulated by API functions. = In fact > it turns out we _can_ recover this state even after dropping/reacquiring = the > lock by calling the appropriate API functions to do so. >=20 > You manipulate this state via mas_xxx() commands, and in fact we resolve = the > lock issue by issuing the correct one. >=20 The state is never recovered.. it's re-established entirely. What is happening is, we are walking a tree data structure and keeping tack of where we are by keeping a pointer to the node. This node remains stable as long as the rcu or write lock is held for the tree. If you are not unlocking, you could see how keeping the node for prev/next operations would be much faster.. it's just one pointer away. When you drop whatever lock you are holding, that node may disappear, which is what happened in this bug. When you mas_reset() or mas_set() or mas_set_range(), then you are setting the node in the maple state to MA_START. Any operation you call from then on will start over (get the root node and re-walk the tree). So, calling the reset removes any potentially stale pointers but does not restore any state. mas_set()/mas_set_range() sets the index and last to what you are looking for, which is part of the state. The operations will set the index/last to the range it finds on a search. In the vma case, this isn't very useful since we have vm_start/vm_end. The state is re-established once you call the api to find something again. This is, imo, very close to having a vma in a helper struct, then calling a function that drops the mmap lock, reacquires the lock, and continues to use the vma. The only way to restore the vma helper struct to a safe state is to do the vma lookup again and replace the (potentially) stale vma pointer. If, say, for some reason, during copy_vma() we needed to drop the lock after vma_merge_new_range(). We'd have to restore vmg->target to whatever it was pointed to by vmg->start.. but vmg->start might not be right if vmg->target was set to the previous vma. We'd have to set vmg->target =3D vma_lookup(vmg->orig_start) or such, then re-evaluate the merging scenario. I don't really see a difference in mas->node being invalid after a locking dance vs vmg->target being invalid if there was a locking dance. I also think it's fair to say that vma_merge_new_range() is an api that copy_vma() is using. I do see that hiding it in an API could be missed, but the API exists because the mas struct is used in a lot of places that are in and around locking like this. I'll add to the documentation, but I suspect it won't really help. ... Thanks, Liam