Commit b99bdf1
media: mxl111sf: change mutex_init() location
commit 44870a9 upstream.
Syzbot reported, that mxl111sf_ctrl_msg() uses uninitialized
mutex. The problem was in wrong mutex_init() location.
Previous mutex_init(&state->msg_lock) call was in ->init() function, but
dvb_usbv2_init() has this order of calls:
dvb_usbv2_init()
dvb_usbv2_adapter_init()
dvb_usbv2_adapter_frontend_init()
props->frontend_attach()
props->init()
Since mxl111sf_* devices call mxl111sf_ctrl_msg() in ->frontend_attach()
internally we need to initialize state->msg_lock before
frontend_attach(). To achieve it, ->probe() call added to all mxl111sf_*
devices, which will simply initiaize mutex.
Reported-and-tested-by: syzbot+5ca0bf339f13c4243001@syzkaller.appspotmail.com
Fixes: 8572211 ("[media] mxl111sf: convert to new DVB USB")
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 0413f7a commit b99bdf1
1 file changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
931 | 931 | | |
932 | 932 | | |
933 | 933 | | |
934 | | - | |
935 | | - | |
936 | 934 | | |
937 | 935 | | |
938 | 936 | | |
| |||
1074 | 1072 | | |
1075 | 1073 | | |
1076 | 1074 | | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
1077 | 1083 | | |
1078 | 1084 | | |
1079 | 1085 | | |
| |||
1083 | 1089 | | |
1084 | 1090 | | |
1085 | 1091 | | |
| 1092 | + | |
1086 | 1093 | | |
1087 | 1094 | | |
1088 | 1095 | | |
| |||
1124 | 1131 | | |
1125 | 1132 | | |
1126 | 1133 | | |
| 1134 | + | |
1127 | 1135 | | |
1128 | 1136 | | |
1129 | 1137 | | |
| |||
1165 | 1173 | | |
1166 | 1174 | | |
1167 | 1175 | | |
| 1176 | + | |
1168 | 1177 | | |
1169 | 1178 | | |
1170 | 1179 | | |
| |||
1233 | 1242 | | |
1234 | 1243 | | |
1235 | 1244 | | |
| 1245 | + | |
1236 | 1246 | | |
1237 | 1247 | | |
1238 | 1248 | | |
| |||
1311 | 1321 | | |
1312 | 1322 | | |
1313 | 1323 | | |
| 1324 | + | |
1314 | 1325 | | |
1315 | 1326 | | |
1316 | 1327 | | |
| |||
1381 | 1392 | | |
1382 | 1393 | | |
1383 | 1394 | | |
| 1395 | + | |
1384 | 1396 | | |
1385 | 1397 | | |
1386 | 1398 | | |
| |||
0 commit comments