Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2024-39291— drm/amdgpu: Fix buffer size in gfx_v9_4_3_init_ cp_compute_microcode() and rlc_microcode()

Quick assessment

Affected
Linux Linux
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于gfx_v9_4_3_init_ cp_compute_microcode() 和 rlc_microcode() 中的缓冲区大小不足以容纳最大长度字符串,从而导致潜在的缓冲区溢出和截断问题。

AI Predicted 5.5 Difficulty: Trivial EPSS 0.24% · P15

Possible ATT&CK Techniques 1 AI

T1059 · Command and Scripting Interpreter

Affected Version Matrix 8

VendorProduct Version RangeStatus
Linux Linux 86301129698be52f8398f92ea8564168f6bfcae1< 19bd9537b6bc1c882df25206c15917214d8e9460 affected
86301129698be52f8398f92ea8564168f6bfcae1< f1b6a016dfa45cedc080d36fa5d6f22237d80e8b affected
86301129698be52f8398f92ea8564168f6bfcae1< acce6479e30f73ab0872e93a75aed1fb791d04ec affected
6.5 affected
< 6.5 unaffected
6.6.33≤ 6.6.* unaffected
6.9.4≤ 6.9.* unaffected
6.10≤ * unaffected
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2024-39291

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
drm/amdgpu: Fix buffer size in gfx_v9_4_3_init_ cp_compute_microcode() and rlc_microcode()
Source: CVE Program / CVE List V5
Vulnerability Description
In the Linux kernel, the following vulnerability has been resolved: drm/amdgpu: Fix buffer size in gfx_v9_4_3_init_ cp_compute_microcode() and rlc_microcode() The function gfx_v9_4_3_init_microcode in gfx_v9_4_3.c was generating about potential truncation of output when using the snprintf function. The issue was due to the size of the buffer 'ucode_prefix' being too small to accommodate the maximum possible length of the string being written into it. The string being written is "amdgpu/%s_mec.bin" or "amdgpu/%s_rlc.bin", where %s is replaced by the value of 'chip_name'. The length of this string without the %s is 16 characters. The warning message indicated that 'chip_name' could be up to 29 characters long, resulting in a total of 45 characters, which exceeds the buffer size of 30 characters. To resolve this issue, the size of the 'ucode_prefix' buffer has been reduced from 30 to 15. This ensures that the maximum possible length of the string being written into the buffer will not exceed its size, thus preventing potential buffer overflow and truncation issues. Fixes the below with gcc W=1: drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c: In function ‘gfx_v9_4_3_early_init’: drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:379:52: warning: ‘%s’ directive output may be truncated writing up to 29 bytes into a region of size 23 [-Wformat-truncation=] 379 | snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_rlc.bin", chip_name); | ^~ ...... 439 | r = gfx_v9_4_3_init_rlc_microcode(adev, ucode_prefix); | ~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:379:9: note: ‘snprintf’ output between 16 and 45 bytes into a destination of size 30 379 | snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_rlc.bin", chip_name); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:413:52: warning: ‘%s’ directive output may be truncated writing up to 29 bytes into a region of size 23 [-Wformat-truncation=] 413 | snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec.bin", chip_name); | ^~ ...... 443 | r = gfx_v9_4_3_init_cp_compute_microcode(adev, ucode_prefix); | ~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:413:9: note: ‘snprintf’ output between 16 and 45 bytes into a destination of size 30 413 | snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec.bin", chip_name); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Source: CVE Program / CVE List V5
CVSS Information
N/A
Source: CVE Program / CVE List V5
Vulnerability Type
N/A
Source: CVE Program / CVE List V5
Vulnerability Title
Linux kernel 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于gfx_v9_4_3_init_ cp_compute_microcode() 和 rlc_microcode() 中的缓冲区大小不足以容纳最大长度字符串,从而导致潜在的缓冲区溢出和截断问题。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

Vendor Product Affected Versions CPE Subscribe
Linux Linux 86301129698be52f8398f92ea8564168f6bfcae1 ~ 19bd9537b6bc1c882df25206c15917214d8e9460 -
Linux Linux 6.5 -

II. Public POCs for CVE-2024-39291

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2024-39291

请登录查看更多情报信息。

Other References for CVE-2024-39291 (3)

Same Patch Batch · Linux · 2024-06-24 · 14 CVEs total

CVE-2024-38384 7.8 HIGH blk-cgroup: fix list corruption from reorder of WRITE ->lqueued
CVE-2024-38663 7.8 HIGH blk-cgroup: fix list corruption from resetting io stat
CVE-2024-39292 7.8 HIGH um: Add winch to winch_handlers before registering winch IRQ
CVE-2024-32936 7.8 HIGH media: ti: j721e-csi2rx: Fix races while restarting DMA
CVE-2024-34027 7.8 HIGH f2fs: compress: fix to cover {reserve,release}_compress_blocks() w/ cp_rwsem lock
CVE-2024-33847 7.1 HIGH f2fs: compress: don't allow unaligned truncation on released compress inode
CVE-2024-38664 drm: zynqmp_dpsub: Always register bridge
CVE-2024-38667 riscv: prevent pt_regs corruption for secondary idle threads
CVE-2024-34030 PCI: of_property: Return error for int_map allocation failure
CVE-2024-35247 fpga: region: add owner module and take its refcount
CVE-2024-36479 fpga: bridge: add owner module and take its refcount
CVE-2024-37021 fpga: manager: add owner module and take its refcount
CVE-2024-37026 drm/xe: Only use reserved BCS instances for usm migrate exec queue

IV. Related Vulnerabilities

V. Comments for CVE-2024-39291

No comments yet


Leave a comment