{"id":"CVE-2025-39674","aliases":["CVE-2025-39674"],"related":[],"kind":"vulnerability","state":"published","title":"scsi: ufs: ufs-qcom: Fix ESI null pointer dereference","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: ufs: ufs-qcom: Fix ESI null pointer dereference\n\nESI/MSI is a performance optimization feature that provides dedicated\ninterrupts per MCQ hardware queue. This is optional feature and UFS MCQ\nshould work with and without ESI feature.\n\nCommit e46a28cea29a (\"scsi: ufs: qcom: Remove the MSI descriptor abuse\")\nbrings a regression in ESI (Enhanced System Interrupt) configuration that\ncauses a null pointer dereference when Platform MSI allocation fails.\n\nThe issue occurs in when platform_device_msi_init_and_alloc_irqs() in\nufs_qcom_config_esi() fails (returns -EINVAL) but the current code uses\n__free() macro for automatic cleanup free MSI resources that were never\nsuccessfully allocated.\n\nUnable to handle kernel NULL pointer dereference at virtual\naddress 0000000000000008\n\n  Call trace:\n  mutex_lock+0xc/0x54 (P)\n  platform_device_msi_free_irqs_all+0x1c/0x40\n  ufs_qcom_config_esi+0x1d0/0x220 [ufs_qcom]\n  ufshcd_config_mcq+0x28/0x104\n  ufshcd_init+0xa3c/0xf40\n  ufshcd_pltfrm_init+0x504/0x7d4\n  ufs_qcom_probe+0x20/0x58 [ufs_qcom]\n\nFix by restructuring the ESI configuration to try MSI allocation first,\nbefore any other resource allocation and instead use explicit cleanup\ninstead of __free() macro to avoid cleanup of unallocated resources.\n\nTested on SM8750 platform with MCQ enabled, both with and without\nPlatform ESI support.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: ufs: ufs-qcom: Fix ESI null pointer dereference\n\nESI/MSI is a performance optimization feature that provides dedicated\ninterrupts per MCQ hardware queue. This is optional feature and UFS MCQ\nshould work with and without ESI feature.\n\nCommit e46a28cea29a (\"scsi: ufs: qcom: Remove the MSI descriptor abuse\")\nbrings a regression in ESI (Enhanced System Interrupt) configuration that\ncauses a null pointer dereference when Platform MSI allocation fails.\n\nThe issue occurs in when platform_device_msi_init_and_alloc_irqs() in\nufs_qcom_config_esi() fails (returns -EINVAL) but the current code uses\n__free() macro for automatic cleanup free MSI resources that were never\nsuccessfully allocated.\n\nUnable to handle kernel NULL pointer dereference at virtual\naddress 0000000000000008\n\n  Call trace:\n  mutex_lock+0xc/0x54 (P)\n  platform_device_msi_free_irqs_all+0x1c/0x40\n  ufs_qcom_config_esi+0x1d0/0x220 [ufs_qcom]\n  ufshcd_config_mcq+0x28/0x104\n  ufshcd_init+0xa3c/0xf40\n  ufshcd_pltfrm_init+0x504/0x7d4\n  ufs_qcom_probe+0x20/0x58 [ufs_qcom]\n\nFix by restructuring the ESI configuration to try MSI allocation first,\nbefore any other resource allocation and instead use explicit cleanup\ninstead of __free() macro to avoid cleanup of unallocated resources.\n\nTested on SM8750 platform with MCQ enabled, both with and without\nPlatform ESI support.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nscsi: ufs: ufs-qcom: Corrección de desreferencia de puntero nulo ESI\n\nESI/MSI es una característica de optimización del rendimiento que proporciona interrupciones dedicadas por cola de hardware MCQ. Esta es una característica opcional y UFS MCQ debería funcionar con y sin la característica ESI.\n\nEl commit e46a28cea29a ('scsi: ufs: qcom: Remove the MSI descriptor abuse') introduce una regresión en la configuración de ESI (Enhanced System Interrupt) que causa una desreferencia de puntero nulo cuando falla la asignación de MSI de la plataforma.\n\nEl problema ocurre cuando platform_device_msi_init_and_alloc_irqs() en ufs_qcom_config_esi() falla (devuelve -EINVAL) pero el código actual utiliza la macro __free() para la limpieza automática de recursos MSI libres que nunca fueron asignados con éxito.\n\nNo se puede manejar la desreferencia de puntero NULL del kernel en la dirección virtual 0000000000000008\n\n  Traza de llamada:\n  mutex_lock+0xc/0x54 (P)\n  platform_device_msi_free_irqs_all+0x1c/0x40\n  ufs_qcom_config_esi+0x1d0/0x220 [ufs_qcom]\n  ufshcd_config_mcq+0x28/0x104\n  ufshcd_init+0xa3c/0xf40\n  ufshcd_pltfrm_init+0x504/0x7d4\n  ufs_qcom_probe+0x20/0x58 [ufs_qcom]\n\nSe corrige reestructurando la configuración de ESI para intentar la asignación de MSI primero, antes de cualquier otra asignación de recursos y, en su lugar, usar una limpieza explícita en lugar de la macro __free() para evitar la limpieza de recursos no asignados.\n\nProbado en la plataforma SM8750 con MCQ habilitado, tanto con como sin soporte para ESI de plataforma.","source":"nvd"}],"published":"2025-09-05T17:20:39.859Z","modified":"2026-10-19T21:10:00.160Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-476"],"affected":[{"ranges":[{"type":"git","introduced":"e46a28cea29a0ca7d51c811acccf5d119b40c745","fixed":"aaf17a35a59572c8b29372883619c3dbb0ebb50a","status":"affected"},{"type":"git","introduced":"e46a28cea29a0ca7d51c811acccf5d119b40c745","fixed":"6300d5c5438724c0876828da2f6e2c1a661871fc","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.16","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.16","status":"unaffected"},{"type":"semver","introduced":"6.16.4","lastAffected":"6.16.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.17","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.16","fixed":"6.16.4"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/aaf17a35a59572c8b29372883619c3dbb0ebb50a","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6300d5c5438724c0876828da2f6e2c1a661871fc","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-39674","url":"https://www.cve.org/CVERecord?id=CVE-2025-39674","licence":"CVE Terms of Use","modified":"2026-05-11T21:34:03.499Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-39674","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-39674","licence":"Public domain","modified":"2026-10-19T21:10:00.160Z"}],"updatedAt":"2026-11-25T22:59:04.256Z","epss":{"score":0.00148,"percentile":0.04254,"date":"2026-12-01T12:00:22.000Z"}}