numam-dpdk/drivers/net/bonding
Chengchang Tang 324d6577ba net/bonding: fix adding itself as its slave
Adding the bond device as its own slave should be forbidden. This
will cause a recursive endless loop in many subsequent operations,
and eventually lead to coredump.

This problem was found in testpmd, the related logs are as follows:
testpmd> create bonded device 1 0
Created new bonded device net_bonding_testpmd_0 on (port 4).
testpmd> add bonding slave 4 4
Segmentation fault (core dumped)

The call stack is as follows:
0x000000000064eb90 in rte_eth_dev_info_get ()
0x00000000006df4b4 in bond_ethdev_info ()
0x000000000064eb90 in rte_eth_dev_info_get ()
0x00000000006df4b4 in bond_ethdev_info ()
0x000000000064eb90 in rte_eth_dev_info_get ()
0x0000000000564e58 in eth_dev_info_get_print_err ()
0x000000000055e8a4 in init_port_config ()
0x000000000052730c in cmd_add_bonding_slave_parsed ()
0x0000000000646f60 in cmdline_parse ()
0x0000000000645e08 in cmdline_valid_buffer ()
0x000000000064956c in rdline_char_in ()
0x0000000000645ee0 in cmdline_in ()
0x00000000006460a4 in cmdline_interact ()
0x0000000000531904 in prompt ()
0x000000000051cca8 in main ()

Fixes: 2efb58cbab ("bond: new link bonding library")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2021-04-20 03:36:05 +02:00
..
eth_bond_8023ad_private.h net/bonding: change state machine to defaulted 2020-07-21 13:54:54 +02:00
eth_bond_private.h net/bonding: fix adding itself as its slave 2021-04-20 03:36:05 +02:00
meson.build drivers: change indentation in build files 2021-04-21 14:04:09 +02:00
rte_eth_bond_8023ad.c net/bonding: fix LACP system address check 2021-03-08 12:32:33 +01:00
rte_eth_bond_8023ad.h replace packed attributes 2020-04-16 18:16:46 +02:00
rte_eth_bond_alb.c rename private header files 2019-10-27 22:03:06 +01:00
rte_eth_bond_alb.h net: add rte prefix to ether structures 2019-05-24 13:34:45 +02:00
rte_eth_bond_api.c net/bonding: fix adding itself as its slave 2021-04-20 03:36:05 +02:00
rte_eth_bond_args.c net/bonding: fix PCI address comparison on non-PCI ports 2021-01-08 16:03:05 +01:00
rte_eth_bond_flow.c rename private header files 2019-10-27 22:03:06 +01:00
rte_eth_bond_pmd.c drivers: align log names 2021-04-08 18:32:31 +02:00
rte_eth_bond.h net: add rte prefix to ether structures 2019-05-24 13:34:45 +02:00
version.map build: remove library name from version map file name 2020-10-19 22:13:59 +02:00