Commit a5a8fc0
be2net: Fix buffer overflow in be_get_module_eeprom
[ Upstream commit d7241f679a59cfe27f92cb5c6272cb429fb1f7ec ]
be_cmd_read_port_transceiver_data assumes that it is given a buffer that
is at least PAGE_DATA_LEN long, or twice that if the module supports SFF
8472. However, this is not always the case.
Fix this by passing the desired offset and length to
be_cmd_read_port_transceiver_data so that we only copy the bytes once.
Fixes: e36edd9 ("be2net: add ethtool "-m" option support")
Signed-off-by: Hristo Venev <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>1 parent 91e21df commit a5a8fc0
File tree
3 files changed
+25
-18
lines changed- drivers/net/ethernet/emulex/benet
3 files changed
+25
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2291 | 2291 | | |
2292 | 2292 | | |
2293 | 2293 | | |
2294 | | - | |
| 2294 | + | |
2295 | 2295 | | |
2296 | 2296 | | |
2297 | 2297 | | |
| |||
2325 | 2325 | | |
2326 | 2326 | | |
2327 | 2327 | | |
2328 | | - | |
| 2328 | + | |
2329 | 2329 | | |
2330 | 2330 | | |
2331 | | - | |
| 2331 | + | |
2332 | 2332 | | |
2333 | 2333 | | |
2334 | 2334 | | |
| |||
2419 | 2419 | | |
2420 | 2420 | | |
2421 | 2421 | | |
2422 | | - | |
| 2422 | + | |
2423 | 2423 | | |
2424 | 2424 | | |
2425 | 2425 | | |
| |||
2444 | 2444 | | |
2445 | 2445 | | |
2446 | 2446 | | |
2447 | | - | |
| 2447 | + | |
2448 | 2448 | | |
2449 | 2449 | | |
2450 | 2450 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2431 | 2431 | | |
2432 | 2432 | | |
2433 | 2433 | | |
2434 | | - | |
| 2434 | + | |
2435 | 2435 | | |
2436 | 2436 | | |
2437 | 2437 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1345 | 1345 | | |
1346 | 1346 | | |
1347 | 1347 | | |
1348 | | - | |
| 1348 | + | |
1349 | 1349 | | |
1350 | 1350 | | |
1351 | 1351 | | |
| |||
1363 | 1363 | | |
1364 | 1364 | | |
1365 | 1365 | | |
| 1366 | + | |
1366 | 1367 | | |
1367 | 1368 | | |
1368 | 1369 | | |
1369 | 1370 | | |
1370 | | - | |
1371 | | - | |
1372 | | - | |
1373 | | - | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
1374 | 1384 | | |
1375 | | - | |
1376 | | - | |
1377 | | - | |
1378 | | - | |
1379 | | - | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
1380 | 1389 | | |
1381 | 1390 | | |
1382 | 1391 | | |
1383 | | - | |
1384 | | - | |
1385 | 1392 | | |
1386 | 1393 | | |
1387 | 1394 | | |
| |||
0 commit comments