Commit a5eab4f
CIQ Kernel Automation
drm/amdgpu: Fix potential out-of-bounds access in 'amdgpu_discovery_reg_base_init()'
jira VULN-37713
cve CVE-2024-27042
commit-author Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
commit cdb637d
The issue arises when the array 'adev->vcn.vcn_config' is accessed
before checking if the index 'adev->vcn.num_vcn_inst' is within the
bounds of the array.
The fix involves moving the bounds check before the array access. This
ensures that 'adev->vcn.num_vcn_inst' is within the bounds of the array
before it is used as an index.
Fixes the below:
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1289 amdgpu_discovery_reg_base_init() error: testing array offset 'adev->vcn.num_vcn_inst' after use.
Fixes: a0ccc71 ("drm/amdgpu/discovery: validate VCN and SDMA instances")
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit cdb637d)
Signed-off-by: CIQ Kernel Automation <ciq_kernel_automation@ciq.com>1 parent b4eb8c8 commit a5eab4f
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1270 | 1270 | | |
1271 | 1271 | | |
1272 | 1272 | | |
1273 | | - | |
1274 | | - | |
1275 | | - | |
1276 | 1273 | | |
1277 | 1274 | | |
| 1275 | + | |
| 1276 | + | |
1278 | 1277 | | |
1279 | 1278 | | |
1280 | 1279 | | |
| |||
1285 | 1284 | | |
1286 | 1285 | | |
1287 | 1286 | | |
| 1287 | + | |
1288 | 1288 | | |
1289 | 1289 | | |
1290 | 1290 | | |
| |||
0 commit comments