From nobody Sun Dec 14 13:49:28 2025 Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) (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 8BBC6433C8; Thu, 27 Feb 2025 03:26:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.166.238 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740626813; cv=none; b=JOOziXww+4gSJ0/dX4wuu6a5ICv/IIqd7gp1xdE8gkaiMRN+UQZe22sixZC5OJkMXadah75eh9zjw7FsZi8sWlJphH25utdF0Aj0wVrL/nnV7ALL48TK5iyN99Z7nGofNMGVZGEIlWdv76p/9eS3cIlvJRRbi3TATMQ/zBDVbpk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740626813; c=relaxed/simple; bh=kHrgT+eGXWxskQXGY/v3bbTVYXzRBd8UcfF4UWA/gng=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ZUXzgBD++iehnNRsy17KA+77zWw1d3yXQXgrQhuyK+r4GdgdK4Xo9WC3AjvjH8NTa28aZYORkdan/hq1A44N0M6DeezJGSwoKQviGhF5Hm+WsXlYLsyZKyvtHytpbGGTZ+tCh6ZSCBRwHNqU3IxrRL6nVa6IlgBtBp8R6ldrp8I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=windriver.com; spf=pass smtp.mailfrom=windriver.com; arc=none smtp.client-ip=205.220.166.238 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=windriver.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=windriver.com Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 51R3L8oi015977; Wed, 26 Feb 2025 19:26:40 -0800 Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.wrs.com [147.11.82.252]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 451ptmhmej-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 26 Feb 2025 19:26:40 -0800 (PST) Received: from ALA-EXCHNG02.corp.ad.wrs.com (147.11.82.254) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.43; Wed, 26 Feb 2025 19:26:39 -0800 Received: from pek-lpg-core1.wrs.com (147.11.136.210) by ALA-EXCHNG02.corp.ad.wrs.com (147.11.82.254) with Microsoft SMTP Server id 15.1.2507.43 via Frontend Transport; Wed, 26 Feb 2025 19:26:34 -0800 From: To: CC: , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH 6.1.y] drm/amd/display: fixed integer types and null check locations Date: Thu, 27 Feb 2025 11:26:33 +0800 Message-ID: <20250227032633.4176866-1-jianqi.ren.cn@windriver.com> X-Mailer: git-send-email 2.25.1 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-Proofpoint-GUID: aMIR4xxGOCX5NeqdwxXpYEWFVpqL_Trx X-Authority-Analysis: v=2.4 cv=TuEchCXh c=1 sm=1 tr=0 ts=67bfdb70 cx=c_pps a=/ZJR302f846pc/tyiSlYyQ==:117 a=/ZJR302f846pc/tyiSlYyQ==:17 a=T2h4t0Lz3GQA:10 a=zd2uoN0lAAAA:8 a=VwQbUJbxAAAA:8 a=t7CeM3EgAAAA:8 a=fmNT8XcYnNex_eyvA98A:9 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-ORIG-GUID: aMIR4xxGOCX5NeqdwxXpYEWFVpqL_Trx 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=2025-02-27_01,2025-02-26_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 adultscore=0 phishscore=0 spamscore=0 mlxlogscore=999 priorityscore=1501 clxscore=1011 impostorscore=0 malwarescore=0 mlxscore=0 lowpriorityscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.21.0-2502100000 definitions=main-2502270025 Content-Type: text/plain; charset="utf-8" From: Sohaib Nadeem [ Upstream commit 0484e05d048b66d01d1f3c1d2306010bb57d8738 ] [why]: issues fixed: - comparison with wider integer type in loop condition which can cause infinite loops - pointer dereference before null check Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Reviewed-by: Josip Pavic Acked-by: Aurabindo Pillai Signed-off-by: Sohaib Nadeem Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher [ To fix CVE-2024-26767, delete changes made in drivers/gpu/drm/amd/display= /dc/link/link_validation.c for this file is deleted in linux-6.1 ] Signed-off-by: Jianqi Ren Signed-off-by: He Zhe --- Verified the build test. --- .../gpu/drm/amd/display/dc/bios/bios_parser2.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c b/drivers/g= pu/drm/amd/display/dc/bios/bios_parser2.c index 4d2590964a20..75e44d8a7b40 100644 --- a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +++ b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c @@ -1862,19 +1862,21 @@ static enum bp_result get_firmware_info_v3_2( /* Vega12 */ smu_info_v3_2 =3D GET_IMAGE(struct atom_smu_info_v3_2, DATA_TABLES(smu_info)); - DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", smu_in= fo_v3_2->gpuclk_ss_percentage); if (!smu_info_v3_2) return BP_RESULT_BADBIOSTABLE; =20 + DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", smu_in= fo_v3_2->gpuclk_ss_percentage); + info->default_engine_clk =3D smu_info_v3_2->bootup_dcefclk_10khz * 10; } else if (revision.minor =3D=3D 3) { /* Vega20 */ smu_info_v3_3 =3D GET_IMAGE(struct atom_smu_info_v3_3, DATA_TABLES(smu_info)); - DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", smu_in= fo_v3_3->gpuclk_ss_percentage); if (!smu_info_v3_3) return BP_RESULT_BADBIOSTABLE; =20 + DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", smu_in= fo_v3_3->gpuclk_ss_percentage); + info->default_engine_clk =3D smu_info_v3_3->bootup_dcefclk_10khz * 10; } =20 @@ -2439,10 +2441,11 @@ static enum bp_result get_integrated_info_v11( info_v11 =3D GET_IMAGE(struct atom_integrated_system_info_v1_11, DATA_TABLES(integratedsysteminfo)); =20 - DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", info_v1= 1->gpuclk_ss_percentage); if (info_v11 =3D=3D NULL) return BP_RESULT_BADBIOSTABLE; =20 + DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", info_v1= 1->gpuclk_ss_percentage); + info->gpu_cap_info =3D le32_to_cpu(info_v11->gpucapinfo); /* @@ -2654,11 +2657,12 @@ static enum bp_result get_integrated_info_v2_1( =20 info_v2_1 =3D GET_IMAGE(struct atom_integrated_system_info_v2_1, DATA_TABLES(integratedsysteminfo)); - DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", info_v2= _1->gpuclk_ss_percentage); =20 if (info_v2_1 =3D=3D NULL) return BP_RESULT_BADBIOSTABLE; =20 + DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", info_v2= _1->gpuclk_ss_percentage); + info->gpu_cap_info =3D le32_to_cpu(info_v2_1->gpucapinfo); /* @@ -2816,11 +2820,11 @@ static enum bp_result get_integrated_info_v2_2( info_v2_2 =3D GET_IMAGE(struct atom_integrated_system_info_v2_2, DATA_TABLES(integratedsysteminfo)); =20 - DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", info_v2= _2->gpuclk_ss_percentage); - if (info_v2_2 =3D=3D NULL) return BP_RESULT_BADBIOSTABLE; =20 + DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", info_v2= _2->gpuclk_ss_percentage); + info->gpu_cap_info =3D le32_to_cpu(info_v2_2->gpucapinfo); /* --=20 2.25.1