Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net: fix a potential recursive NETDEV_FEAT_CHANGE
syzbot managed to trigger a recursive NETDEV_FEAT_CHANGE event between bonding master and slave. I managed to find a reproducer for this: ip li set bond0 up ifenslave bond0 eth0 brctl addbr br0 ethtool -K eth0 lro off brctl addif br0 bond0 ip li set br0 up When a NETDEV_FEAT_CHANGE event is triggered on a bonding slave, it captures this and calls bond_compute_features() to fixup its master's and other slaves' features. However, when syncing with its lower devices by netdev_sync_lower_features() this event is triggered again on slaves when the LRO feature fails to change, so it goes back and forth recursively until the kernel stack is exhausted. Commit 17b85d2 intentionally lets __netdev_update_features() return -1 for such a failure case, so we have to just rely on the existing check inside netdev_sync_lower_features() and skip NETDEV_FEAT_CHANGE event only for this specific failure case. Fixes: fd867d5 ("net/core: generic support for disabling netdev features down stack") Reported-by: [email protected] Reported-by: [email protected] Cc: Jarod Wilson <[email protected]> Cc: Nikolay Aleksandrov <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Jann Horn <[email protected]> Reviewed-by: Jay Vosburgh <[email protected]> Signed-off-by: Cong Wang <[email protected]> Acked-by: Nikolay Aleksandrov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
- Loading branch information