Bug 215950

Summary: bonding: kernel oops due to possible race with wifi adapters
Product: Networking Reporter: Sebastian Bernardt (smopucilowski)
Component: OtherAssignee: Stephen Hemminger (stephen)
Status: NEW ---    
Severity: normal CC: ihuguet
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 5.17.5 Subsystem:
Regression: No Bisected commit-id:
Attachments: kernel oops syslog entry

Description Sebastian Bernardt 2022-05-07 06:24:29 UTC
Created attachment 300899 [details]
kernel oops syslog entry

Trying to create a resilient bond with a wired and wireless interface (https://wiki.archlinux.org/title/systemd-networkd#Bonding_a_wired_and_wireless_interface), in which the wired interface (ethernet dongle) is spent majority unplugged. systemd-networkd and iwd are used to manage the interfaces and wireless connection.

Downstream bug report: https://github.com/systemd/systemd/issues/23255

Kernel oops can be triggered reliably with the systemd-networkd configuration in the above downstream bug report. On a debug kernel, where kernel timings are a bit slower, if oops wasn't triggered during boot when systemd-network handles connections, then restarting iwd and systemd-networkd almost always triggers it.

The oops appears to be a null deference in bond_slave_state:
include/net/bonding.h:242 return slave->backup;
which suggests a race condition whereby slave interfaces are brought up or down during bond initialisation.