CVE-2025-39998
Unknown Unknown - Not Provided
BaseFortify

Publication date: 2025-10-15

Last updated on: 2025-10-29

Assigner: kernel.org

Description
In the Linux kernel, the following vulnerability has been resolved: scsi: target: target_core_configfs: Add length check to avoid buffer overflow A buffer overflow arises from the usage of snprintf to write into the buffer "buf" in target_lu_gp_members_show function located in /drivers/target/target_core_configfs.c. This buffer is allocated with size LU_GROUP_NAME_BUF (256 bytes). snprintf(...) formats multiple strings into buf with the HBA name (hba->hba_group.cg_item), a slash character, a devicename (dev-> dev_group.cg_item) and a newline character, the total formatted string length may exceed the buffer size of 256 bytes. Since snprintf() returns the total number of bytes that would have been written (the length of %s/%sn ), this value may exceed the buffer length (256 bytes) passed to memcpy(), this will ultimately cause function memcpy reporting a buffer overflow error. An additional check of the return value of snprintf() can avoid this buffer overflow.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2025-10-15
Last Modified
2025-10-29
Generated
2026-05-07
AI Q&A
2025-10-15
EPSS Evaluated
2026-05-05
NVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
linux linux_kernel From 5.15.160 (inc) to 5.16 (inc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-UNKNOWN
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

This vulnerability is a buffer overflow in the Linux kernel's SCSI target subsystem, specifically in the target_core_configfs component. It occurs because the function target_lu_gp_members_show uses snprintf to write multiple strings into a fixed-size buffer of 256 bytes without properly checking if the total formatted string length exceeds the buffer size. If the formatted string is longer than 256 bytes, memcpy is called with a length that exceeds the buffer size, causing a buffer overflow error. The issue can be prevented by adding a length check on the return value of snprintf.


How can this vulnerability impact me? :

This buffer overflow vulnerability can potentially lead to memory corruption in the Linux kernel, which may cause system instability, crashes, or could be exploited by an attacker to execute arbitrary code with kernel privileges, leading to a full system compromise.


What immediate steps should I take to mitigate this vulnerability?

The immediate step to mitigate this vulnerability is to update the Linux kernel to a version where the buffer overflow in target_core_configfs (specifically in the target_lu_gp_members_show function) has been fixed by adding a length check after snprintf. This prevents the buffer overflow by ensuring the formatted string does not exceed the allocated buffer size.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart