Commit de5793b3 authored by Ma Jun's avatar Ma Jun Committed by Ye Bin
Browse files

drm/amdgpu: Fix the null pointer dereference to ras_manager

stable inclusion
from stable-v5.10.224
commit d81c1eeb333d84b3012a91c0500189dc1d71e46c
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAMM8O
CVE: CVE-2024-43908

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d81c1eeb333d84b3012a91c0500189dc1d71e46c



--------------------------------

[ Upstream commit 4c11d30c95576937c6c35e6f29884761f2dddb43 ]

Check ras_manager before using it

Signed-off-by: default avatarMa Jun <Jun.Ma2@amd.com>
Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYe Bin <yebin10@huawei.com>
parent 3e3bb79c
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1348,12 +1348,15 @@ static void amdgpu_ras_interrupt_process_handler(struct work_struct *work)
int amdgpu_ras_interrupt_dispatch(struct amdgpu_device *adev,
		struct ras_dispatch_if *info)
{
	struct ras_manager *obj = amdgpu_ras_find_obj(adev, &info->head);
	struct ras_ih_data *data = &obj->ih_data;
	struct ras_manager *obj;
	struct ras_ih_data *data;

	obj = amdgpu_ras_find_obj(adev, &info->head);
	if (!obj)
		return -EINVAL;

	data = &obj->ih_data;

	if (data->inuse == 0)
		return 0;