Cloudanix VulnDB

CVE-2025-39998

None

CVSS

—

EPSS

0.2%

Published

Oct 15, 2025

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A flaw in the Linux kernel's storage target code could let a local user crash the system or gain elevated privileges by using very long names for certain storage objects.

Exploitation
Local Privilege
Attacker needs
Local User
Complexity
Moderate
Impact
Denial Of Service
Component
OS kernel
Class
Buffer Overflow
Remediation
Patch
Effort
Medium
Patch risk
Low

What it actually does

Buffer overflow in target_lu_gp_members_show due to snprintf return value exceeding the 256-byte LU_GROUP_NAME_BUF allocation, leading to unsafe memcpy that can corrupt kernel memory.

Why it matters to the business

Kernel memory corruption on systems using the SCSI target subsystem with long HBA or device names in configfs can cause crashes, denial of service, or potential local privilege escalation affecting storage virtualization and container environments.

How an attack unfolds

An attacker with access to configure SCSI target objects via configfs creates an HBA and device whose combined names plus separators exceed 256 bytes; when the show function is invoked, snprintf reports a length that triggers memcpy beyond the buffer, corrupting adjacent kernel structures.

How to fix it

Update to a kernel containing commit e6eeee5dc0d9221ff96d1b229b1d0222c8871b84 or apply the equivalent SUSE kgraft-patch-SLE12_Update_28 (7-2.1) or later; rebuild and reboot affected systems.

How to confirm the fix worked

Confirm the presence of the length check after snprintf in target_core_configfs.c and verify that LU_GROUP_NAME_BUF usage no longer permits overflow; test with maximum-length HBA/device names.

Typical attack path

  1. Obtain local access or container privileges allowing configfs writes to target_core
  2. Create or rename an HBA group and device group with names whose combined length exceeds the safe limit
  3. Trigger target_lu_gp_members_show (via sysfs read or related operation)
  4. Exploit resulting kernel memory corruption for crash or code execution

How to detect it

Review kernel logs for buffer overflow reports or memcpy warnings triggered during configfs operations on target_core; inspect audit logs for unusual configfs writes creating long HBA or device names.

What your security team should do

  • Prioritize patching kernel packages on all systems exposing the SCSI target subsystem
  • Restrict untrusted local users and containers from writing to /sys/kernel/config/target
  • Monitor for upcoming stable kernel releases and backports from the listed git commit

The record

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.

Affected packages

Ecosystem Package Introduced Fixed
Linux Kernel 0 6.1.156
Linux Kernel 2.6.38 5.4.301
Mageia:9 kernel 0 6.6.116-1.mga9
Mageia:9 kernel-linus 0 6.6.116-1.mga9
Mageia:9 kmod-virtualbox 0 7.1.14-13.mga9
Mageia:9 kmod-xtables-addons 0 3.24-87.mga9
openSUSE:Leap 16.0 dtb-aarch64 0 6.12.0-160000.28.1
openSUSE:Leap 16.0 kernel-64kb 0 6.12.0-160000.28.1
openSUSE:Leap 16.0 kernel-azure 0 6.12.0-160000.28.1
openSUSE:Leap 16.0 kernel-default 0 6.12.0-160000.28.1
openSUSE:Leap 16.0 kernel-default-base 0 6.12.0-160000.27.1.160000.2.8
openSUSE:Leap 16.0 kernel-docs 0 6.12.0-160000.28.1
openSUSE:Leap 16.0 kernel-kvmsmall 0 6.12.0-160000.28.1
openSUSE:Leap 16.0 kernel-obs-build 0 6.12.0-160000.28.1
openSUSE:Leap 16.0 kernel-obs-qa 0 6.12.0-160000.28.1
openSUSE:Leap 16.0 kernel-rt 0 6.12.0-160000.28.1
openSUSE:Leap 16.0 kernel-source 0 6.12.0-160000.28.1
openSUSE:Leap 16.0 kernel-syms 0 6.12.0-160000.28.1
openSUSE:Leap 16.0 kernel-zfcpdump 0 6.12.0-160000.28.1
openSUSE:Tumbleweed kernel-source 0 6.17.5-1.1
openSUSE:Tumbleweed kernel-source-longterm 0 6.18.16-1.1

Related vulnerabilities