Bug 2404129 (CVE-2025-39998) - CVE-2025-39998 kernel: scsi: target: target_core_configfs: Add length check to avoid buffer overflow
Summary: CVE-2025-39998 kernel: scsi: target: target_core_configfs: Add length check t...
Keywords:
Status: NEW
Alias: CVE-2025-39998
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-10-15 09:02 UTC by OSIDB Bzimport
Modified: 2025-10-15 16:21 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2025-10-15 09:02:13 UTC
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.

Comment 1 Mauro Matteo Cascella 2025-10-15 16:19:56 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2025101529-CVE-2025-39998-57d5@gregkh/T


Note You need to log in before you can comment on or make changes to this bug.