drm/amdgpu: fix possible UAF in amdgpu_cs_pass1()
Subsystems (2)
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: fix possible UAF in amdgpu_cs_pass1()
Since the gang_size check is outside of chunk parsing loop, we need to reset i before we free the chunk data.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +1 -1
@@ -295,7 +295,7 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p,if (!p->gang_size) { ret = -EINVAL ; - goto free_partial_kdata; + goto free_all_kdata; }for (i =0 ; i < p->gang_size; ++i) {
Signature · 1 line
2.41.0
[Public]
Quoted 8 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Friday, July 28, 2023 11:23 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH] drm/amdgpu: fix possible UAF inamdgpu_cs_pass1()
Quoted 4 lines
Since the
gang_sizecheck is outside of chunk parsing loop, we need to reset i before we free the chunk data.Signed-off-by Alex Deucher <[email protected]>
Regards,
Guchun
Quoted 21 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +1
-1@@ -295,7 +295,7 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p, if (!p->gang_size) { ret = -EINVAL ; - goto free_partial_kdata; + goto free_all_kdata; }for (i = 0; i < p->gang_size; ++i) {--
2.41.0
Am 31.07.23 um 03:41 schrieb Chen, Guchun:
Quoted 10 lines
[Public]
Quoted 8 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Friday, July 28, 2023 11:23 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH] drm/amdgpu: fix possible UAF inamdgpu_cs_pass1()
Quoted 5 lines
Quoted 4 lines
Since the
gang_sizecheck is outside of chunk parsing loop, we need to reset i before we free the chunk data.Signed-off-by Alex Deucher <[email protected]>Reviewed-by Guchun Chen <[email protected]>
Might have already been landed, but the patch is Reviewed-by: Christian König <[email protected]>
Regards,
Christian.
Quoted 25 lines
Regards,
GuchunQuoted 21 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +1
-1@@ -295,7 +295,7 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p, if (!p->gang_size) { ret = -EINVAL ; - goto free_partial_kdata; + goto free_all_kdata; }for (i = 0; i < p->gang_size; ++i) {--
2.41.0