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]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1730DC3DA6D for ; Fri, 23 May 2025 11:19:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 57C3C6B00C9; Fri, 23 May 2025 07:19:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5538C6B00CA; Fri, 23 May 2025 07:19:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3F4166B00CD; Fri, 23 May 2025 07:19:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 19A946B00C9 for ; Fri, 23 May 2025 07:19:30 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 8D313C220A for ; Fri, 23 May 2025 11:19:29 +0000 (UTC) X-FDA: 83473926858.28.D7EA379 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf27.hostedemail.com (Postfix) with ESMTP id 4F0CE40011 for ; Fri, 23 May 2025 11:19:26 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2025-04-25 header.b=DGtg+vLK; dkim=fail ("body hash did not verify") header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=yNQ0uGYg; spf=pass (imf27.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1747999166; 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=nPhfZd6EV3W0u2h+oDJhMpLfApmlcwtuT0NcxgNWt7E=; b=UNE/+eQVwX6KwXfP4LSdIVHcQANhUnSOrVTBqc6sqhfU6ijSyMJBz0XHyjEleOiZmR88Wz e6RrsX5xkBZdsFvNQwmV3GfI50TdjmSqagPKH4wJYyzKIfEuFLBkltS5fzHwmks2hGcxwP hAxvrnKe96FdNJJVxxlVKObw5ED4IGI= ARC-Authentication-Results: i=2; imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2025-04-25 header.b=DGtg+vLK; dkim=fail ("body hash did not verify") header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=yNQ0uGYg; spf=pass (imf27.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1747999166; a=rsa-sha256; cv=fail; b=D+W7rAf9YIxTmzZP8qK8v0v6oauF2qEk5u2tRlDBvtW6mrsG4ms1IXcwtOS+VIjaVgoyRq mGRLpNi2PW0KYLWPFiVdzGfCDNSExkvI16rS1UzR94ydO+tC2fun12lwWb1Qp3IuLN6zCp mhhtvvLQ02FKkmdYa5dlim2cYgXuAio= 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 54NBDcrW013723; Fri, 23 May 2025 11:19:11 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=nPhfZd6EV3W0u2h+oDJhMpLfApmlcwtuT0NcxgNWt7E=; b= DGtg+vLKyOIp71kvL1fr0MbvIFGx+bT036mLDUTh6ejiMbi7FpgrSt0DiQROY/Bp fWUt1CFND+YIVDfxwncbhy0bb94Mqctu/Ad341rbGhk9gYlKjorHnqWpdDVxcYK4 UH8jCVm6IUmjSpmLwinIPTA14tAkh5aCtE+kfBYmlfqFVxXFjJjfX3pw74MTpnBT 6uLlbAWrHU/T6cO7S9O9plexm57QA8szQOoX9RgepdqLHFYG4CI3I/wMMjfYTqYI txT1skOA8d1EOTa5Nsvnm9qpEHz85oRfMuIruY+WOwF9Tog8BInFX2SabdSLi4I8 B7pLEsyqEbnSqwlikwwv6Q== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 46tpx8r3tp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 23 May 2025 11:19:11 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 54NAV2Z7011335; Fri, 23 May 2025 11:19:10 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12on2059.outbound.protection.outlook.com [40.107.237.59]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 46rweqkcve-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 23 May 2025 11:19:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=m8WEO/W70qroAN83uT3RUG+vaou1DcEhpeGzfWiUMsoC45vqIe5t5EPxyj1qoRKBrburQV6btvkFe5gKuVMO2Hg5CY9w7+xT0TVa+P1LpeW+Yp9j7ToeCS8GdD0fBT0D6wzQG+KVYN6zwqRQPHke/r93OdYrNZBNqNu84dZ3ApzqbagYV6J6r8fjBLcBqOWZZ9t+e37+/sZ8vANs5mFWh9vP4sj/xxPkAYZJmwHPfpZLYDeQ6NySr18fokyexc6byIOPSD9niwnVzDn8asOqtdhMvMc2YPH/qWwNKZu+JQdtKwkpJeWwfoFL8OkbhKVzSXJfvuGmhtkntdUQ5q8lxA== 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=yNJ2NmAPAUuuk5U1bRz+vaarMvlhAHLVX0bK4ipOwgc=; b=WM3gq3Lf1NJp7Ip8mFRLgbwP698dZ/8v8155tncq96+SwxX4LsnzyWrnwmgaItQhMaDqcdSW8Jzazng8n+Gz+6x9exfK2GNbsv258tjRPpHktKJQ6X7OsUN83/nzPzj66Vb5ZZREnfnaBoojuooY/dqxwPlfS7ewkBbU1GLE10MAl39B/qepzuLiOia7bNIm5aKpw1wggFUcA88fspPUH5mcNo9CKfZ1zvarmEgbjPcrmJWPItPCKam9R9FDRojUxVSSe7Lm+6MzJgxwRSaCor+Z7JlxGvHQuxWV0d2wdNjDa2mGYWgqf1NCL0EuDyDqzPZw48527gNKl04XeqVe7Q== 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=yNJ2NmAPAUuuk5U1bRz+vaarMvlhAHLVX0bK4ipOwgc=; b=yNQ0uGYgXPm59OnExCDaljxNLoNcSrnJ7vaOxBRdJ286VleDGhjIrjf9gdTWfvRZwlQ6jZcW/omvx+EwK+UGcOQHnbj4xb7W7/rWDbqYHqgOZYqeijcSC9WT1dh6+VK9NkmEOcpCbcD11UwkNgIgK10nXfjSpl+DW1ZozLZywIc= Received: from DM4PR10MB8218.namprd10.prod.outlook.com (2603:10b6:8:1cc::16) by IA3PR10MB8185.namprd10.prod.outlook.com (2603:10b6:208:509::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8746.32; Fri, 23 May 2025 11:19:07 +0000 Received: from DM4PR10MB8218.namprd10.prod.outlook.com ([fe80::2650:55cf:2816:5f2]) by DM4PR10MB8218.namprd10.prod.outlook.com ([fe80::2650:55cf:2816:5f2%5]) with mapi id 15.20.8746.030; Fri, 23 May 2025 11:19:06 +0000 Date: Fri, 23 May 2025 12:19:04 +0100 From: Lorenzo Stoakes To: Ricardo =?utf-8?Q?Ca=C3=B1uelo?= Navarro Cc: Andrew Morton , "Liam R. Howlett" , Vlastimil Babka , Jann Horn , Pedro Falcato , revest@google.com, kernel-dev@igalia.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Oscar Salvador Subject: Re: [PATCH] mm: fix copy_vma() error handling for hugetlb mappings Message-ID: <0b2a5a80-0709-452f-9815-018cc1cd14fb@lucifer.local> References: <20250523-warning_in_page_counter_cancel-v1-1-b221eb61a402@igalia.com> <87iklrbo8f.fsf@igalia.com> Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87iklrbo8f.fsf@igalia.com> X-ClientProxiedBy: LO4P265CA0151.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2c7::6) To DM4PR10MB8218.namprd10.prod.outlook.com (2603:10b6:8:1cc::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR10MB8218:EE_|IA3PR10MB8185:EE_ X-MS-Office365-Filtering-Correlation-Id: 24bbbe61-db26-44dd-aa3c-08dd99eba1bb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?iso-8859-1?Q?BobR/lROnET+P8NLJyvoJXC7HuGw8UPMBD8zMgXesPiUyKmUp2xrHqzQBV?= =?iso-8859-1?Q?BlQNyV+KQ6xkyBCurgOh+39qw3WNLzrZjVgnsBzZv+Ef+VRCnkrlUfiDZa?= =?iso-8859-1?Q?TPxjhuUEaBmCzBH9TNEucrRNCjr76wJLIhwQXSDOmQnIESys+YBPW3yyBu?= =?iso-8859-1?Q?dLLh1l5Z0+Tss/2UiALrtpGHtbStPKylWQHg+n/HjmehVsIsU8Hq3AkT8s?= =?iso-8859-1?Q?1Ts36fwmO5O/eoa8Kp6Ld7DArW16gRbZyQwvD0ogIx5OXEorWrRe3ik5sp?= =?iso-8859-1?Q?+0jXVJiL/QvtGJihkQXGotrZmirm46RCoH6UwfHWfYU4+GcTWr84ZgN146?= =?iso-8859-1?Q?DcXHtgbD6fEV72pb1K/mvP9tLuMPRMXgBtMV7CSJQHAki1RYbQdxhUFKkR?= =?iso-8859-1?Q?DuioVDPM1xl0ulfaDFxdE3AQxzpwgBfijF4sO+8vTw7sG9xWHawv5hU5LC?= =?iso-8859-1?Q?kC/TJKKorH72jS9hJFKHOg0XEeGwRdynpItH6HQ0g720XEUdiXC8asUVjx?= =?iso-8859-1?Q?Q22EbgG4/nf7XUtcUOcrafecIHF0ExeDV+DcE3RmYBO7vYr4rP3Lu3UUF9?= =?iso-8859-1?Q?aUxc/Ty9QHqsGjebxfCTBFrR/JNpGVgBfN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Q?4=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR10MB8218.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?gW9yAU2OpOo9stRppNeNukR8RZ5vxPla/csP8LtKLpo2eX6vxr/MyvEIZm?= =?iso-8859-1?Q?Ofv9KCvE9fN0zOzMkK1vkvdtyp/s2HPqA6Lm4FrCrupaEanCvD6VIwiDkk?= =?iso-8859-1?Q?aCz0bw5dcuCf57HjwQX+Sdp/+nEXljYynPreeX2aHHnQNxqmcYeuuClxAe?= =?iso-8859-1?Q?8DfJNiK4cb00L3e68ZyGSL3g5KtEVxms17TaHbT4n5wUsHkiLaj7N83MsS?= =?iso-8859-1?Q?8VY4p+8YhIwhvBJ9Ag9g2l/Xjz/S5iV+cg6Ag6yFol2C76AlPEe+eP+S6J?= =?iso-8859-1?Q?FCvQfgN1ROHKqp1YiV5jHhIKlQBt0fE96FnlbZH3w++/RdcRYQvOocKNxN?= =?iso-8859-1?Q?VwAeDl1R3EYg3pN3BBGHm94v1OFVXk1jOV1mWKMm2W6n/oBSba2nVGyt5H?= =?iso-8859-1?Q?M39X8vqPns6EaoEAZ1WeQDVkCTGyVLQ04uAI9NuOpO+m+MxD7bUDHOnxFB?= =?iso-8859-1?Q?jgqHbXqdnWR0NMQfh0IR9dY9vY+58aoQSpQlxOtenvEnBIZ5w5nSgtKEin?= =?iso-8859-1?Q?FDwy3AHKpvZ0z4hyF+CRGUenlvEJDw97qt6baX/MVSN1288MzOMF82jyjb?= =?iso-8859-1?Q?mp2KAHacGYfGo1P/TUXJB+oGyiSEID/hpBDnW7bBTRyRv7oKw42uagJh83?= =?iso-8859-1?Q?5ItvSufDAnSH6XJQVTaAwz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q?wQJypwNMXHXPW0KQXuoCj1akoMFzt18v1JgdCXkH6Z1a7BxNMx49PauQw7?= =?iso-8859-1?Q?rO4qX0j6RgfSmdLYBUDKvlZuzyw6iVSgvVJm1qW9G9+Gmx1h5Oa+jkUQ?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: FgVBJLnybEwYC0EjTGJt/EOC24Ah5x5Okl8rbu5xUyzRWlKW2ywKkEsps8Vh9t1+fzuh2jAvhHhe4UHl4JUH4JzFTpSXnwQbPM0XGyiVBgtlbeHMEM/wJEc/WZjEtK281keY18LFdxjTKqH7P/rlSV4iScr9scT0MLvqNpLCseCbFyFn+AvDvwZq+PnmYqYnmJeJ7WwHWjeT4UP2R526V2Ca97NsM3cdpFyDC3AL2XtlsWRZXH10BUd+VaRNwM5JqruDIV1BHsDJLiyhlnxZzox5IYJ+paLP3sy/G/nciK88alFA9Lka5AZUr9EqsKRVfTKaLcF4YoiHxQxNiS2JLz8jW4yUJ/1X2Csy484sdfwAtbYFvsPG5qOhi9TDCAMc7W2s9AOu4oCuwpxoqhC1jp7RlX/6rF9lC1nxwBw5mO6RW5m+skkn4aNmoABc6oqETBKX+s3gUMbJhCRTcLHgrIMnUFzw6ud7N/e22pYR6FPXsjeEKlE1OXd260l2knV1ERpIp55jw8mRTIkq6N9N50dsH4SFP/Vi81t1OL9xTBaiDS6lRvMnI9RLj7QU0q5tFr0T5ifWIuNDTL4WYQxPpQYkwG/TN34iI/E2M58I+2o= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 24bbbe61-db26-44dd-aa3c-08dd99eba1bb X-MS-Exchange-CrossTenant-AuthSource: DM4PR10MB8218.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2025 11:19:06.8847 (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: zd8ctCq7e6+teL/73H1t1D7IpI2OUcM95MB6WQpoC9EDlSCgDSgAlmBB9TohNvKYsr7ksXhMqP06eUYGCEmNl8I4cDH2IBFVeEUwmH1GK4s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA3PR10MB8185 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-23_03,2025-05-22_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 suspectscore=0 adultscore=0 phishscore=0 malwarescore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2505160000 definitions=main-2505230099 X-Proofpoint-GUID: KKsQGcnlnNJ9G6JTjVCKHJi2U3uNN-xb X-Authority-Analysis: v=2.4 cv=IssecK/g c=1 sm=1 tr=0 ts=683059af b=1 cx=c_pps a=e1sVV491RgrpLwSTMOnk8w==:117 a=e1sVV491RgrpLwSTMOnk8w==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=xqWC_Br6kY4A:10 a=8nJEP1OIZ-IA:10 a=dt9VzEwgFbYA:10 a=GoEa3M9JfhUA:10 a=yPCof4ZbAAAA:8 a=Dz3Odsm8meDqoBusy1oA:9 a=3ZKOabzyN94A:10 a=wPNLvfGTeEIA:10 cc=ntf awl=host:14714 X-Proofpoint-ORIG-GUID: KKsQGcnlnNJ9G6JTjVCKHJi2U3uNN-xb X-Proofpoint-Spam-Details-Enc: A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EitC7j6torFoayUqceiUO08Z++3r6eMkSi7vvavzcg0e+/nFyYczjh5zXoHibexaK5i8bvsHuwz3H3HFzH2ObW9v5HbxmLEcWSfAFpdaQNInGKkLNECbbFYeEFIYFrv/mcjqP2eCyNS1zPF0UdBkxz43HtmRdkHIu6R1D5Q2rFNUMMYPAHReRMXed1a4599Xxp1Nspvf5KLRMBdUBvvR7Bq+Lb9MIJfEBK/0cSmjMdCGd4m3OudlNpSsyMTpqavBbILTuijnyPQAukbP3V8RrMx1OH/xNwCgax/jv/MuHMTJvpqIVRzC7DIfqNHLzfxOdCiUvRntduI5io9o53xxbJfgSccZjiqgbJ0ikAykQepTIF/Zk5NKchkQtkpwI8+YHXJlLa4rZP3UwxK84IOqpiSjsIIxdASKUHS7LZymhSizGx09UGruju5Ntt5Alc7OTa+VUTHrC7zgDaNpbG882mXN/Km9XvK2lQwDWOz+WxYQ0XsASeYxL6w9Upn8JNlm 5egm7hK5 cL3nfyNpAtfZPwSQJiF0yn0Khsl35smEGu2dCiWxceYUADxDYwGjhV6ernKtxHjydafCV0WrIu/u2eOxioD3VKJIyscuTdG1BHEe+/sZ1NSFabSilPMvksAKFM8QEWoG903JzqujwUNKl4AETWwDttUcAt28pRQbofhUPAbCh68q0plIoX3zkAARbsOUMR0fcS32Yc/jKNQNc5eMvEuv8UkiJEZ0l2CUl3EmHc67r97uVifYr+JMqc9aaYQ== 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: On Fri, May 23, 2025 at 12:44:32PM +0200, Ricardo Cañuelo Navarro wrote: > Hi Lorenzo, > > Thanks for the in-depth review! answers below: > > On Fri, May 23 2025 at 11:00:40, Lorenzo Stoakes wrote: > > > OK so really it is _only_ when vma_link() fails? > > AFAICT yes, since copy_vma() only calls vma_close() if vma_link() > fails. A failure in any of the other helpers in copy_vma() before it is > handled by simply freeing the allocated resources. > > > Ordinarily 'private syzbot instance' makes me nervous, but you've made your case > > here logically. > > I understand your qualms with that but, although that instance is mostly > concerned with downstream code, in this case there's nothing unusual, as > it was able to find the issue in mainline with a common reproducer. The > closest public report I found was the one I linked in [3], although I > couldn't reproduce the issue with the repro provided there. Yeah as I said in this case we're good :) The issue has really been instances where people are running modified copies that are giving what appear to be spurious reports. This is not the case here! > > > > Hm, do we have a Fixes? > > I couldn't find a single commit to point as a "Fixes". The actual commit > that introduces that close_vma() call there is > 4080ef1579b2 ("mm: unconditionally close VMAs on error") > although I wouldn't say that's the culprit. As you said, the problem > with vma_close() seems to be more involved. If you want me to add that > one in the "Fixes" tag so we can keep track of the context, let me know, > that's fine by me. Yeah, fair enough. I don't think that commit is the culprit, as it still does essentially the same logic, it just also updates vma->vm_ops to prevent any risk of double-closing. I suspect this has been a 'long term' bug, but one again that really is unlikely to be triggered in reality. So probably no Fixes really makes sense here. > > > Why 6.12+? It seems this bug has been around for... a while. > > Because in stable versions lower than that (6.6) the code to patch is in > mm/mmap.c instead, so I'd rather have this one merged first and then > submit the appropriate backport for 6.6. You can backport everything manually. Stable side of things won't affect this being merged upstream. Also you're going to (probably) hit merge conflicts anyway pre my refactoring of mremap.c. So if you feel this should get fixed everywhere, then you can always do # >= 5.4.293 or something and fix things up as you go with manual backports. But again, I'm not sure this is really worth backporting _at all_ or at least _that far back_ given how it is more or less impossible to hit in reality. I think under the kind of memory pressure that would result in this bug (which I'm not sure can even actually happen, unless a fatal signal arose at the same time, perhaps), hugetlb reservation miscount would be the absolute least of your concern. So my recommendation would really to avoid a backport here, > > > Thanks for links, though it's better to please provide this information here > > even if in succinct form. This is because commit messages are a permanent > > record, and these links (other than lore) are ephemeral. > > True but, as you said, it's a bit of a pain to try to fit all the info > in the commit message, and the repro will still be living somewhere else. Right, but then we have more information. It's a trade-off obviously. > > > So, can we please copy/paste the splat from [1] and drop this link, maybe just > > keep link [2] as it's not so important (I'm guessing this takes a while to repro > > so the failure injection hits the right point?) and of course keep [3]. > > Sure, I'll make the changes for v2. FWIW, in my tests the repro could > trigger this in a matter of seconds. Interesting :) I can't repro in qemu at least. I may be misconfiguring this somehow, however. > > > So, > > > > Could you implement this slightly differently please? We're duplicating > > this code now, so I think this should be in its own function with a copious > > comment. > > > > Something like: > > > > static void fixup_hugetlb_reservations(struct vm_area_struct *vma) > > { > > if (is_vm_hugetlb_page(new_vma)) > > clear_vma_resv_huge_pages(new_vma); > > } > > > > And call this from here and also in copy_vma_and_data(). > > > > Could you also please update the comment in clear_vma_resv_huge_pages(): > > > > /* > > * Reset and decrement one ref on hugepage private reservation. > > * Called with mm->mmap_lock writer semaphore held. > > * This function should be only used by move_vma() and operate on > > * same sized vma. It should never come here with last ref on the > > * reservation. > > */ > > > > Drop the mention of the specific function (which is now wrong, but > > mentioning _any_ function is asking for bit rot anyway) and replace with > > something like 'This function should only be used by mremap and...' > > Ack, thanks for the suggestions! Thanks again for reporting this :) > > Cheers, > Ricardo