Repository navigation
Commit c335b49
cxl: Wrap iterations over afu slices inside 'afu_list_lock'
commit edeb304 upstream.
Within cxl module, iteration over array 'adapter->afu' may be racy
at few points as it might be simultaneously read during an EEH and its
contents being set to NULL while driver is being unloaded or unbound
from the adapter. This might result in a NULL pointer to 'struct afu'
being de-referenced during an EEH thereby causing a kernel oops.
This patch fixes this by making sure that all access to the array
'adapter->afu' is wrapped within the context of spin-lock
'adapter->afu_list_lock'.
Fixes: 9e8df8a ("cxl: EEH support")
Cc: stable@vger.kernel.org # v4.3+
Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: Frederic Barrat <fbarrat@linux.ibm.com>
Acked-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 5467498 commit c335b49
2 files changed
Lines changed: 32 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| 270 | + | |
270 | 271 | | |
271 | 272 | | |
272 | 273 | | |
| |||
283 | 284 | | |
284 | 285 | | |
285 | 286 | | |
| 287 | + | |
286 | 288 | | |
287 | 289 | | |
288 | 290 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1807 | 1807 | | |
1808 | 1808 | | |
1809 | 1809 | | |
1810 | | - | |
| 1810 | + | |
1811 | 1811 | | |
1812 | 1812 | | |
1813 | 1813 | | |
| |||
1834 | 1834 | | |
1835 | 1835 | | |
1836 | 1836 | | |
1837 | | - | |
| 1837 | + | |
| 1838 | + | |
1838 | 1839 | | |
1839 | 1840 | | |
1840 | 1841 | | |
| |||
1845 | 1846 | | |
1846 | 1847 | | |
1847 | 1848 | | |
| 1849 | + | |
1848 | 1850 | | |
1849 | 1851 | | |
1850 | 1852 | | |
| |||
1853 | 1855 | | |
1854 | 1856 | | |
1855 | 1857 | | |
| 1858 | + | |
1856 | 1859 | | |
1857 | 1860 | | |
1858 | 1861 | | |
| |||
1934 | 1937 | | |
1935 | 1938 | | |
1936 | 1939 | | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
1937 | 1944 | | |
1938 | 1945 | | |
1939 | 1946 | | |
1940 | | - | |
| 1947 | + | |
| 1948 | + | |
1941 | 1949 | | |
| 1950 | + | |
1942 | 1951 | | |
1943 | 1952 | | |
1944 | 1953 | | |
| |||
1950 | 1959 | | |
1951 | 1960 | | |
1952 | 1961 | | |
| 1962 | + | |
1953 | 1963 | | |
1954 | 1964 | | |
1955 | 1965 | | |
| |||
1982 | 1992 | | |
1983 | 1993 | | |
1984 | 1994 | | |
| 1995 | + | |
1985 | 1996 | | |
1986 | 1997 | | |
1987 | 1998 | | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
1988 | 2002 | | |
1989 | | - | |
| 2003 | + | |
1990 | 2004 | | |
1991 | 2005 | | |
1992 | | - | |
| 2006 | + | |
1993 | 2007 | | |
1994 | 2008 | | |
1995 | 2009 | | |
| |||
2001 | 2015 | | |
2002 | 2016 | | |
2003 | 2017 | | |
2004 | | - | |
| 2018 | + | |
2005 | 2019 | | |
2006 | 2020 | | |
2007 | 2021 | | |
2008 | | - | |
| 2022 | + | |
2009 | 2023 | | |
2010 | 2024 | | |
2011 | 2025 | | |
2012 | 2026 | | |
2013 | | - | |
| 2027 | + | |
2014 | 2028 | | |
2015 | 2029 | | |
2016 | 2030 | | |
| |||
2031 | 2045 | | |
2032 | 2046 | | |
2033 | 2047 | | |
| 2048 | + | |
| 2049 | + | |
2034 | 2050 | | |
2035 | 2051 | | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
2036 | 2055 | | |
2037 | 2056 | | |
2038 | 2057 | | |
| |||
2053 | 2072 | | |
2054 | 2073 | | |
2055 | 2074 | | |
| 2075 | + | |
2056 | 2076 | | |
2057 | 2077 | | |
2058 | 2078 | | |
2059 | | - | |
| 2079 | + | |
2060 | 2080 | | |
2061 | 2081 | | |
2062 | 2082 | | |
| |||
2065 | 2085 | | |
2066 | 2086 | | |
2067 | 2087 | | |
| 2088 | + | |
2068 | 2089 | | |
2069 | 2090 | | |
2070 | 2091 | | |
| |||
0 commit comments