"value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbonding: restore bond's IFF_SLAVE flag if a non-eth dev enslave fails\n\nsyzbot reported a warning[1] where the bond device itself is a slave and\nwe try to enslave a non-ethernet device as the first slave which fails\nbut then in the error path when ether_setup() restores the bond device\nit also clears all flags. In my previous fix[2] I restored the\nIFF_MASTER flag, but I didn't consider the case that the bond device\nitself might also be a slave with IFF_SLAVE set, so we need to restore\nthat flag as well. Use the bond_ether_setup helper which does the right\nthing and restores the bond's flags properly.\n\nSteps to reproduce using a nlmon dev:\n $ ip l add nlmon0 type nlmon\n $ ip l add bond1 type bond\n $ ip l add bond2 type bond\n $ ip l set bond1 master bond2\n $ ip l set dev nlmon0 master bond1\n $ ip -d l sh dev bond1\n 22: bond1: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noqueue master bond2 state DOWN mode DEFAULT group default qlen 1000\n (now bond1's IFF_SLAVE flag is gone and we'll hit a warning[3] if we\n try to delete it)\n\n[1] https://syzkaller.appspot.com/bug?id=391c7b1f6522182899efba27d891f1743e8eb3ef\n[2] commit 7d5cd2ce5292 (\"bonding: correctly handle bonding type change on enslave failure\")\n[3]examplewarning:\n[27.008664]bond1:(slavenlmon0):TheslavedevicespecifieddoesnotsupportsettingtheMACaddress\n[27.008692]bond1:(slavenlmon0):Error-95callingset_mac_address\n[32.464639]bond1(unregistering):Releasedallslaves\n[32.464685]------------[cuthere]------------\n[32.464686]WARNING:CPU:1PID:2004atnet/core/dev.c:10829unregister_netdevice_many+0x72a/0x780\n[32.464694]Moduleslinkedin:br_netfilterbridgebondingvirtio_net\n[32.464699]CPU:1PID:2004Comm:ipKdump:loadedNottainted5.18.0-rc3+#47\n[32.464703]Hardwarename:QEMUStandardPC(Q35+ICH9,2009),BIOS1.16.1-2.fc3704/01/2014\n[32.464704]RIP:0010:unregister_netdevice_many+0x72a/0x780\n[32.464707]Code:99fdffffba901a000048c7c6f402669648c7c7204d3596c605fac72b0201e8be6f4a000f0be973fdffff<0f>0be95ffdffff803de3c72b02000f853bfdffffba59\n[32.464710]RSP:0018:ffffa006422d7820EFLAGS:00010206\n[32.464712]RAX:ffff8f6e077140a0RBX:ffffa006422d7888RCX:0000000000000000\n[32.464714]RDX:ffff8f6e12edbe58RSI:0000000000000296RDI:ffffffff96d4a520\n[32.464716]RBP:ffff8f6e07714000R08:ffffffff96d63600R09:ffffa006422d7728\n[32.464717]R10:0000000000000ec0R11:ffffffff9698c988R12:ffff8f6e12edb140\n[32.464719]R13:dead000000000122R14:dead000000000100R15:ffff8f6e12edb140\n[32.464723]FS:00007f297c2f1740(0000)GS:ffff8f6e5d900000(0000)knlGS:0000000000000000\n[32.464725]CS:0010DS:0000ES:0000CR0:0000000080050033\n[32.464726]CR2:00007f297bf1c800CR3:00000000115e8000CR4:0000000000350ee0\n[32.464730]CallTrace:\n[32.464763]<TASK>\n[32.464767]rtnl_dellink+0x13e/0x380\n[32.464776]?cred_has_capability.isra.0+0x68/0x100\n[32.464780]?__rtnl_unlock+0x33/0x60\n[32.464783]?bpf_lsm_capset+0x10/0x10\n[32.464786]?security_capable+0x36/0x50\n[32.464790]rtnetlink_rcv_msg+0x14e/0x3b0\n[32.464792]?_copy_to_iter+0xb1/0x790\n[32.464796]?post_alloc_hook+0xa0/0x160\n[32.464799]?rtnl_calcit.isra.0+0x110/0x110\n[32.464802]netlink_rcv_skb+0x50/0xf0\n[32.464806]netlink_unicast+0x216/0x340\n[32.464809]netlink_sendmsg+0x23f/0x480\n[32.464812]sock_sendmsg+0x5e/0x60\n[32.464815]____sys_sendmsg+0x22c/0x270\n[32.464818]?import_iovec+0x17/0x20\n[32.464821]?sendmsg_copy_msghdr+0x59/0x90\n[32.464823]?do_set_pte+0xa0/0xe0\n[32.464828]___sys_sendmsg+0x81/0xc0\n[32.464832]?mod_objcg_state+0xc6/0x300\n[32.464835]?refill_obj_stock+0xa9/0x160\n[32.464838]?memcg_slab_free_hook+0x1a5/0x1f0\n[32.464842]__sys_sendm\n---truncated--