team0: Port device team_slave_1 removed batman_adv: batadv0: Interface deactivated: batadv_slave_0 batman_adv: batadv0: Removing interface: batadv_slave_0 ================================================================== BUG: KASAN: use-after-free in batadv_iv_ogm_schedule+0xd9b/0xdf0 net/batman-adv/bat_iv_ogm.c:951 Write of size 2 at addr ffff88809e97c696 by task kworker/u4:9/10864 CPU: 0 PID: 10864 Comm: kworker/u4:9 Not tainted 4.14.173-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: bat_events batadv_iv_send_outstanding_bat_ogm_packet Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x13e/0x194 lib/dump_stack.c:58 print_address_description.cold+0x7c/0x1e2 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report mm/kasan/report.c:409 [inline] kasan_report.cold+0xa9/0x2ae mm/kasan/report.c:393 batadv_iv_ogm_schedule+0xd9b/0xdf0 net/batman-adv/bat_iv_ogm.c:951 batadv_iv_send_outstanding_bat_ogm_packet+0x4ad/0x6a0 net/batman-adv/bat_iv_ogm.c:1809 process_one_work+0x813/0x1540 kernel/workqueue.c:2114 worker_thread+0x5d1/0x1070 kernel/workqueue.c:2248 kthread+0x30d/0x420 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 Allocated by task 10675: save_stack+0x32/0xa0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc mm/kasan/kasan.c:551 [inline] kasan_kmalloc+0xbf/0xe0 mm/kasan/kasan.c:529 __do_kmalloc mm/slab.c:3720 [inline] __kmalloc+0x15b/0x7c0 mm/slab.c:3729 kmalloc include/linux/slab.h:493 [inline] batadv_tvlv_realloc_packet_buff net/batman-adv/tvlv.c:288 [inline] batadv_tvlv_container_ogm_append+0x12a/0x490 net/batman-adv/tvlv.c:329 batadv_iv_ogm_schedule+0xb78/0xdf0 net/batman-adv/bat_iv_ogm.c:945 batadv_iv_send_outstanding_bat_ogm_packet+0x4ad/0x6a0 net/batman-adv/bat_iv_ogm.c:1809 process_one_work+0x813/0x1540 kernel/workqueue.c:2114 worker_thread+0x5d1/0x1070 kernel/workqueue.c:2248 kthread+0x30d/0x420 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 Freed by task 22627: save_stack+0x32/0xa0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcb/0x260 mm/slab.c:3815 batadv_iv_ogm_iface_disable+0x34/0x70 net/batman-adv/bat_iv_ogm.c:393 batadv_hardif_disable_interface.cold+0x61e/0x867 net/batman-adv/hard-interface.c:836 batadv_softif_slave_del+0x57/0xb0 net/batman-adv/soft-interface.c:915 do_set_master+0xd0/0x200 net/core/rtnetlink.c:1947 do_setlink+0x994/0x2c00 net/core/rtnetlink.c:2098 rtnl_group_changelink net/core/rtnetlink.c:2512 [inline] rtnl_newlink+0xbe4/0x1720 net/core/rtnetlink.c:2666 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4315 netlink_rcv_skb+0x127/0x370 net/netlink/af_netlink.c:2433 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline] netlink_unicast+0x437/0x620 net/netlink/af_netlink.c:1313 netlink_sendmsg+0x733/0xbe0 net/netlink/af_netlink.c:1878 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xc5/0x100 net/socket.c:656 ___sys_sendmsg+0x70a/0x840 net/socket.c:2062 __sys_sendmsg+0xa3/0x120 net/socket.c:2096 SYSC_sendmsg net/socket.c:2107 [inline] SyS_sendmsg+0x27/0x40 net/socket.c:2103 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff88809e97c680 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 22 bytes inside of 64-byte region [ffff88809e97c680, ffff88809e97c6c0) The buggy address belongs to the page: page:ffffea00027a5f00 count:1 mapcount:0 mapping:ffff88809e97c000 index:0xffff88809e97cd00 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffff88809e97c000 ffff88809e97cd00 000000010000001b raw: ffffea00029511e0 ffffea00023e5fe0 ffff88812fe56340 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809e97c580: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88809e97c600: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88809e97c680: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88809e97c700: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88809e97c780: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================