Commit 5b7022c
net: ena: handle bad request id in ena_netdev
After request id is checked in validate_rx_req_id() its value is still
used in the line
rx_ring->free_ids[next_to_clean] =
rx_ring->ena_bufs[i].req_id;
even if it was found to be out-of-bound for the array free_ids.
The patch moves the request id to an earlier stage in the napi routine and
makes sure its value isn't used if it's found out-of-bounds.
Fixes: 30623e1 ("net: ena: avoid memory access violation by validating req_id properly")
Signed-off-by: Ido Segev <idose@amazon.com>
Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent d8f0a86 commit 5b7022c
2 files changed
Lines changed: 14 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
516 | 516 | | |
517 | 517 | | |
518 | 518 | | |
| 519 | + | |
519 | 520 | | |
520 | 521 | | |
521 | 522 | | |
| |||
543 | 544 | | |
544 | 545 | | |
545 | 546 | | |
| 547 | + | |
| 548 | + | |
546 | 549 | | |
547 | 550 | | |
548 | 551 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
789 | 789 | | |
790 | 790 | | |
791 | 791 | | |
792 | | - | |
793 | | - | |
794 | | - | |
795 | | - | |
796 | | - | |
797 | | - | |
798 | | - | |
799 | | - | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | 792 | | |
811 | 793 | | |
812 | 794 | | |
| |||
1356 | 1338 | | |
1357 | 1339 | | |
1358 | 1340 | | |
1359 | | - | |
1360 | 1341 | | |
1361 | 1342 | | |
1362 | 1343 | | |
1363 | 1344 | | |
1364 | | - | |
1365 | | - | |
1366 | | - | |
1367 | | - | |
1368 | 1345 | | |
1369 | 1346 | | |
1370 | 1347 | | |
| |||
1440 | 1417 | | |
1441 | 1418 | | |
1442 | 1419 | | |
1443 | | - | |
1444 | | - | |
1445 | | - | |
1446 | | - | |
1447 | 1420 | | |
1448 | 1421 | | |
1449 | 1422 | | |
| |||
1697 | 1670 | | |
1698 | 1671 | | |
1699 | 1672 | | |
1700 | | - | |
1701 | | - | |
1702 | | - | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
1703 | 1684 | | |
1704 | | - | |
1705 | | - | |
1706 | 1685 | | |
1707 | 1686 | | |
1708 | 1687 | | |
| |||
0 commit comments