Commit ec27386
usb: typec: class: Fix NULL pointer access
Concurrent calls to typec_partner_unlink_device can lead to a NULL pointer
dereference. This patch adds a mutex to protect USB device pointers and
prevent this issue. The same mutex protects both the device pointers and
the partner device registration.
Cc: stable@vger.kernel.org
Fixes: 59de2a5 ("usb: typec: Link enumerated USB devices with Type-C partner")
Signed-off-by: Andrei Kuchynski <akuchynski@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20250321143728.4092417-2-akuchynski@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent bea5892 commit ec27386
2 files changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1052 | 1052 | | |
1053 | 1053 | | |
1054 | 1054 | | |
| 1055 | + | |
1055 | 1056 | | |
1056 | 1057 | | |
1057 | 1058 | | |
| |||
1063 | 1064 | | |
1064 | 1065 | | |
1065 | 1066 | | |
| 1067 | + | |
1066 | 1068 | | |
1067 | 1069 | | |
1068 | 1070 | | |
| |||
1083 | 1085 | | |
1084 | 1086 | | |
1085 | 1087 | | |
| 1088 | + | |
1086 | 1089 | | |
1087 | 1090 | | |
1088 | 1091 | | |
1089 | 1092 | | |
1090 | 1093 | | |
1091 | 1094 | | |
| 1095 | + | |
1092 | 1096 | | |
1093 | 1097 | | |
1094 | 1098 | | |
| |||
2041 | 2045 | | |
2042 | 2046 | | |
2043 | 2047 | | |
2044 | | - | |
| 2048 | + | |
2045 | 2049 | | |
2046 | 2050 | | |
2047 | 2051 | | |
| 2052 | + | |
2048 | 2053 | | |
2049 | 2054 | | |
2050 | 2055 | | |
| |||
2053 | 2058 | | |
2054 | 2059 | | |
2055 | 2060 | | |
| 2061 | + | |
2056 | 2062 | | |
2057 | 2063 | | |
2058 | 2064 | | |
2059 | 2065 | | |
2060 | 2066 | | |
| 2067 | + | |
2061 | 2068 | | |
2062 | 2069 | | |
2063 | 2070 | | |
2064 | 2071 | | |
2065 | 2072 | | |
2066 | | - | |
| 2073 | + | |
2067 | 2074 | | |
| 2075 | + | |
| 2076 | + | |
2068 | 2077 | | |
2069 | 2078 | | |
2070 | 2079 | | |
| |||
2074 | 2083 | | |
2075 | 2084 | | |
2076 | 2085 | | |
| 2086 | + | |
2077 | 2087 | | |
2078 | 2088 | | |
2079 | 2089 | | |
| |||
2614 | 2624 | | |
2615 | 2625 | | |
2616 | 2626 | | |
| 2627 | + | |
2617 | 2628 | | |
2618 | 2629 | | |
2619 | 2630 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
0 commit comments