From patchwork Fri Dec 6 21:52:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 13897815 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 199EFE77173 for ; Fri, 6 Dec 2024 21:52:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6CF5F8D000B; Fri, 6 Dec 2024 16:52:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 67FDA6B00EC; Fri, 6 Dec 2024 16:52:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D2B18D000B; Fri, 6 Dec 2024 16:52:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 2D7AC6B00EB for ; Fri, 6 Dec 2024 16:52:53 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id EC0CC1A0A76 for ; Fri, 6 Dec 2024 21:52:52 +0000 (UTC) X-FDA: 82865883828.03.616BC00 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf21.hostedemail.com (Postfix) with ESMTP id B2D801C0002 for ; Fri, 6 Dec 2024 21:52:16 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=MSXR6UMo; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=TtVxae9F; spf=pass (imf21.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); 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=1733521962; 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=pvzXqFBbGb7wKFzmRFxaoHNzxmbZ6iFpyIM32DJXQV4=; b=qHxb20yAVLyWVGF3ToV999WcfLkrmVyqidHtIH/mUPpvZQzHpWMxqLXNTtB4adhuhUe8D0 7dSz2nZlMRzk1ThcTzeeYZqDL7V0fZC/iqNme0Y32XVnkZ69O3UQJxJJEmam6D/0S3da5Z XzA0kkxJ17y2v24xu0qYIXzDwON9sbc= ARC-Authentication-Results: i=2; imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=MSXR6UMo; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=TtVxae9F; spf=pass (imf21.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1733521962; a=rsa-sha256; cv=pass; b=gUG9rXK1lxOhUJGV7VO5gA4Ses+cPO0EvyDfPKTVTA5Jjil1smDirHmalyo8cSKREyiYdn xLAQfA79FvP/wtOTM2QMGInUUd6HhW6aBlsTIOFBBZNZYwhPTagpdMGo3JttrE+LBei1v5 Cek06ncpr2ms4GCYeF11gmrqgxitUZs= Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4B6LWwFJ024357; Fri, 6 Dec 2024 21:52:48 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=pvzXqFBbGb7wKFzm RFxaoHNzxmbZ6iFpyIM32DJXQV4=; b=MSXR6UMo/RGbm73YpY4pjhLnsgENXvZ3 N5OR9ac0XR/gctIL7ivHj544jla5nGGPllM4yR2/caC3ZKHKTPg/T45d8xYiMH5v 06ruAEtvJs8nuRJMKdJCgX5N2HrrTkQpYptO49GSBlQC1YoNhwle2e6DCKoNnl9M A7R+2VU2se7o3E0B54u2FCxzKciVmiiCa/QaIyaKIcUOVkvjVdrm9LUwKB6uMA0A +VwOpFdAoB68EkBUUKniTh4G9zhHj4JrEUlNKm15Bva1RLJd3N+/ks+IsVfXCwSD sT5p1/EpayEKovSNGTy1CpBLXG5sCI22tsNtE3eLokxTp7o+fY5I9w== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 437tase7mt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 06 Dec 2024 21:52:47 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4B6K4d1n020348; Fri, 6 Dec 2024 21:52:46 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2174.outbound.protection.outlook.com [104.47.56.174]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 437s5ct9dw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 06 Dec 2024 21:52:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hT/0xQkufYIoc8BdA6UrI3MhfkFbgRaEelEJi0uijjQGCAbfu7oXr5fJMo0Q1RQR4SYOTRraLVwMWv8v5tIs4FXRgOfiDrxq+0xUfgSPoYjv8AlSw9Po7moNY7s3/y3PNnzNMHrYpYGVTYDDXWleuzWozuZTnkzZ74ElrgFSgNC7TSaPo0zPeIBPkGskWv+zFjRN0q435R3vVS2VcPtJ6F/qxlkUpQ59xtGgwwRy03tHcLTHG7YH9vhZifotReOBYShMLoxxCB7Qj7z56fCeVOnG0KPWOCIkKF+EN9ebxj2aeIxiHcNTS7z0pQW0F+PeI/UYNHKHRn5EsRQM65NQSg== 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=pvzXqFBbGb7wKFzmRFxaoHNzxmbZ6iFpyIM32DJXQV4=; b=Eh29uTOYIh4Bhx9hbuq1ZW8qzOfNAnLzN7oD4MJe0Tt0WIjwm97jRLCo5AIdtI1kjdqH4tK8wpPbYg0eMYEFhpSjwdq3BOnqFRdCnvnkCdV1F+vSm70Pr9+tuukqAy6DEmxJyApPFLBIHAWyafK7boBdO91XrjHZ1FlYowtAf1O/z1yhtvUsPAKpZlC+7hzh+KWD6CHq7R2Ia/IH8A5EJobG3Dmr/Lv9/v8JuhNQ4QliFokL/NK/yxoFAg2ECMMqfSYhejZfi7ex+vx72hh/pw4FkXBKDzy7EHL3AmjI+pxrZqg9y3/CWcHOr0Jo2WchndU8Xb1D1EAmK3tdosG1GQ== 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=pvzXqFBbGb7wKFzmRFxaoHNzxmbZ6iFpyIM32DJXQV4=; b=TtVxae9FR2vUSjJ5KcMPN80CGfrZNOA3FzB8zBlmARkWaOZiKKoAeqpuvAlZy+ozQUarF9jFF9yo0Ggd6IN2/+gaibOq5y0xCQk4Lq73xGMsrtxZkajubcZXRq41nka20Rp7lEXxqxYpxA/x4oviA341v/WokcWRsBx4StO2W6Y= Received: from BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) by SN4PR10MB5560.namprd10.prod.outlook.com (2603:10b6:806:203::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.19; Fri, 6 Dec 2024 21:52:44 +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.8230.010; Fri, 6 Dec 2024 21:52:44 +0000 From: Lorenzo Stoakes To: Andrew Morton Cc: "Liam R . Howlett" , Vlastimil Babka , Jann Horn , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm: correctly reference merged VMA Date: Fri, 6 Dec 2024 21:52:29 +0000 Message-ID: <20241206215229.244413-1-lorenzo.stoakes@oracle.com> X-Mailer: git-send-email 2.47.1 X-ClientProxiedBy: LO4P123CA0243.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a7::14) To BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB3366:EE_|SN4PR10MB5560:EE_ X-MS-Office365-Filtering-Correlation-Id: 8799faa9-2520-4110-30e4-08dd1640508a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024; X-Microsoft-Antispam-Message-Info: /yGLB4pYw67piFx6uk8AxO8f9qsl/UHcbTcKaz7wIEPwwHX+UrEaQKhvcScNoZeSqXKfsCiwTH0+Zb5x3rBo9H/88b7naEdU/48kRPVJh1TM6PDEIbTSWJKXEWeMyg8PEbgTUNnijvwrTLpUE+5fF72jHBH/hW1vs7rNpYQghtHLMkpNJCukgSIWeOSTE19Wx2SIA4a1xk7+x8ZAPKTpVgx6wygDYT6tDz4V8dT4b7b6szD63f9XA+tMZX9vFZOxSqhRU3wB0ZLH/J+iFvBcXOXi7BHiDhMGwPN9bN+qtCN3JjeyqRzype5blX7XYdRSwY12sZ2DUXpEX+89bcv9YknWApEjOsM0kZsd67BU3bjPyucYc7qt3zvQwXWUBSicC2gkJFycLtNMnOeLSErNQe2k5sU2wIAGe8KLs8J2a3SEfxp7unemZFXgmSJ7yJHx54D8BRcMbD1z1zJtmkBFB36txJ23NWBM+y52Qer2V/LwoJszU4gONsqoDwHl0dTbs9vhk4EprsBTuZ4DnJsm+vJTD3IdGbw2f347839q3GxzHLsOY8Gr61vi/ytPUcXDmD4Miljl0LaZeob6qyZUtflXQwTXBxkDIYt0EiSBVrTFGfbwA1aNrhdFbDTtj0QZ0q1OWkkFPYb+FqdAoNFsWCMJ8vDek8JbK8xfdS6YtK4sA7jkfzP5dct+mDNFkA/OQDMv/mzJGuVpdXdyi4WaZhT7Q+TDoGR58ZKOVwArHlKd312iVcWhKlymNw6/NrIDRW9FXxlG9Jb9a8BdXq0XhKBBY8MZnnPVtdaCNxVZYO5QHgqrqWHexeNzFqTltiY6qCZ5JUyHKAdLXsFpPJ06ifTOyOPSMnzOK5IE8pfIPMNa6zIQLGmD6kXul/BMc2CROLMZBHZxX1sHVvExvW1Y9iZqYNbL5Y25e1GlGFJZLQlNMEcv+ZinVXwwayK9LLeDST1cxpR+IGiWEipdzQGf2QRLw9Sqq2GFHpz1RmrT3QBvO9iC9UYvmn+Wzb065oQFCVFPIBw//o8PfNcLXHwXLbSfRBSiNQNna8+Uyz3WFCWbn903JxTNH7detG8BG4IzeHDgGIPZ7F/f+dpWWbebmnSBQhWB46xfQEvIgB3Quo1R1PXdqsw9sGJqzB9xYEFbEF5RljRjwsxW8UKWbf87nln5rV0XvW4qvLFpnneMvw8DU2VQv0ETJTR3Ple63j7pVPFGzIWuM3sl4f2eBYRORWSojpNnCv0dVgZ6IZeVnXW624N5iQ+orHgDE4P9mCzi6yxb6UUd69QqPzAlrvXEptJ1KzZ2/DhNEL2l08mC9sB9JO16JykviwB4kMBWpYZflsiCvzfUqlHkRx7guTWOUDgoar7XK253LSomaz++3vI= 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)(366016)(376014)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: s6ITSYeOHyoMFFsRISV511lxYBtH7CmJtingMx1jUteeiKJOMNn0ptr+FPYVeRbQLa3MvKpvK29p8RHggL4T95o+/iGpOXf4RD81125OqeSC3zKOTGZmF/0ZIxkTjkFipUABBrN9v7GXybqXDOqSp4Jlin5uJCgELFigBLzO5yougOA4hTwseLRpy8remDDgc1qWY8gjg/OwjLD2MbGhp9NSkzTk6kGdSU09R252eTvlZZz2pI6vskRbzOYqOVQgdHq6vRY5CcWV4kRaAi6gkhM4Ih24Pt0ivOK42I/bJuIALJTTPB4khggO+XgLyYldMyA4WBLJOrXaZan0diiMb0IIKpUnvZoEgfo0NveTlpWPdXnmlvAIDTA86dF3z7bcvYrKm+bKMGIsnbSP+jqBTod1BUsYL56XgRS+Ig0W7A7Z3ludhFAljZB4wK99OW1WLC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QCozaDP4AUUXxuWGWDgSnHINuiguBVeDRhrLNRBg1b9+TxLrG1/d3ywdYB77O+aWxu9fei65U91PWvK8BwfemAANhLug== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 27T7MclEoouzJRtW3FMYNACoq9MiGx6qsIC0qBfqBZlVuH1R1WVTNrz1jOk3H9cze0BLu3D/FkduJKDJ+4gVaPVPbQZQiIqCN/Pa2ZCmuzT0z9cgCo5FzSKn44oNsFY42qaaI3BY+CJo8k5y4K0aWCFJbFpL7Cdsp4ArKBplkslsfM+nkK+GWPDaIv0oexpPLgFePQ2Amn2YBHyyL96xMPmQRdWLwnKojHX+qvCUc2XxtYKaJjcvr82Kbz6lsxbcERFQtcI4dCMcf2oDEBCCCHxkb6A+o+e5cewDlNxhXb2OTi8AfzkDun1BQwzwoGARdcyVlYQHawvqNmoAZKGMowUnFyYcDxAjZBKH26C8ttEzDv24ZS0fSw5+8U4VCBTt6jaUwOr4a2uMleI0J8uGwOF+j7+aCPsXr0EIGN19hqs/rNPtn6xDeiwaFeW95qNWIXnw/7wvVWI44UQq7oUwbr+b6FlJsPoINQXMl1LHe1Rzlx+fYKZLmgEGAy8WOhBsFsDyG/YXAEwr3dWjktvN1SuCIRQRJSKAPeeocwDM46kCIyv/7YuqxFzP7U05mDStc/NjptNmiPe0kaX4GRImUVWVSkMotncK+YY9VfmBMKw= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8799faa9-2520-4110-30e4-08dd1640508a X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3366.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2024 21:52:44.2422 (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: KSvDk6AGQTx83DClMvwFVBO2hDSF+PFa6gdLKBCeyR6ND34nCI4N87sdtRNbGlNpPH9gpXGlNlx35yiUSUYmngi2woOiMZEf49V9E1JujXU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5560 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-06_15,2024-12-06_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxlogscore=995 spamscore=0 suspectscore=0 malwarescore=0 mlxscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412060165 X-Proofpoint-GUID: tG96woTRu-cpCJzPn6ZYYe6Efskyj281 X-Proofpoint-ORIG-GUID: tG96woTRu-cpCJzPn6ZYYe6Efskyj281 X-Rspamd-Queue-Id: B2D801C0002 X-Stat-Signature: raqj8o9przr1efyttjbs5mo51gxmoxmq X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1733521936-469883 X-HE-Meta: U2FsdGVkX1+73dN9G+H6JlOOgHxpBLNkfZ+CWEo4isqGDGKWCsmlbxa3CCl2CG7F+AiFpnH9GOyeHb1KO4Nj8rAMk0QKLsNqllvaFsoA3FHBabfsCwnrvg1UTkGrKCeXZlFNmV2LhVor/V+CMzkkRUk8BowDe5Nl5fmQ+8wh/39DYz0MFEWql6uUzzhzTRRa/8rHibG/B4SW9yPLZu30o4e1lOLq0DRNMFd0OktJMcIh71v5P1Ou+DSyY98JCxPtmOz15bjUW0uMIBWTLfNIfUyJ6XD7q0JnxuIzuomKfpQ8BLdSMVt0Mjz3ysVLhngTCRZindahS+TbeaB8sVXbjpzqS9Ahc9jzXEUP/uEXvjFG/f3MDhT3dJeZDtdGUa4WC+3fEIrotziWcawRw4SfcX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RAJuEk/0ZIi6GJQOjtV7T1ZHTPVu52OR+bO8qu2ia2dXNTmL3TQs8tKEC4XXHPLjWPI0SqVyoChDkJDWAYOZEKfjp1YjBy4eEHKsUJED+skObsBhaIIPHh9rBl8EMWHi1ypFFcS2YsXq++UPgDW4ZXc3RkCeG8oHNaovobpkJGIVPn 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 second merge attempt on mmap() we incorrectly discard the possibly merged VMA, resulting in a possible use-after-free (and most certainly a reference to the wrong VMA) in this instance in the subsequent __mmap_complete() invocation. Correct this mistake by reassigning vma correctly if a merge succeeds in this case. Suggested-by: Jann Horn Reported-by: syzbot+91cf8da9401355f946c3@syzkaller.appspotmail.com Closes: https://lore.kernel.org/all/67536a25.050a0220.a30f1.0149.GAE@google.com/ Fixes: 5ac87a885aec ("mm: defer second attempt at merge on mmap()") Signed-off-by: Lorenzo Stoakes Reviewed-by: Liam R. Howlett Reviewed-by: Vlastimil Babka --- mm/vma.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.47.1 diff --git a/mm/vma.c b/mm/vma.c index 8a454a7bbc80..1ec349141f5e 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -2460,10 +2460,13 @@ unsigned long __mmap_region(struct file *file, unsigned long addr, /* If flags changed, we might be able to merge, so try again. */ if (map.retry_merge) { + struct vm_area_struct *merged; VMG_MMAP_STATE(vmg, &map, vma); vma_iter_config(map.vmi, map.addr, map.end); - vma_merge_existing_range(&vmg); + merged = vma_merge_existing_range(&vmg); + if (merged) + vma = merged; } __mmap_complete(&map, vma);