drm/msm/a6xx: fix a potential overflow issue
Subsystems (4)
PATCH 1/1 drm/msm/a6xx: fix a potential overflow issue
It's allocating an array of a6xx_gpu_state_obj structure rathor than its pointers.
This patch fix it.
Signed-off-by Zhenzhong Duan <[email protected]>
--- drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c +1 -1
@@ -875,7 +875,7 @@ static void a6xx_get_indexed_registers(struct msm_gpu *gpu,int i; a6xx_state->indexed_regs =state_kcalloc (a6xx_state, count, -sizeof (a6xx_state->indexed_regs)); +sizeof (*a6xx_state->indexed_regs));if (!a6xx_state->indexed_regs)return ;
Signature · 1 line
1.8.3.1
Quoted 6 lines · Zhenzhong Duan
It's allocating an array of
a6xx_gpu_state_objstructure rathor than its pointers.This patch fix it.
Signed-off-by Zhenzhong Duan <[email protected]>
LGTM but should have a Fixes: tag for the stable trees
Fixes d6852b4b2d01 ("drm/msm/a6xx: Track and manage a6xx state memory")
Reviewed-by Jordan Crouse <[email protected]>
Quoted 20 lines
--- drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c +1
-1@@ -875,7 +875,7 @@ static void a6xx_get_indexed_registers(struct msm_gpu *gpu,int i; a6xx_state->indexed_regs =state_kcalloc (a6xx_state, count, -sizeof (a6xx_state->indexed_regs)); +sizeof (*a6xx_state->indexed_regs));if (!a6xx_state->indexed_regs)return ;Signature · 1 line
1.8.3.1
Signature · 6 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 5 lines · Jordan Crouse
Quoted 3 lines · Zhenzhong Duan
It's allocating an array of
a6xx_gpu_state_objstructure rathor than its pointers.
Quoted 8 lines
Quoted 3 lines
This patch fix it.
Signed-off-by Zhenzhong Duan <[email protected]>LGTM but should have a Fixes: tag for the stable trees
Fixes d6852b4b2d01 ("drm/msm/a6xx: Track and manage a6xx state memory")Reviewed-by Jordan Crouse <[email protected]>
I had sent a v2 version with same change as you suggested on Sep 14, could you help review it? Thanks
https://lkml.org/lkml/2020/9/13/311
Quoted 5 lines · Zhenzhong Duan
It's allocating an array of
a6xx_gpu_state_objstructure rathor than its pointers.This patch fix it.
Reviewed-by Bjorn Andersson <[email protected]>
Quoted 21 lines
Signed-off-by Zhenzhong Duan <[email protected]>--- drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c +1
-1@@ -875,7 +875,7 @@ static void a6xx_get_indexed_registers(struct msm_gpu *gpu,int i; a6xx_state->indexed_regs =state_kcalloc (a6xx_state, count, -sizeof (a6xx_state->indexed_regs)); +sizeof (*a6xx_state->indexed_regs));if (!a6xx_state->indexed_regs)return ;Signature · 1 line
1.8.3.1