From nobody Wed Nov 27 18:39:10 2024 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2078.outbound.protection.outlook.com [40.107.93.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A919F1DEFD6; Tue, 8 Oct 2024 07:32:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728372753; cv=fail; b=h34zAgSBBlVGSJ6KlavNeLfxLA6PjBoTA7CB3E2e6I2pzwfBT2Ktd7mpDuvssKvwsb8fZgEVEDar/a0M7RHsTahxf1eK7ACU51R01T68RDl6dcHSUUkCOlEpI4v2nQNHXXHzUM+EPW0K5iiug0p3vWGTJp7pKFBUf2llW1YtQF0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728372753; c=relaxed/simple; bh=FbbOKIbFwcX4Q7elAQbL5PbW8jAPFIgdgO0D3nZFP4M=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=biLzSjtxdEgc/YapHOeh8GZYoNPJoD4lldD6VswYi9xxZ/T5jgL0uFtiX0lfkWosOdLyqtGgwbiRQktzoE6zzr8lz6QMQ+8nLrITpa0uZlwuDOR+kGZQ2BO/mTQvlo+77O50JpGgBZ4l5fiikYNGAKKfaQELNygvyZkuzJb6FxU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=IrpHnoFc; arc=fail smtp.client-ip=40.107.93.78 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="IrpHnoFc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ldiNHi3GUbKXDthmSO0wmIsjsvd+NCrJ1PYpb2sWz0IcR0PcWGWSxeStKX/J5S1bA9cuufwz3smNQkFL7CfGO5/7C3pI9wPY0BmvNdlrh4pzeMVIBwxxZMec78H9X5YWRzPPIZonchiT/c9Z1qnOCkEOmA1SOepgrwGZ7y+GIByG4Q6HTuTNcMvb6fwjNiHsrVVsSsUYhjyUGQrksa6wurMb7drjaV6yFvbK5HvIXTc49zziAK3czEGD9mXAvQFMzmUVLRn/0kAK2XnRTLBscCOtCk56NbM8Xz+hegGlcFmAFccCt76zxzQocwd9N47rZ3XMKblw9eCouvPdTinbJA== 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=Zsi3hdTDSIIOdzaBiLD5Ls2B3gc889Mis68yruBpz8Q=; b=eOYT6lN6rvwwv5czu99zMcx3Zher2IqXLka2R8WiYCbeuWWIWXRpwrocruld7fjUEFAo7O0ivH4LcLeW2bGc78wZh+aJ/BqBSWf3yvUr1OtFuR393LRddov3UdStSUTO5tApytFTM+P8YCEXNO4DDDx9EcLwC0fgocqhfvVFVos+faEsG1F7VMbwLe4IDwzCNhisxrzucWwTewUwPnPd6UH3TC9r0Tsw6V6C/WJAiW5VD6AW2iFrbPCL1qddM92WB++0Nhe70VetZJsf/7o1m/RQZcLwbPVycSVWsoZmA71RWjypk6x2AYged/Gl1jDqyRl5nY7c0LmLMbJM3OrBhQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Zsi3hdTDSIIOdzaBiLD5Ls2B3gc889Mis68yruBpz8Q=; b=IrpHnoFcr/fiqrS10z8NDHoPlAWyM2L8mYFyr9eGepWoNtyZ/vvG2ZRQmy2/Peq1X7eyYsNdV3modc1gfGWu0s2GANjqARPBgubUJyHqHRelxM0A2/HC62sUmtQ3O5pts+pv5imkVKx8s5xcOfsrgX6JwdIJXWD5GSEt4rTWlpZo9LeUYBaBfI6v2kFA9T8AUVUA2t+365rl9eA3CesMvHpKLCYZtyVVqq7LrdbRIutkUaWQJf0QDO6kAd8pEzJ4TkLLyMacTtzqWTpxXk9FfCnfp34d97TPHw6nN8/L2QJW7FBpRRjVQfoulbWOUF2OITfcqBCDzOUIFQbOvFPEpw== Received: from DS7PR05CA0029.namprd05.prod.outlook.com (2603:10b6:5:3b9::34) by CH3PR12MB8404.namprd12.prod.outlook.com (2603:10b6:610:12d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Tue, 8 Oct 2024 07:32:27 +0000 Received: from DS1PEPF0001709B.namprd05.prod.outlook.com (2603:10b6:5:3b9:cafe::4a) by DS7PR05CA0029.outlook.office365.com (2603:10b6:5:3b9::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.16 via Frontend Transport; Tue, 8 Oct 2024 07:32:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by DS1PEPF0001709B.mail.protection.outlook.com (10.167.18.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.13 via Frontend Transport; Tue, 8 Oct 2024 07:32:26 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 8 Oct 2024 00:32:17 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 8 Oct 2024 00:32:16 -0700 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 8 Oct 2024 00:32:13 -0700 From: Yonatan Maman To: , , , , , , , , CC: Yonatan Maman , , , Gal Shalom Subject: [PATCH v3 1/2] nouveau/dmem: Fix privileged error in copy engine channel Date: Tue, 8 Oct 2024 10:31:02 +0300 Message-ID: <20241008073103.987926-2-ymaman@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241008073103.987926-1-ymaman@nvidia.com> References: <20241008073103.987926-1-ymaman@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001709B:EE_|CH3PR12MB8404:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ceb2b4c-db22-45f6-7f90-08dce76b5bdb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014|7416014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?9zGXX0Zp7kglVZWMH6Bc/I+ja1KHhYAzOnAEpTgG3KXNqLLNe7YQmp/l7KbK?= =?us-ascii?Q?sgenGTHZXrDVPIdANBC/QbrYvtAPx5BIw0ns9d86uYqwsL3Fy3oAZjio0hsx?= =?us-ascii?Q?RjXMaPCAvYsM0EON90Rqv5LfeSpMStOnFgXQH3+4PggaDhj6v1PvZThbTsNK?= =?us-ascii?Q?kPIXVCKXFAGSrOG9eJqUYqCy4EUQzpJMkM/QjaCQXUKFqy6n2J7ro6eAu5K4?= =?us-ascii?Q?/ed8/q1MhaPm4cAcA/GN2lGTo+AuFatlgSeBl4sLIn7RPfPidOdc/i1+f5AS?= =?us-ascii?Q?Zc1m5GixWDSXl8SObMHY3QGFKxh8ZRlwiDxmrM5ftIdqVpSsk2cH3sEbMF+y?= =?us-ascii?Q?m1fcSj/NnfvbHp6cBuyIb1YsSy0p393zUB4B+UkRSzZnVg1ITE9qCSsAn/+o?= =?us-ascii?Q?YkC2DMgkgol/f+EMn3lnx8jkfUvcYBiALTkOGqgm8BPE2ZH7y3iu8WjmC5I7?= =?us-ascii?Q?wHwKUZPQEtpfMzT+AKDzDYDPmzabsc7gpuNRjjnTOYqqGHvl0Y8uSy0xU5K6?= =?us-ascii?Q?VyeQ5FEiCyIWcwyM27BNVBulI1FBLCfClhoANqyi7EdlOM1IWWbXQz64MDg3?= =?us-ascii?Q?BlH238Nsp8eFtJ8FrHaq+hosjKCtY+tlmFrJILCbjtniuCzqZ4m7q1UTOCtV?= =?us-ascii?Q?sJUH/GU1MiiYZR03eP1mQlTbc58EU8xKq4uY+bx+5hv61solTzC0gzyrjaZa?= =?us-ascii?Q?jMN8HADXxJ3Xx5AGyLHm9H5PWec67EFkAae7SxUGbtvtwhD153B09tCnyzt+?= =?us-ascii?Q?p0JlCGgAgTxFDhcJb7OSMJ9JWZUplnM8oHSUzh6d6X6FsozCYm3YwUrS+OE2?= =?us-ascii?Q?b+GrVnFtJqNzyRr8SqwtD7iZRK/pj7cVexyHzbb0zSLvD86K6uvwyuOuGe2x?= =?us-ascii?Q?g+JbQEFQvBJeEEhUUZURhfZbH3Ay1aJV0N4Vkzd28LJ1EbSXefz9njqi3ut+?= =?us-ascii?Q?dNB0W20xTugtqf51J+yQARqMl+jMnpv6rctgYuYFescPk+Vea9ruG+n7/AaM?= =?us-ascii?Q?ZwwK6USfvgZoFU3VFkj7mCnRqxti2bZBeyIOD8vRBj4gShZxcb43J6dIRHp5?= =?us-ascii?Q?OMvKsK2btFJThrXqXJgfsrjsulllWzIEK/nPuFLxaAftiiR6bVpbY6lXS53J?= =?us-ascii?Q?pm5392FQsoH9/nA6KmhejPPQb/H7NwRUiu5jjfSTvC40nr+RdFa2e4cbmAvo?= =?us-ascii?Q?ESm3g/kXKIGRd5ZKMtalyEaD8nMZ/3Zrr9kiWB9BfNFtMcSPpHafoSOJvfXa?= =?us-ascii?Q?1fgp0TDu+QYjB5Gc7oQwuBOeTZcL4rMdQHScVdPpe6T7hm8H8LMFQk5ROr4U?= =?us-ascii?Q?WK3n8mudxFRw1X+CroVQSyE/PfQ4YWXwMmS+2qI5yTxDivvonjMuTrtFSXzu?= =?us-ascii?Q?HhvmpmJPGzJpuQow60U9KSroqr9V?= X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014)(7416014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2024 07:32:26.6521 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6ceb2b4c-db22-45f6-7f90-08dce76b5bdb X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001709B.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8404 Content-Type: text/plain; charset="utf-8" From: Yonatan Maman When `nouveau_dmem_copy_one` is called, the following error occurs: [272146.675156] nouveau 0000:06:00.0: fifo: PBDMA9: 00000004 [HCE_PRIV] ch 1 00000300 00003386 This indicates that a copy push command triggered a Host Copy Engine Privileged error on channel 1 (Copy Engine channel). To address this issue, modify the Copy Engine channel to allow privileged push commands Fixes: 6de125383a5c ("drm/nouveau/fifo: expose runlist topology info on all= chipsets") Signed-off-by: Yonatan Maman Signed-off-by: Gal Shalom Co-developed-by: Gal Shalom Reviewed-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouvea= u/nouveau_drm.c index a58c31089613..0a75ce4c5021 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -356,7 +356,7 @@ nouveau_accel_ce_init(struct nouveau_drm *drm) return; } =20 - ret =3D nouveau_channel_new(drm, device, false, runm, NvDmaFB, NvDmaTT, &= drm->cechan); + ret =3D nouveau_channel_new(drm, device, true, runm, NvDmaFB, NvDmaTT, &d= rm->cechan); if (ret) NV_ERROR(drm, "failed to create ce channel, %d\n", ret); } --=20 2.34.1 From nobody Wed Nov 27 18:39:10 2024 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2042.outbound.protection.outlook.com [40.107.101.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3ADD51779B1; Tue, 8 Oct 2024 07:32:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.101.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728372765; cv=fail; b=ZZ7U5crMHEqAkPF0SW241IG6KJhAz4dMDEBA4cZt020J+/9hVxrA1u7d5gIPm0imIXdIOpmeyZLbagwzPmJii1yxMkSefqWT8VBCEUCRMakGbkzMiKhjkIkOFUiVaSbC25FX8faG/J/EbFJqHV5xGm2TKdiZ1GsxOs+JzxiiHZY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728372765; c=relaxed/simple; bh=uapw6YSN5kzkG8QmRw5nmx5hrLy6JERTcHfAV2U4bao=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KGCsi0KklIRQNUsd53Y2S7roTkX6XexFaWOsNI4T3URsJkY/g2fUSxPx8X8eHrS6owCWVi3FdFrfatqxClA9qYiEcJ6csiTj8GsTToDzrVvT7tHAOMBgiwOpOcIMLuMF0ZiNazlwfEIrRMnYQXfTEKoI+8ubMmeiEEzaaf7HG/Y= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=LspoFCCp; arc=fail smtp.client-ip=40.107.101.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="LspoFCCp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JE5G56X81b3HHpV/JgrI+J8vlrEjFFXgHj+W2B/roNQjXSJxZaACVwq8nnadXMKe8XcWAP7ri8dCfeI2BByqpLiQydYKweCT4B6ReNicV8V/+Ci2+9WDdOLP2EzIgwsfkUpaa+zaHcRTgikdNGOAEoXluYI9oPT6VeMcxBRsqOjdnFsq4jGjrbiNgkkHO5E+LB2/WHT8Um+VcP8Agc2v9qfevztmpdpxnPa27m9/Py9xGC80tmtMg5E9SVSw1yyqc5082pYI1P5AZwvfYAcu9iGl44kEqdomWSu6UG6DnGmWcRcDVnugBV7M8XoDpRwLNAQDVQoXIdlAW1fC96u0BQ== 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=Q7er5QWkVAR30tYU+u5zWDMxY6A325xO9o5a7E70Nrc=; b=gvwSxA6GvRe3aUhltZVUBa0PpbUzFYgNHgiFu52me4Mw5YC7J/1Hi1/Y0sx8yr8SKtJ3Awm5/8MbyZUgdVlCduoL3peGSN+AagDPkgJsWof3pdVZqsSOdmkSpiq9Ix1unwtPLdFBdBy5u8R6YquxJ3Lwolab4vlcU77cs/WmLfY/aYap9OnfjkdBGnhe3LVc9nYRzzkuUSBRXuhY5FdnUl/MCvSrMI1nRIRX7BnIGQVNhkADs/yfchP+NLN1kUPVQAKQsP0BgeJWdU91vl4dzPUu/FTsG49GbVaCi1YnU+A5qhb5XDPYa24HDwXWVqp4esVbvYWaBklhGervPKX9Mg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q7er5QWkVAR30tYU+u5zWDMxY6A325xO9o5a7E70Nrc=; b=LspoFCCpgjYK+7aWVV/WzLxtCLOdVMAdJDdxeG9hswwunpx7/RIGz+3b4/puusgnaRcCrBhygmXuV4f6pwUTTLWMIoSyjiYjzmRxNUjmdnVFms0z+E9NsLth/Vd6EGrUyi9XBJaoRCwj2wAuqx6/lcIcO3NJ1/xpOYGoB2uEbUlGcMXBCl4bT/fuOL9AQ4PZfL9loDTx+eH70/Cv6LIxr9d6Q1RRMUaMvsydxFT5nuFC3O+U81YNzD/vtFc3TfQC4P1XigG2B/lhTWaDwoozLOXkPwNFScFqNZK33Fx90Su1rHDqsgPn88GluhtDMZGEB8DI1f9my4NxIvUmEZBLSg== Received: from BN0PR10CA0019.namprd10.prod.outlook.com (2603:10b6:408:143::8) by BL1PR12MB5777.namprd12.prod.outlook.com (2603:10b6:208:390::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Tue, 8 Oct 2024 07:32:39 +0000 Received: from BL02EPF0001A0FA.namprd03.prod.outlook.com (2603:10b6:408:143:cafe::f) by BN0PR10CA0019.outlook.office365.com (2603:10b6:408:143::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.17 via Frontend Transport; Tue, 8 Oct 2024 07:32:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by BL02EPF0001A0FA.mail.protection.outlook.com (10.167.242.101) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.13 via Frontend Transport; Tue, 8 Oct 2024 07:32:39 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 8 Oct 2024 00:32:29 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 8 Oct 2024 00:32:29 -0700 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 8 Oct 2024 00:32:26 -0700 From: Yonatan Maman To: , , , , , , , , CC: Yonatan Maman , , , Gal Shalom Subject: [PATCH v3 2/2] nouveau/dmem: Fix vulnerability in migrate_to_ram upon copy error Date: Tue, 8 Oct 2024 10:31:03 +0300 Message-ID: <20241008073103.987926-3-ymaman@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241008073103.987926-1-ymaman@nvidia.com> References: <20241008073103.987926-1-ymaman@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A0FA:EE_|BL1PR12MB5777:EE_ X-MS-Office365-Filtering-Correlation-Id: 75b2dba1-1006-4369-ceb6-08dce76b6385 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|36860700013|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?7uzH7+oqiWoir1UN15SS/jkUv3ZwdESkhtxsuG35gBw26FVilOsot9UCjG/+?= =?us-ascii?Q?TEdg8C0w23SklmnFelsAHibZvWh6MSqk649SKPxzjad7OhsVm/0RR8/hQxyj?= =?us-ascii?Q?Gcfp5nUcj9iXByF54ITZ2nWwe4nzE3En5W53QowQYqGunIB7R7tUe3olZp7T?= =?us-ascii?Q?o+rEZUml3ZHHDR5eodBQA1YjEHznpCCpEKsBw7TBv1AlGNFXFNrN+fu6I+xa?= =?us-ascii?Q?4nucAyR06XeAbXFIzXH4H+vRVyY8Uf5xb+xKxQU3vNHUUmYF1KpsvqOKEbKb?= =?us-ascii?Q?qWH/Aczld675T4Zu1u/EW1o/UJ5lDinSIkeMm5JooO0D5pYVLKgQNj/aZo+3?= =?us-ascii?Q?/EGWoGVD+OwHOgcWjn/a90K5QLmsI2Kl2WyTcCx2OdhLjyw4gLauXJ2FoTpY?= =?us-ascii?Q?SzYi36WuGEfQvOYSBHuGh6eq/T04mOWGGMF9031sIYDGWoHn86Gg6HgU6xmo?= =?us-ascii?Q?iMRPWEBi04W1PCcmDh2AaFAPFL3bvG6uUeNOcMB6yLCO6Ya+S/sgsikE1ESL?= =?us-ascii?Q?NJTdVe1Qwl26jGGQvHk85C1Mbmzk3Jyx/2pNKwVWckIYIDzZPR+bo6yzXhHh?= =?us-ascii?Q?38ttlh1NOfyAiisSst3/L7e/MrOiZTJkiyFKj2KvcHsn1dpxF4qWU0ncj9X2?= =?us-ascii?Q?w6aZN/aa568Cd2ci8XijqGH7pF0YHRayahu+bzTZ3bkvXBV9xRPqZAB/9XZ7?= =?us-ascii?Q?Hpg0sly/BcbVM8xwREXW/NlCtWnpj48d3EmxGOxG6dJfbNxJoHrvZP1hUjfp?= =?us-ascii?Q?HZHJvoqQd8UMJl4D/l4GgHYtpNvt6DHEuxP4lb5Yn8yISuyjJDM+gmIeTRHJ?= =?us-ascii?Q?zsG198OkZLqcCcFcSoAwkevUzQxEGinbkwWgOeoYuPXegWfJd9BSviHaiGLZ?= =?us-ascii?Q?3WIv+/NUKpbqsQDkMWCp2Sa4chaKTFTD+h+1j0AIiN6DQn8QgN2avqUFWJmp?= =?us-ascii?Q?itP6DGQAwdTS2qOiS10XuyhFF8uyBS29jgmPBxes2im3jdHFlUIk7CXaSKoI?= =?us-ascii?Q?HV0M1wuXJ9ezo6IJK0dnv7eKVgc//opN9gWV6eEnQ4FMvEdg42p2Jw54bzKT?= =?us-ascii?Q?owGT48nfD45r3JEE5L8kYVWf8YmdrXOaToTawYVJCPUuae4F6LNqWFZeagVd?= =?us-ascii?Q?vQf207I2Ew6s3VOFKa9/KbLETo/XFfjrnCp4hkMvMtvx5OFFEfqtgNXc45Vp?= =?us-ascii?Q?Pv+Y1Y2VPuct79WV/vCX0jPHpiBh1Y43xzecBn+cvq0hhV/Wu0mjfxBWdtyY?= =?us-ascii?Q?2g6Fnyb99l7lVk8e9CXt0BNk/oNcg3NyHdhVZxVr+AREUzjVHmBBiU9BlB2x?= =?us-ascii?Q?iYaXF2dbVBPKh0WOCzB/DeIzi+owB5G6SSAcnVX0ztZuf/0V+Lnbb3DE5pwu?= =?us-ascii?Q?pTe81XwP6se/NH4sU2lnjLZSN51l?= X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230040)(376014)(7416014)(36860700013)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2024 07:32:39.5123 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 75b2dba1-1006-4369-ceb6-08dce76b6385 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0001A0FA.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5777 Content-Type: text/plain; charset="utf-8" From: Yonatan Maman The `nouveau_dmem_copy_one` function ensures that the copy push command is sent to the device firmware but does not track whether it was executed successfully. In the case of a copy error (e.g., firmware or hardware failure), the copy push command will be sent via the firmware channel, and `nouveau_dmem_copy_one` will likely report success, leading to the `migrate_to_ram` function returning a dirty HIGH_USER page to the user. This can result in a security vulnerability, as a HIGH_USER page that may contain sensitive or corrupted data could be returned to the user. To prevent this vulnerability, we allocate a zero page. Thus, in case of an error, a non-dirty (zero) page will be returned to the user. Fixes: 5be73b690875 ("drm/nouveau/dmem: device memory helpers for SVM") Signed-off-by: Yonatan Maman Signed-off-by: Gal Shalom Co-developed-by: Gal Shalom Reviewed-by: Ben Skeggs Cc: stable@vger.kernel.org --- drivers/gpu/drm/nouveau/nouveau_dmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c b/drivers/gpu/drm/nouve= au/nouveau_dmem.c index 6fb65b01d778..097bd3af0719 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dmem.c +++ b/drivers/gpu/drm/nouveau/nouveau_dmem.c @@ -193,7 +193,7 @@ static vm_fault_t nouveau_dmem_migrate_to_ram(struct vm= _fault *vmf) if (!spage || !(src & MIGRATE_PFN_MIGRATE)) goto done; =20 - dpage =3D alloc_page_vma(GFP_HIGHUSER, vmf->vma, vmf->address); + dpage =3D alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vmf->vma, vmf->addres= s); if (!dpage) goto done; =20 --=20 2.34.1