CVE-2025-38274 fpga: fix potential null pointer deref in fpga_mgr_test_img_load_sgt()

Medium 5.5 Published Updated

A missing null check in the Linux kernel FPGA manager test function can cause a null pointer dereference, leading to a denial of service.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-38274?

CVE-2025-38274 is a medium-severity vulnerability in Linux kernel, published on 10 Jul 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

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

fpga: fix potential null pointer deref in fpga_mgr_test_img_load_sgt()

fpga_mgr_test_img_load_sgt() allocates memory for sgt using kunit_kzalloc() however it does not check if the allocation failed. It then passes sgt to sg_alloc_table(), which passes it to __sg_alloc_table(). This function calls memset() on sgt in an attempt to zero it out. If the allocation fails then sgt will be NULL and the memset will trigger a NULL pointer dereference.

Fix this by checking the allocation with KUNIT_ASSERT_NOT_ERR_OR_NULL().

Weakness: CWE-476

Which versions are affected by CVE-2025-38274?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2025-38274?

Apply the vendor's patch.

Is CVE-2025-38274 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as AZL-64884, BELL-CVE-2025-38274, DEBIAN-CVE-2025-38274, GHSA-7p7v-h84h-xmw3, ROOT-OS-UBUNTU-2404-CVE-2025-38274, UBUNTU-CVE-2025-38274.

Is CVE-2025-38274 in your software?

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

Check your SBOMs for free