Commit 427694c
usb: gadget: ncm: Handle decoding of multiple NTB's in unwrap call
When NCM is used with hosts like Windows PC, it is observed that there are
multiple NTB's contained in one usb request giveback. Since the driver
unwraps the obtained request data assuming only one NTB is present, we
loose the subsequent NTB's present resulting in data loss.
Fix this by checking the parsed block length with the obtained data
length in usb request and continue parsing after the last byte of current
NTB.
Cc: stable@vger.kernel.org
Fixes: 9f6ce42 ("usb: gadget: f_ncm.c added")
Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
Reviewed-by: Maciej Żenczykowski <maze@google.com>
Link: https://lore.kernel.org/r/20230927105858.12950-1-quic_kriskura@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 33d7e37 commit 427694c
1 file changed
Lines changed: 19 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1156 | 1156 | | |
1157 | 1157 | | |
1158 | 1158 | | |
1159 | | - | |
| 1159 | + | |
| 1160 | + | |
1160 | 1161 | | |
1161 | 1162 | | |
1162 | 1163 | | |
| |||
1169 | 1170 | | |
1170 | 1171 | | |
1171 | 1172 | | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
1172 | 1177 | | |
1173 | 1178 | | |
1174 | 1179 | | |
| |||
1215 | 1220 | | |
1216 | 1221 | | |
1217 | 1222 | | |
1218 | | - | |
| 1223 | + | |
1219 | 1224 | | |
1220 | 1225 | | |
1221 | 1226 | | |
| |||
1272 | 1277 | | |
1273 | 1278 | | |
1274 | 1279 | | |
1275 | | - | |
| 1280 | + | |
1276 | 1281 | | |
1277 | 1282 | | |
1278 | 1283 | | |
1279 | | - | |
| 1284 | + | |
1280 | 1285 | | |
1281 | 1286 | | |
1282 | 1287 | | |
| |||
1303 | 1308 | | |
1304 | 1309 | | |
1305 | 1310 | | |
1306 | | - | |
| 1311 | + | |
1307 | 1312 | | |
1308 | 1313 | | |
1309 | 1314 | | |
| |||
1316 | 1321 | | |
1317 | 1322 | | |
1318 | 1323 | | |
1319 | | - | |
1320 | | - | |
1321 | 1324 | | |
1322 | 1325 | | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
1323 | 1335 | | |
1324 | 1336 | | |
1325 | 1337 | | |
| |||
0 commit comments