From patchwork Fri Nov 15 12:41:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 13876183 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 AA889D6DDF7 for ; Fri, 15 Nov 2024 12:42:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3AC876B00A7; Fri, 15 Nov 2024 07:42:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 359E56B00A9; Fri, 15 Nov 2024 07:42:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 15F056B00AB; Fri, 15 Nov 2024 07:42:22 -0500 (EST) 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 EBC5D6B00A7 for ; Fri, 15 Nov 2024 07:42:21 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id A96E914167B for ; Fri, 15 Nov 2024 12:42:21 +0000 (UTC) X-FDA: 82788291180.22.377B3C1 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf02.hostedemail.com (Postfix) with ESMTP id A8DBF8001A for ; Fri, 15 Nov 2024 12:40:52 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=JawKf0cB; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=KCU8NR5f; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf02.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-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731674393; 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=92XquejaAm2pZJ6lkHW5ys1jp9Gmm3eN/sKWT19t2m8=; b=jO0T9HSjnyXk1T2uJrh/U+Jh3N5D94i6Vmy/K0/qPIiEaecNoJ2IcdoTRtFyFowcddQc3O gX9eNg0QtHUU4EvB0Ks8QHG1WaFDBpc3wdBucw8P24fAXnWWiuUBnTAX9qylLOLhOz4G47 mpfigaiDgYRuDKQV3qhymnz5d9chnIo= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1731674393; a=rsa-sha256; cv=pass; b=X3nayb77P+KZW0zm5RjWEedgWu1vQKNnr4b852IStg3uIBDQb12cFS9+jOKHbJ8cU9LSwa zgHDIlS8wgy08KDXQXfA1Xo5d/CPgZTlmcm+uvLNRV7XZmS4YsibOj+34529wwMo9053ol Fbos61gflLK7yWiVjsmlpW5RKyRw/cU= ARC-Authentication-Results: i=2; imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=JawKf0cB; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=KCU8NR5f; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf02.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 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4AFAHEqc014465; Fri, 15 Nov 2024 12:42:07 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=92XquejaAm2pZJ6l kHW5ys1jp9Gmm3eN/sKWT19t2m8=; b=JawKf0cBUAwLTEqZzDbFfLkoLXgoyfW8 2wA4G2ScVFZUPb+6ENzv7UA3sLKXVuBzx93VduMexq5rIJXpBIg7uTSB1k3FXANG BAY75rAQBqA/wzR5qLCj4xeW6PSMfKgkegP7yDhTfYaW7j3anw/Lm0LnUrmOysnN FJiUgAUc44ucnGUN3bLVh1MxJZb1ohLr3auhcl0vm3XFOXVHRej+zAHjYdH4aih6 CFN936Eb1ND9Ny1T+KOmLznjSeJb7hfY2ECB29FZgxg+3P6WIH88ROikX9k3TvJy FhC/2lIFxpWZhCXG65DuzcICDG119tgdLKxT4RYiezWLJSlgks/uUA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42t0k2b9kf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Nov 2024 12:42:06 +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 4AFCQj9P022726; Fri, 15 Nov 2024 12:42:05 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 42vuw2mtdh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Nov 2024 12:42:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KTKVDmANw8ZAILpgo9mu7YSrtfXgIkgWlXbUV+C30Y3HLs5ZBV4oCk2UtkUNJ+KoXeFIkA2Vhif4mWAnhBT/c9qZYHpe1FGbHmgjZSVh0XXYICHbv5MVHUfn1FkHUAwkxPNX0TKBqLr/p0DSatsjL7S/uOTHCQzb3XpU7Rdoceak13ZQxpZC+V3A5GaN70c29KMNjiXzWoi7NrSeBo5USX5H0Olv/qFpOoQkeTZoDh+lnzzXaNxMLQtcNwcyeVzlXhZ3LdoFXvG5ZsZmCCtYZgz3JVMJaCFp7RxWUmqxOSLNaN7xzzy7nwHbJ70X1WtqlAsK40JCDRnZnBXKshkjJg== 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=92XquejaAm2pZJ6lkHW5ys1jp9Gmm3eN/sKWT19t2m8=; b=d0nkCX+SyGNyi66L4dxejBzKxrX8LtDmUK1IZ/acnt5llxzZQkI/b3SddwRuk7YgAXJXk3WYT48HgwYcujlvDgTkPEPZ9BJEXHOtSJJD8h63ltc1CjwbRwPQSb+oYR/UoIb6nOYfllF6N/qEICJTvlgI4IbwYY91LXszfQJ8uWwrP4nGN5nvXj2elbFdC9wtOVnHs4fL66RVh+yfpyIQdqs1yQcC9P0WvMVvgsz/R49KaY21SQVpMGMykzBBEreaqm15sSeULUHEUdRiNo4IiLOzBkQSWBgWHcjoQOy7wvZa2i8Ev7fBYuTR/v7Jp37SOOr6Lj8OlPXx6vW/ORwAgQ== 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=92XquejaAm2pZJ6lkHW5ys1jp9Gmm3eN/sKWT19t2m8=; b=KCU8NR5fNdrGnXUYmHNN0ALgyXZb/xW/kfpZZMYEwok7ElxWKYiVnrqpuC0nqiYkqYoo9fljnVCRBFQPrMuFRzHlwWijyUXx2lQXA7m1xGInYOSmFNi9DiV4s+fXUFqvRcrsI3KuJIdDKvNchDgynt/L8wK8W8udE+1pALLTuO4= Received: from BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) by DM6PR10MB4201.namprd10.prod.outlook.com (2603:10b6:5:216::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.20; Fri, 15 Nov 2024 12:42:02 +0000 Received: from BYAPR10MB3366.namprd10.prod.outlook.com ([fe80::baf2:dff1:d471:1c9]) by BYAPR10MB3366.namprd10.prod.outlook.com ([fe80::baf2:dff1:d471:1c9%7]) with mapi id 15.20.8137.027; Fri, 15 Nov 2024 12:42:01 +0000 From: Lorenzo Stoakes To: stable@vger.kernel.org Cc: Andrew Morton , "Liam R . Howlett" , Vlastimil Babka , Jann Horn , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linus Torvalds , Peter Xu , Catalin Marinas , Will Deacon , Mark Brown , "David S . Miller" , Andreas Larsson , "James E . J . Bottomley" , Helge Deller Subject: [PATCH 6.6.y 0/5] fix error handling in mmap_region() and refactor (hotfixes) Date: Fri, 15 Nov 2024 12:41:53 +0000 Message-ID: X-Mailer: git-send-email 2.47.0 X-ClientProxiedBy: LO2P265CA0202.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9e::22) To BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB3366:EE_|DM6PR10MB4201:EE_ X-MS-Office365-Filtering-Correlation-Id: 39c3a66b-ec42-4022-aac1-08dd0572e70f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|7416014; X-Microsoft-Antispam-Message-Info: czEm87QZtkwu5o02w3g4n5cF5n86vXHPPuNUZOdPYdFY7cLaSLShYHLprqP0zvj+2tbsi2COPqGF2FWZAYSuhyMd47Hd6M3rU8d5H5Iu2CBcTCKfXNTJV5FWizpm8AyubfpnTI9adVH1dKQY2n/sFgwDoWR8WKGy4gYsi2FGfJUzK03AGJcqal7t9AEgyAOt6WwtMZ2MKvOPrhFTP1BjLrW9Ool15lwaWpZN57dufAEawY5aFn+Q4UlgMjxG8BPXo+aL+lrZmfzNdm4nIcgu7+lBEko0TjeZcxA/rya5N+6ZsAvY0eXaYPYa+c5WlFFsbJU7yXDW3UZhWbULCmkKyEZp9PUCXcfRLm/OeD8gI1JQden7uvCYKSMMYMAbkWmnUsSrzZtMOoAaUf+k39AyATEbvqAvJwNFHx89OaPx8ibZ8EsbPBOamnxAF7sjyJre1W69QEEihdE9zSD5cz4rMRaRUU0r6wrZxncsN6ICJmRpKiqVPLZDrVIw9n/X+NJcwBNEBKtiyr4G3kgI7vWE0LliHxh3g4QAHvQgkpbShTqM/3NA+gAIQhYY+bX5oTuw5ogWFg01XVwtS6fPe5uZj9FMsMYekbsurXm10w2ReAOjG+Idnx0nURRd0UU06A21BjbAbSYVjrfRifTJEEXWhgs0qwx5n9R9BapdWKuoEXsN2c3/AkdjXj9ggcC5ekKA4edBbbS/DfcGr5GsnhlJ47Mfc/qC9/+f2dWV2++FZAQYVl+b5zLbIJpEGiDBIE2Kaj6brwNKUs7PsohRRN05zkN/U0i5RyDNEZVgCZRC2D3zhX0nYuGf7KPMSe23lN7tBmMkptw7b7+AOM36IaK9La30zVIP1GxakuDEh9iiyru3Pzg9SN1ZeJ4mnQuI9tvHl+6e1nWceRtiy0rX7ImPFXDKkfKk2O3tMmQLRR1opQxfDC4cXyPiPv9mX9r+f0M7MeXJIPfjzDKpL3+CCe61U1Gpc2Rfi8K8gtuUIEOAupT1VWRis14GMCswU2VqO6M+Qw4xviSL7bJtM2LwlufE/U/XzOaoyX9LxG0wdpPTxfcGThvrO1ce6+H2XbTpWhXnKS9yDKiAizOVkLEuh3BKenaWxDSxLc3hNSEYz5qFtNt8Ue6xuJI4cVj3dxUSyi3KdMML4Z8atWM8y+ihBD2qY5CoaWewMWNATlrARCkp7tTpQot4dg3nqEJcRIvQQROkIjaOgiVQqWLlPjKoAegkajGH/4769OflNk+601S9rjd/sZWji+fF4Ed+Q1JRboKe2I4VY7iETpU0sQVAg4Caoi4NFln8sZYqCM3CyyNnaSwl9yV98h3TbkDIGh9dCEsu X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3366.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LtZ37tRb6odZDuEPLnr88gjp5s+vQdsViUpgBbYKbVV++aoAx0RNZBUB9EDX987DKmlnDi6nXu8br6NQ5g59IEjYfnLMIKSX1X5rksTgVbtsF/HtyyB1akJ+4WWz3WMGTPCyknYn9Llj/13do+kvSvZ/SomqUsuGr5ZlsgcDxJnUHBlRy1orKWcc1tgpLy90Yyb7B24bdQdvyE7ZQl2maQpX2V5MabBPBJYGwkPDgUswyOlZAhb4hQGTW/T7kaWHQ347Rivg5ZHcVwT7ifCU/qHGfuste5uynd1oT83bD0AhIkPH6+0kV2h6wCG5HtT6d72xxsK897RDfSXwGVQVllnW+kBEy+Wl0byTbkzfWMVfubf2GlS9PtewWLyaS5X/9RZ7lMvt4GhfY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shmx9dfPFH9VLpE1jHIicz1ep49WGyuLb/zLCPMC4ZgflRNEw2FJsiIP1upuARnxJHBUvE0UHNyeu8ooc+8Ax/RHnub8AnhRMvL1JW98tx6ZJX7r91tJX8c8jRwrbyGLvIxV4njNwdTreTDjg== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: mdO891Wlqi50avwy/lziVlyT8pCF54xfBEtpmAZirxheCaYAbU9f2K0iWbSqnsmWSCF6LQ5SU2LE+qrBIfYLVd1AuNNtIu9VNBvTXGa6VVHB118f+GYVZynXMmOWjcsnJe9QORfTCTxUBP6/c1P+4Y7x8j9RcJARWjNcjGxI+4CxLt0qKBnih9lt26tivXRxYsg7LfZnV89je7mZwYtp14gHniJII8xGEou+fhT1Ha1Ec352dyvLciAbo780VlVJUoE/VWQLajrrOu63tu7hrxdif8aHW4vGupEFHm6KE1XhQClVOabNtak6rRKHMU2Ucchti6LG/j6qjWeqejNLg4GDpWVFFJJyGoFNssT6+koNSm8mR1Xq9IDNQ82ClzmuOhvTpKaL8k15okN3u3yq/pR9bspdQ25+SsN0mLGFE9oVqUeGvUdVn/MwqemBxnO4WQpRxnwqUrYCeTAurHzlkmousHpW1ejzmNCnUqOxuYqstJjx6KbSn4NIMGN1OX7VTQLOhEF52MTlKMGN2V/0xlCUgHeqB1VHLU/hPIDO1BHw8TSiZzjYDe5RPDcPn42nHhaiGEGecvALeUFm9Zvx9H6jsHugfy6N6rwU1BUYp+c= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 39c3a66b-ec42-4022-aac1-08dd0572e70f X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3366.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2024 12:42:01.8479 (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: 1QvdMIRwf2KnbOHA/hzsak6GdxTsbhMW/9c1OCCq5fwvnlMqlfsNC3Tb0/06Sr1jhgSwQc3Hk0lEXWwQ6QY8e5aWHWhEvKmAyOVKMnVSj6g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4201 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-14_05,2024-11-14_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 spamscore=0 adultscore=0 phishscore=0 malwarescore=0 mlxlogscore=565 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411150108 X-Proofpoint-ORIG-GUID: 8AurQLQQIhc6LIuDbWAd6hto8vdhI_zY X-Proofpoint-GUID: 8AurQLQQIhc6LIuDbWAd6hto8vdhI_zY X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: A8DBF8001A X-Stat-Signature: 5ae3tjuxeprzcmtsexc69h198dcwwj6y X-HE-Tag: 1731674452-291276 X-HE-Meta: U2FsdGVkX194XViuCF+bKGid0mEzOAUZeHi55AoHmIPxKvS1KdgNlG4zvoIfgNH5aGzSjWRP0KfPotCFd5PvXhJSwzZAHYBumEQWGb7+urjm1N/rjxRiN1DkbfH737j//WZw0ZPB3zw3tGtjMUmFBZCM4YoCuu9ODs+xLdx3p+6STouPwzTbMiZ4gg44VSpvDpSXQX1EHDCsEzuRCI4oX4G5j7eyNRrR8n7x5XrnLESM5lURpi6Ky+YrsVKOFujwVKYuuuxJbLJp8Sg9pzAsgqUhee/v/6r5OY+w/BwJvqufeK0f+FNXmjH+kBrEruKUmB9OFPVaJxhlaUvPhBXeJtCR3zXtW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/3PSKHeKTYe834DN26YtedqlTXkTSx+5tvMT+JTrGuPTClpDEM5VeVdGhghF+DB0r38cdikOiaxQZaq16vmZPYskWD/Zv75/xEDB90jQfSS3ka5cUcCaODZndwZr7ymmq+kfx9SgObZ9xlEToXPRBr95S2rttnElT726uQfZjO0= 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: Critical fixes for mmap_region(), backported to 6.6.y. Some notes on differences from upstream: * In this kernel is_shared_maywrite() does not exist and the code uses VM_SHARED to determine whether mapping_map_writable() / mapping_unmap_writable() should be invoked. This backport therefore follows suit. * Each version of these series is confronted by a slightly different mmap_region(), so we must adapt the change for each stable version. The approach remains the same throughout, however, and we correctly avoid closing the VMA part way through any __mmap_region() operation. Lorenzo Stoakes (5): mm: avoid unsafe VMA hook invocation when error arises on mmap hook mm: unconditionally close VMAs on error mm: refactor map_deny_write_exec() mm: refactor arch_calc_vm_flag_bits() and arm64 MTE handling mm: resolve faulty mmap_region() error path behaviour arch/arm64/include/asm/mman.h | 10 ++- arch/parisc/include/asm/mman.h | 5 +- include/linux/mman.h | 28 ++++++-- mm/internal.h | 45 ++++++++++++ mm/mmap.c | 128 ++++++++++++++++++--------------- mm/mprotect.c | 2 +- mm/nommu.c | 9 ++- mm/shmem.c | 3 - 8 files changed, 153 insertions(+), 77 deletions(-) Reviewed-by: Vlastimil Babka Reviewed-by: Liam R. Howlett --- 2.47.0