mbox series

[net,0/2] bonding: properly restore flags when non-eth dev enslave fails

Message ID 20230313132834.946360-1-razor@blackwall.org (mailing list archive)
Headers show
Series bonding: properly restore flags when non-eth dev enslave fails | expand

Message

Nikolay Aleksandrov March 13, 2023, 1:28 p.m. UTC
Hi,
A bug was reported by syzbot[1] that causes a warning and a myriad of
other potential issues if a bond that is also a slave fails to enslave a
non-eth device. Patch 01 fixes the bug and patch 02 adds a selftest for
bond flags restoration in such cases. For more information please see
commit descriptions.

Thanks,
 Nik

[1] https://syzkaller.appspot.com/bug?id=391c7b1f6522182899efba27d891f1743e8eb3ef

Nikolay Aleksandrov (2):
  bonding: restore bond's IFF_SLAVE flag if a non-eth dev
    enslave fails
  selftests: rtnetlink: add a bond test trying to enslave non-eth dev

 drivers/net/bonding/bond_main.c          |  8 +++++-
 tools/testing/selftests/net/rtnetlink.sh | 36 ++++++++++++++++++++++++
 2 files changed, 43 insertions(+), 1 deletion(-)

Comments

Nikolay Aleksandrov March 13, 2023, 1:42 p.m. UTC | #1
On 13/03/2023 15:28, Nikolay Aleksandrov wrote:
> Hi,
> A bug was reported by syzbot[1] that causes a warning and a myriad of
> other potential issues if a bond that is also a slave fails to enslave a
> non-eth device. Patch 01 fixes the bug and patch 02 adds a selftest for
> bond flags restoration in such cases. For more information please see
> commit descriptions.
> 
> Thanks,
>  Nik
> 
> [1] https://syzkaller.appspot.com/bug?id=391c7b1f6522182899efba27d891f1743e8eb3ef
> 
> Nikolay Aleksandrov (2):
>   bonding: restore bond's IFF_SLAVE flag if a non-eth dev
>     enslave fails
>   selftests: rtnetlink: add a bond test trying to enslave non-eth dev
> 
>  drivers/net/bonding/bond_main.c          |  8 +++++-
>  tools/testing/selftests/net/rtnetlink.sh | 36 ++++++++++++++++++++++++
>  2 files changed, 43 insertions(+), 1 deletion(-)
> 

Self-NAK, apologies for the noise. I'll send a v2 with the selftest adjusted to
always to attempt a cleanup after printing the errors regardless if the system hangs.