fpga: fix potential null pointer deref in fpga_mgr_test_img_load_sgt()
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().
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 6.12.34, 6.15.3, 6.6.94
- CVEs
- CVE-2025-38274
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 3 Nov 2026, 16:31 UTC · Revision 1
Source evidence
fpga: fix potential null pointer deref in fpga_mgr_test_img_load_sgt()
core-osv · Original sourcePublished 10 Jul 2025, 07:41 UTC
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().
osv:CVE-2025-38274
Kernel
Fixed versions: 6.6.94, 6.12.34, 6.15.3
Complete source record
{
"id": "5b1336b1fe90cabb302f32717e9866948b5be563f1f681e5e430fb073792ce61",
"url": "https://osv.dev/vulnerability/CVE-2025-38274",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "fpga: fix potential null pointer deref in fpga_mgr_test_img_load_sgt()",
"summary": "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().",
"evidence": "osv:CVE-2025-38274",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "6.6.94",
"evidence": "/affected/1/ranges"
},
{
"value": "6.12.34",
"evidence": "/affected/1/ranges"
},
{
"value": "6.15.3",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "CVE-2025-38274",
"aliases": [
"CVE-2025-38274"
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "ccbc1c302115d8125d6a96296ba52702c6de0ade"
},
{
"fixed": "e69e2cfd8b38d9463a250e153ef4963a604d61e9"
},
{
"fixed": "8b2230ac7ff0aeb2441132df638a82ab124f8624"
},
{
"fixed": "eb4c74eaa6e2d15f3bbd32941c9d2a25b29a718d"
},
{
"fixed": "6ebf1982038af12f3588417e4fd0417d2551da28"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-38274.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.6.0"
},
{
"fixed": "6.6.94"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.7.0"
},
{
"fixed": "6.12.34"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.13.0"
},
{
"fixed": "6.15.3"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-38274.json"
}
}
],
"modified": "2026-10-28T02:30:30.788700932Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/6ebf1982038af12f3588417e4fd0417d2551da28",
"https://git.kernel.org/stable/c/8b2230ac7ff0aeb2441132df638a82ab124f8624",
"https://git.kernel.org/stable/c/e69e2cfd8b38d9463a250e153ef4963a604d61e9",
"https://git.kernel.org/stable/c/eb4c74eaa6e2d15f3bbd32941c9d2a25b29a718d",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38274.json",
"https://nvd.nist.gov/vuln/detail/CVE-2025-38274",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38274.json"
}
},
"related_cves": [
{
"value": "CVE-2025-38274",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 497417,
"published_at": "2025-07-10T07:41:55.041+00:00"
}