CVE-2025-38274

fpga: fix potential null pointer deref in fpga_mgr_test_img_load_sgt()

State
Published
Severity
Not scored
Published
Jul 10, 2025
Updated
May 11, 2026
Reserved
Apr 16, 2025

Read the record on cve.org

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().

Scores

The record has no CVSS score.

Weaknesses

The record names no weakness.

Affected Products

ProductVersions
LinuxLinux
  • ccbc1c302115d8125d6a96296ba52702c6de0ade to before e69e2cfd8b38d9463a250e153ef4963a604d61e9Affected
  • ccbc1c302115d8125d6a96296ba52702c6de0ade to before 8b2230ac7ff0aeb2441132df638a82ab124f8624Affected
  • ccbc1c302115d8125d6a96296ba52702c6de0ade to before eb4c74eaa6e2d15f3bbd32941c9d2a25b29a718dAffected
  • ccbc1c302115d8125d6a96296ba52702c6de0ade to before 6ebf1982038af12f3588417e4fd0417d2551da28Affected
LinuxLinux
  • 6.6Affected
  • before 6.6Not affected
  • 6.6.94 through 6.6.*Not affected
  • 6.12.34 through 6.12.*Not affected
  • 6.15.3 through 6.15.*Not affected
  • 6.16 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.