5.5medium
fpga: fix potential null pointer deref in fpga_mgr_test_img_load_sgt()
- Severity
- 5.5medium CVSS:3.1 by NVD
- Exploit likelihood
- 0.19% (higher than 9% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
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().
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from ccbc1c302115d8125d6a96296ba52702c6de0ade before e69e2cfd8b38d9463a250e153ef4963a604d61e9, from ccbc1c302115d8125d6a96296ba52702c6de0ade before 8b2230ac7ff0aeb2441132df638a82ab124f8624, from ccbc1c302115d8125d6a96296ba52702c6de0ade before eb4c74eaa6e2d15f3bbd32941c9d2a25b29a718d, from ccbc1c302115d8125d6a96296ba52702c6de0ade before 6ebf1982038af12f3588417e4fd0417d2551da28, 6.6 Not affected: before 6.6, from 6.6.94 up to 6.6.*, from 6.12.34 up to 6.12.*, from 6.15.3 up to 6.15.*, from 6.16 up to * | CVE List |
| linux linux_kernel | from 6.6 before 6.6.94, from 6.7 before 6.12.34, from 6.13 before 6.15.3 | NVD |
Classification
What each source says
CVE List
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().
NVD (es)
En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: fpga: se corrige una posible desreferencia de puntero nulo en fpga_mgr_test_img_load_sgt(). fpga_mgr_test_img_load_sgt() asigna memoria para sgt mediante kunit_kzalloc(), pero no comprueba si la asignación ha fallado. A continuación, pasa sgt a sg_alloc_table(), que a su vez la pasa a __sg_alloc_table(). Esta función llama a memset() en sgt para intentar ponerlo a cero. Si la asignación falla, sgt será nulo y memset activará una desreferencia de puntero nulo. Solucione esto comprobando la asignación con KUNIT_ASSERT_NOT_ERR_OR_NULL().
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-38274 changed 2026-05-11 | CVE Terms of Use |
| NVD | CVE-2025-38274 changed 2026-06-17 | Public domain |