CVE-2025-38399 scsi: target: Fix NULL pointer dereference in core_scsi3_decode_spec_i_port()

High 7.5 Published Updated

A NULL pointer dereference in the Linux kernel SCSI target module allows attackers to cause a system crash via crafted SCSI commands.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-38399?

CVE-2025-38399 is a high-severity vulnerability in Debian Debian Linux, published on 25 Jul 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

In the Linux kernel, the following vulnerability has been resolved:

scsi: target: Fix NULL pointer dereference in core_scsi3_decode_spec_i_port()

The function core_scsi3_decode_spec_i_port(), in its error code path, unconditionally calls core_scsi3_lunacl_undepend_item() passing the dest_se_deve pointer, which may be NULL.

This can lead to a NULL pointer dereference if dest_se_deve remains unset.

SPC-3 PR SPEC_I_PT: Unable to locate dest_tpg Unable to handle kernel paging request at virtual address dfff800000000012 Call trace: core_scsi3_lunacl_undepend_item+0x2c/0xf0 [target_core_mod] (P) core_scsi3_decode_spec_i_port+0x120c/0x1c30 [target_core_mod] core_scsi3_emulate_pro_register+0x6b8/0xcd8 [target_core_mod] target_scsi3_emulate_pr_out+0x56c/0x840 [target_core_mod]

Fix this by adding a NULL check before calling core_scsi3_lunacl_undepend_item()

Weakness: CWE-476

Which versions are affected by CVE-2025-38399?

It affects 2 products.

Products include Debian Debian Linux, Linux kernel.

How do I fix CVE-2025-38399?

Apply the vendor's patch.

Is CVE-2025-38399 being exploited?

There is no known exploitation of CVE-2025-38399 in the wild and no public exploit code.

All Debian Debian Linux vulnerabilities

Sources

Also known as AZL-65720, AZL-73016, BELL-CVE-2025-38399, DEBIAN-CVE-2025-38399, GHSA-73j2-c6c6-cr45, ROOT-OS-DEBIAN-11-CVE-2025-38399 and 4 more.

Is CVE-2025-38399 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free