Commit 83f38f2
idpf: Fix RSS LUT NULL pointer crash on early ethtool operations
The RSS LUT is not initialized until the interface comes up, causing
the following NULL pointer crash when ethtool operations like rxhash on/off
are performed before the interface is brought up for the first time.
Move RSS LUT initialization from ndo_open to vport creation to ensure LUT
is always available. This enables RSS configuration via ethtool before
bringing the interface up. Simplify LUT management by maintaining all
changes in the driver's soft copy and programming zeros to the indirection
table when rxhash is disabled. Defer HW programming until the interface
comes up if it is down during rxhash and LUT configuration changes.
Steps to reproduce:
** Load idpf driver; interfaces will be created
modprobe idpf
** Before bringing the interfaces up, turn rxhash off
ethtool -K eth2 rxhash off
[89408.371875] BUG: kernel NULL pointer dereference, address: 0000000000000000
[89408.371908] #PF: supervisor read access in kernel mode
[89408.371924] #PF: error_code(0x0000) - not-present page
[89408.371940] PGD 0 P4D 0
[89408.371953] Oops: Oops: 0000 [#1] SMP NOPTI
<snip>
[89408.372052] RIP: 0010:memcpy_orig+0x16/0x130
[89408.372310] Call Trace:
[89408.372317] <TASK>
[89408.372326] ? idpf_set_features+0xfc/0x180 [idpf]
[89408.372363] __netdev_update_features+0x295/0xde0
[89408.372384] ethnl_set_features+0x15e/0x460
[89408.372406] genl_family_rcv_msg_doit+0x11f/0x180
[89408.372429] genl_rcv_msg+0x1ad/0x2b0
[89408.372446] ? __pfx_ethnl_set_features+0x10/0x10
[89408.372465] ? __pfx_genl_rcv_msg+0x10/0x10
[89408.372482] netlink_rcv_skb+0x58/0x100
[89408.372502] genl_rcv+0x2c/0x50
[89408.372516] netlink_unicast+0x289/0x3e0
[89408.372533] netlink_sendmsg+0x215/0x440
[89408.372551] __sys_sendto+0x234/0x240
[89408.372571] __x64_sys_sendto+0x28/0x30
[89408.372585] x64_sys_call+0x1909/0x1da0
[89408.372604] do_syscall_64+0x7a/0xfa0
[89408.373140] ? clear_bhb_loop+0x60/0xb0
[89408.373647] entry_SYSCALL_64_after_hwframe+0x76/0x7e
[89408.378887] </TASK>
<snip>
Fixes: a251eee ("idpf: add SRIOV support and other ndo_ops")
Signed-off-by: Sreedevi Joshi <[email protected]>
Reviewed-by: Sridhar Samudrala <[email protected]>
Reviewed-by: Emil Tantilov <[email protected]>
Reviewed-by: Aleksandr Loktionov <[email protected]>
Reviewed-by: Paul Menzel <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Tested-by: Samuel Salin <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>1 parent 36aae2e commit 83f38f2
File tree
5 files changed
+66
-79
lines changed- drivers/net/ethernet/intel/idpf
5 files changed
+66
-79
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
427 | 426 | | |
428 | 427 | | |
429 | 428 | | |
430 | 429 | | |
431 | 430 | | |
432 | 431 | | |
433 | | - | |
434 | 432 | | |
435 | 433 | | |
436 | 434 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1073 | 1073 | | |
1074 | 1074 | | |
1075 | 1075 | | |
1076 | | - | |
| 1076 | + | |
1077 | 1077 | | |
1078 | 1078 | | |
1079 | 1079 | | |
| |||
1226 | 1226 | | |
1227 | 1227 | | |
1228 | 1228 | | |
| 1229 | + | |
1229 | 1230 | | |
1230 | 1231 | | |
1231 | 1232 | | |
| |||
1276 | 1277 | | |
1277 | 1278 | | |
1278 | 1279 | | |
1279 | | - | |
1280 | | - | |
1281 | | - | |
1282 | | - | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
1283 | 1285 | | |
1284 | 1286 | | |
1285 | 1287 | | |
| |||
1289 | 1291 | | |
1290 | 1292 | | |
1291 | 1293 | | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
1292 | 1299 | | |
1293 | 1300 | | |
1294 | 1301 | | |
| |||
1299 | 1306 | | |
1300 | 1307 | | |
1301 | 1308 | | |
| 1309 | + | |
| 1310 | + | |
1302 | 1311 | | |
1303 | 1312 | | |
1304 | 1313 | | |
| |||
1476 | 1485 | | |
1477 | 1486 | | |
1478 | 1487 | | |
| 1488 | + | |
1479 | 1489 | | |
1480 | 1490 | | |
1481 | 1491 | | |
| |||
1570 | 1580 | | |
1571 | 1581 | | |
1572 | 1582 | | |
1573 | | - | |
1574 | | - | |
1575 | | - | |
1576 | | - | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
1577 | 1596 | | |
1578 | | - | |
| 1597 | + | |
1579 | 1598 | | |
1580 | 1599 | | |
1581 | 1600 | | |
| |||
1584 | 1603 | | |
1585 | 1604 | | |
1586 | 1605 | | |
1587 | | - | |
| 1606 | + | |
1588 | 1607 | | |
1589 | 1608 | | |
1590 | 1609 | | |
1591 | 1610 | | |
1592 | 1611 | | |
1593 | 1612 | | |
1594 | 1613 | | |
1595 | | - | |
1596 | | - | |
1597 | 1614 | | |
1598 | 1615 | | |
1599 | 1616 | | |
| |||
2051 | 2068 | | |
2052 | 2069 | | |
2053 | 2070 | | |
2054 | | - | |
| 2071 | + | |
2055 | 2072 | | |
2056 | 2073 | | |
2057 | 2074 | | |
| |||
2219 | 2236 | | |
2220 | 2237 | | |
2221 | 2238 | | |
2222 | | - | |
2223 | | - | |
2224 | | - | |
2225 | | - | |
2226 | | - | |
2227 | | - | |
2228 | | - | |
2229 | | - | |
2230 | | - | |
2231 | | - | |
2232 | | - | |
2233 | | - | |
2234 | | - | |
2235 | | - | |
2236 | | - | |
2237 | | - | |
2238 | | - | |
2239 | | - | |
2240 | | - | |
2241 | | - | |
2242 | | - | |
2243 | | - | |
2244 | | - | |
2245 | | - | |
2246 | | - | |
2247 | | - | |
2248 | | - | |
2249 | | - | |
2250 | | - | |
2251 | | - | |
2252 | | - | |
2253 | | - | |
2254 | | - | |
2255 | | - | |
2256 | 2239 | | |
2257 | 2240 | | |
2258 | 2241 | | |
| |||
2278 | 2261 | | |
2279 | 2262 | | |
2280 | 2263 | | |
| 2264 | + | |
| 2265 | + | |
2281 | 2266 | | |
2282 | | - | |
2283 | | - | |
2284 | | - | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
2285 | 2277 | | |
2286 | 2278 | | |
2287 | 2279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4650 | 4650 | | |
4651 | 4651 | | |
4652 | 4652 | | |
4653 | | - | |
| 4653 | + | |
4654 | 4654 | | |
4655 | | - | |
4656 | | - | |
4657 | 4655 | | |
4658 | 4656 | | |
4659 | 4657 | | |
4660 | | - | |
| 4658 | + | |
4661 | 4659 | | |
4662 | 4660 | | |
4663 | | - | |
| 4661 | + | |
4664 | 4662 | | |
4665 | | - | |
| 4663 | + | |
4666 | 4664 | | |
4667 | 4665 | | |
4668 | 4666 | | |
4669 | | - | |
4670 | 4667 | | |
4671 | 4668 | | |
| 4669 | + | |
| 4670 | + | |
4672 | 4671 | | |
4673 | | - | |
4674 | | - | |
4675 | | - | |
4676 | | - | |
4677 | | - | |
4678 | | - | |
4679 | | - | |
4680 | | - | |
4681 | | - | |
4682 | | - | |
4683 | | - | |
| 4672 | + | |
| 4673 | + | |
| 4674 | + | |
| 4675 | + | |
4684 | 4676 | | |
4685 | 4677 | | |
4686 | 4678 | | |
4687 | 4679 | | |
4688 | 4680 | | |
4689 | | - | |
| 4681 | + | |
4690 | 4682 | | |
4691 | 4683 | | |
4692 | 4684 | | |
4693 | | - | |
| 4685 | + | |
4694 | 4686 | | |
4695 | 4687 | | |
4696 | | - | |
| 4688 | + | |
4697 | 4689 | | |
4698 | 4690 | | |
4699 | 4691 | | |
4700 | 4692 | | |
4701 | 4693 | | |
4702 | | - | |
4703 | | - | |
4704 | 4694 | | |
4705 | 4695 | | |
4706 | 4696 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1086 | 1086 | | |
1087 | 1087 | | |
1088 | 1088 | | |
1089 | | - | |
1090 | | - | |
| 1089 | + | |
| 1090 | + | |
1091 | 1091 | | |
1092 | 1092 | | |
1093 | 1093 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2804 | 2804 | | |
2805 | 2805 | | |
2806 | 2806 | | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
2807 | 2811 | | |
2808 | 2812 | | |
2809 | 2813 | | |
| |||
2814 | 2818 | | |
2815 | 2819 | | |
2816 | 2820 | | |
| 2821 | + | |
2817 | 2822 | | |
2818 | 2823 | | |
2819 | 2824 | | |
2820 | 2825 | | |
| 2826 | + | |
2821 | 2827 | | |
2822 | 2828 | | |
2823 | 2829 | | |
| |||
2839 | 2845 | | |
2840 | 2846 | | |
2841 | 2847 | | |
2842 | | - | |
| 2848 | + | |
| 2849 | + | |
2843 | 2850 | | |
2844 | 2851 | | |
2845 | 2852 | | |
| |||
0 commit comments