mirror of
https://github.com/torvalds/linux.git
synced 2026-05-22 22:22:08 +02:00
Add a selftest to reproduce the infinite recursion in bond_header_parse()
when bonds are stacked (bond1 -> bond0 -> gre). When a packet is received
via AF_PACKET SOCK_DGRAM on the topmost bond, dev_parse_header() calls
bond_header_parse() which used skb->dev (always the topmost bond) to get
the bonding struct. This caused it to recurse back into itself
indefinitely, leading to stack overflow.
Before commit b7405dcf73 ("bonding: prevent potential infinite loop
in bond_header_parse()"), the test triggers:
./bond_stacked_header_parse.sh
[ 71.999481] BUG: MAX_LOCK_DEPTH too low!
[ 72.000170] turning off the locking correctness validator.
[ 72.001029] Please attach the output of /proc/lock_stat to the bug report
[ 72.002079] depth: 48 max: 48!
...
After the fix, everything works fine:
./bond_stacked_header_parse.sh
TEST: Stacked bond header_parse does not recurse [ OK ]
Signed-off-by: Jiayuan Chen <jiayuan.chen@shopee.com>
Link: https://patch.msgid.link/20260320022245.392384-1-jiayuan.chen@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
23 lines
444 B
Plaintext
23 lines
444 B
Plaintext
CONFIG_BONDING=y
|
|
CONFIG_BRIDGE=y
|
|
CONFIG_CONFIGFS_FS=y
|
|
CONFIG_DUMMY=y
|
|
CONFIG_INET_ESP=y
|
|
CONFIG_INET_ESP_OFFLOAD=y
|
|
CONFIG_IPV6=y
|
|
CONFIG_IPVLAN=y
|
|
CONFIG_MACVLAN=y
|
|
CONFIG_NET_ACT_GACT=y
|
|
CONFIG_NET_CLS_FLOWER=y
|
|
CONFIG_NET_CLS_MATCHALL=m
|
|
CONFIG_NETCONSOLE=m
|
|
CONFIG_NETCONSOLE_DYNAMIC=y
|
|
CONFIG_NETCONSOLE_EXTENDED_LOG=y
|
|
CONFIG_NETDEVSIM=m
|
|
CONFIG_NET_IPGRE=y
|
|
CONFIG_NET_SCH_INGRESS=y
|
|
CONFIG_NLMON=y
|
|
CONFIG_VETH=y
|
|
CONFIG_VLAN_8021Q=m
|
|
CONFIG_XFRM_USER=m
|