Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC4CE606A33E for ; Mon, 30 Nov 2026 17:19:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=MyX/vnTK Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 60A4810E956; Mon, 30 Nov 2026 17:19:23 +0000 (UTC) Received: from CH4PR04CU002.outbound.protection.outlook.com (mail-northcentralusazon11013045.outbound.protection.outlook.com [40.107.201.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id C8AB310E90F for ; Mon, 30 Nov 2026 17:19:16 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FWxEQ1mfVfl0Ys6fr0azxeq8ykAK60+bmZrGgm0u1HMFMziAg4bNS8i9HJjl3V4iTlgK4LNerxeDvIUX9LAYq/tOc8VqPjbkKGvj440p7DY3J7Ru2mnrZjJn3JJwG19SHcq5VNtdFic2w2940fJRsq82ck6bUO3Ty6esNJ/xsStejvBikRn1UReDHPcHoWDVv++DGeDH0i2arAYzG32N16nb2ZGm30NyMXA+N5AGxl3pUXV52g1jPqLIMok4PLM+R1DeTMAIqmrsqvV8PFzoBd9351vShoyfki9/nbDCUr+Yk9qUwkQKTmiryBdrKjpmxPQn9XN8odUapHG2yCS6pg== 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=81c5ueK13xW3r73OeKU2bwUGO0vTU84WWzT6gKpM05A=; b=ZCceKIBrM3eNj5zFiGwIVScH9q4R/oGhkc1dQmYVRiYvTDTPkJgRTT5pdvh8k0yuELRMDcpKqumNmWM9S6tKO1E6i+JculW/Y+kHy3u6m+WcJUJ1dL8puAyzA/4kpejAArG73GwirsnwE2iS+rf+ixLEF7gybDQsr9QDg2EIhmD9DKf2r5FwfFi/RG/YeYmwsLVQZzYqMEEKAswGVdmZC/5iEL+rbX5MCpDurPjxabwDvIVPSfEP+0o8YHnPkmfurZXshmiy3zGwlYATp5medt6uiovYuCYJNsaxReuxi1jy3htpJBSSdj6xW0Tp8mQQDbx3FPVX2rh6xYyPjNOb7Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=81c5ueK13xW3r73OeKU2bwUGO0vTU84WWzT6gKpM05A=; b=MyX/vnTK/aQcebTSaV8IhJvVUWYKHX8IdEfsB+iSlldSFG9hM+axkn9EHWfB9zvNALTvKQ4miaUFeonCVpe6bdxzyGMqCvxobVQl9wJNP6JqSeSAaUZ9l2z/iAGZ1ngqbgqmEef9Wa9lKgKfx1p5fC/AL/S36a3uuL0wrNFClSM= Received: from DS1P223CA0025.NAMP223.PROD.OUTLOOK.COM (2603:10b6:8:44e::14) by PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.12; Mon, 30 Nov 2026 17:19:11 +0000 Received: from DM3PEPF000265B8.namprd04.prod.outlook.com (2603:10b6:8:44e:cafe::74) by DS1P223CA0025.outlook.office365.com (2603:10b6:8:44e::14) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.662.13 via Frontend Transport; Mon, 30 Nov 2026 17:19:11 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by DM3PEPF000265B8.mail.protection.outlook.com (10.167.23.245) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Mon, 30 Nov 2026 17:19:11 +0000 Received: from mukjoshi-dev.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Mon, 30 Nov 2026 11:19:07 -0600 From: Mukul Joshi To: CC: , , , Mukul Joshi , Sashiko-bot Subject: [PATCH] drm/amdgpu: reject errored peers in UALink local vPod integrity check Date: Mon, 30 Nov 2026 12:18:28 -0500 Message-ID: <20261130171854.489910-2-mukul.joshi@amd.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261130171854.489910-1-mukul.joshi@amd.com> References: <20261130171854.489910-1-mukul.joshi@amd.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM3PEPF000265B8:EE_|PH7PR12MB5685:EE_ X-MS-Office365-Filtering-Correlation-Id: a204881b-4b71-42d7-51ab-08df4f060cab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|376014|36860700016|1800799024|23010399003|11063799006|261009223027099003|18002099003|22082099003|10067099003|56012099006|261102123227099003|261028144727099003|261026140227099003|261021121427099003|261022105027099003; X-Microsoft-Antispam-Message-Info: m1DOIcBrt1Na25w33q77CUk73PufrRB2MdPzPtxoe2oVMnOYmxw8+mDq0Z/ku9xy2IM/q8z+4UQBAFdPao11ZF13uAO/kKNP8WTWaGScavzmaop3KUjLzqCefAwEx1BMYuaNdihCOwyIJ0LIQl/aEBI16FRRpVDh5BuEcukRsOtBBP9BeWfP63Bf4gHTzP64tVuiZ5+eTcLxTWKCu1u6iraoRqpqsf/2x/wkTbY0uuantSr8nUUEE+lmOrb3kEE+ukcutakHK2WbWpilpkpLviEeViJn919GGBu20+FEWZptKjsu77d7INwWcklWlR4qIfqWrMUhYmjbyvl2vw7LOpRTEmqhi9eq8mxyIMwKLzv0oIZiSha8pCqhLOhZqC4x9Pyejnl/VNi1XgLz7waJPMXt9iJm/IjMBi7lWF4hbcCh7xUC14JIiZM5yrASfKqJlce5kXhkaMTj4Ds/8+CGXoT14lKPdkWAsUgVLh3oQivjk48sYBZUxSlUBgzvxVQN9yFTE+K1E0k0Wo77v0Y81KMDyeJbyMqGVH6t+TXS3ALEWA6wybKz9uH/vhglfwXWvtBEY3YqXxv9ZUYnDYGj81+lXWkVTxZjZIiUS/oJT/ExAyNwqkK2ucqEvqvpbKzlFSV5P1k6XPPkz7oglaOIX1LaOeWi2Q1PHHT1L+o+bRGxUdyMGPTEx06uXfUlcsqazwK5EAjOTzYN6+295wC3ew== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:satlexmb07.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(376014)(36860700016)(1800799024)(23010399003)(11063799006)(261009223027099003)(18002099003)(22082099003)(10067099003)(56012099006)(261102123227099003)(261028144727099003)(261026140227099003)(261021121427099003)(261022105027099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZVeyx/t8uNyCziPCKWy7hIP7v16MOJdFn3wwEZxZlyUVsrYHl07dEVFBU3e6hlQklIJDIwN7juAbjB0paBlVnX4fy+7twRmThhDEYAIAJlRoUxqxhoaDxg/ZDA1byklIeTlNcy0RHFxSwGiiFMaqRyMeaCN0aKrXso6ivMGq1IRe7ogvtHa/Yb/QVzKDc4Ws7SZzQArbIaX+3iUrM2alND7gfhAyG/uR/BH6P6RPnIQJS12dyUN1KFS8LKhQdrIWrXr+dh5imORegKRWd7wtsBA04NfCOEXPzOtUf7mflI2PdeIBcqLutbiWEylyYRFC9QN+XyjsOfSgBxXwe5haMqVc7olvRg5iimBbDydrnADZsEVgpxHhPcabefHCeOBgu/t1MbcJ7lOwr0lWr2omr2FJlNNr4BYtyUydzyzxz50oTDH14irMLlsHvN+z/PYU X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2026 17:19:11.0303 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a204881b-4b71-42d7-51ab-08df4f060cab X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM3PEPF000265B8.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5685 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "amd-gfx" X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 AMDGPU_UALINK_ACCEL_STATE_ERROR sorts above every configured state, so a local peer in the error state passes both the "pPod configured" and "vPod configured" checks in __check_local_vpod_integrity() and is treated as a healthy vPod member. The local vPod is then activated around an accelerator that cannot participate. The error state is also entered when pPod validation fails, in which case the peer's accel_id is unvalidated firmware data and is used to index vpod.active_accel_bits without a bounds check. Handle errored peers explicitly: range-check the accel_id before use, fail the integrity check if the peer is a member of this vPod, and skip it otherwise. Fixes: 448a35158bee ("drm/amdgpu: Assign accel state based on ASP config") Reported-by: Sashiko-bot Signed-off-by: Mukul Joshi --- drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c index 0982d8455b0c..1a169884bd40 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c @@ -1180,6 +1180,17 @@ static int __check_local_vpod_integrity(struct amdgpu_device *adev) } accel_id = peer_info->ppod.accel_id; + /* An errored peer's accel_id may have failed validation. */ + if (peer_info->accel_state == AMDGPU_UALINK_ACCEL_STATE_ERROR) { + if (accel_id < AMDGPU_UALINK_ACCEL_MAX && + test_bit(accel_id, info->vpod.active_accel_bits)) { + dev_warn(adev->dev, + "UALINK: integrity fail: vpod peer accel_id=%u is in error state\n", + accel_id); + return -EINVAL; + } + continue; + } if (!test_bit(accel_id, info->vpod.active_accel_bits)) continue; /* peer device vpod not configured */ -- 2.56.0