Commit 6d745ef
Myron Stowe
scsi: ufs: ufs-qcom: Fix ESI null pointer dereference
JIRA: https://issues.redhat.com/browse/RHEL-120705
Upstream Status: 6300d5c
commit 6300d5c
Author: Nitin Rawat <quic_nitirawa@quicinc.com>
Date: Mon Aug 11 13:03:30 2025 +0530
scsi: ufs: ufs-qcom: Fix ESI null pointer dereference
ESI/MSI is a performance optimization feature that provides dedicated
interrupts per MCQ hardware queue. This is optional feature and UFS MCQ
should work with and without ESI feature.
Commit e46a28c ("scsi: ufs: qcom: Remove the MSI descriptor abuse")
brings a regression in ESI (Enhanced System Interrupt) configuration that
causes a null pointer dereference when Platform MSI allocation fails.
The issue occurs in when platform_device_msi_init_and_alloc_irqs() in
ufs_qcom_config_esi() fails (returns -EINVAL) but the current code uses
__free() macro for automatic cleanup free MSI resources that were never
successfully allocated.
Unable to handle kernel NULL pointer dereference at virtual
address 0000000000000008
Call trace:
mutex_lock+0xc/0x54 (P)
platform_device_msi_free_irqs_all+0x1c/0x40
ufs_qcom_config_esi+0x1d0/0x220 [ufs_qcom]
ufshcd_config_mcq+0x28/0x104
ufshcd_init+0xa3c/0xf40
ufshcd_pltfrm_init+0x504/0x7d4
ufs_qcom_probe+0x20/0x58 [ufs_qcom]
Fix by restructuring the ESI configuration to try MSI allocation first,
before any other resource allocation and instead use explicit cleanup
instead of __free() macro to avoid cleanup of unallocated resources.
Tested on SM8750 platform with MCQ enabled, both with and without
Platform ESI support.
Fixes: e46a28c ("scsi: ufs: qcom: Remove the MSI descriptor abuse")
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com>
Link: https://lore.kernel.org/r/20250811073330.20230-1-quic_nitirawa@quicinc.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Myron Stowe <mstowe@redhat.com>1 parent ef62513 commit 6d745ef
1 file changed
+15
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1782 | 1782 | | |
1783 | 1783 | | |
1784 | 1784 | | |
1785 | | - | |
1786 | | - | |
1787 | | - | |
1788 | | - | |
1789 | | - | |
1790 | | - | |
1791 | | - | |
1792 | | - | |
1793 | | - | |
1794 | | - | |
1795 | | - | |
1796 | 1785 | | |
1797 | 1786 | | |
1798 | 1787 | | |
| |||
1807 | 1796 | | |
1808 | 1797 | | |
1809 | 1798 | | |
1810 | | - | |
1811 | | - | |
1812 | | - | |
1813 | | - | |
1814 | | - | |
1815 | | - | |
1816 | | - | |
1817 | 1799 | | |
1818 | 1800 | | |
1819 | 1801 | | |
1820 | | - | |
1821 | | - | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
1822 | 1811 | | |
1823 | 1812 | | |
1824 | 1813 | | |
| |||
1829 | 1818 | | |
1830 | 1819 | | |
1831 | 1820 | | |
1832 | | - | |
| 1821 | + | |
1833 | 1822 | | |
1834 | | - | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
1835 | 1828 | | |
1836 | 1829 | | |
1837 | 1830 | | |
1838 | 1831 | | |
1839 | | - | |
1840 | | - | |
1841 | 1832 | | |
1842 | 1833 | | |
1843 | 1834 | | |
| |||
0 commit comments