drm/amdgpu: Validate TA binary size
Subsystems (2)
PATCH 1/1 drm/amdgpu: Validate TA binary size
Add TA binary size validation to avoid OOB write.
Signed-off-by Candice Li <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c +3 -0
@@ -166,6 +166,9 @@ static ssize_t ta_if_load_debugfs_write(struct file *fp, const char *buf, size_tif (ret)return -EFAULT ; +if (ta_bin_len >PSP_1_MEG ) +return -EINVAL ; + copy_pos +=sizeof (uint32_t ); ta_bin =kzalloc (ta_bin_len,GFP_KERNEL );
Signature · 1 line
2.25.1
[AMD Official Use Only - AMD Internal Distribution Only]
Reviewed-by Hawking Zhang <[email protected]>
Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Candice Li
Sent: Thursday, August 15, 2024 15:06
To: [email protected]
Cc: Li, Candice <[email protected]>
Subject: [PATCH] drm/amdgpu: Validate TA binary size
Add TA binary size validation to avoid OOB write.
Signed-off-by Candice Li <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c +3 -0
@@ -166,6 +166,9 @@ static ssize_t ta_if_load_debugfs_write(struct file *fp, const char *buf, size_tif (ret)return -EFAULT ; +if (ta_bin_len >PSP_1_MEG ) +return -EINVAL ; + copy_pos +=sizeof (uint32_t ); ta_bin =kzalloc (ta_bin_len,GFP_KERNEL );
--
2.25.1