batman_adv: batadv0: Interface deactivated: batadv_slave_0 batman_adv: batadv0: Removing interface: batadv_slave_0 batman_adv: batadv0: Interface deactivated: batadv_slave_1 batman_adv: batadv0: Removing interface: batadv_slave_1 ================================================================== BUG: KASAN: use-after-free in batadv_iv_ogm_schedule+0xdc4/0xe20 net/batman-adv/bat_iv_ogm.c:951 Write of size 2 at addr ffff88809f1cf256 by task kworker/u4:5/4047 CPU: 0 PID: 4047 Comm: kworker/u4:5 Not tainted 4.14.168-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+0x142/0x197 lib/dump_stack.c:58 print_address_description.cold+0x7c/0x1dc 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/0x2af mm/kasan/report.c:393 __asan_report_store2_noabort+0x17/0x20 mm/kasan/report.c:433 batadv_iv_ogm_schedule+0xdc4/0xe20 net/batman-adv/bat_iv_ogm.c:951 batadv_iv_send_outstanding_bat_ogm_packet+0x4a1/0x680 net/batman-adv/bat_iv_ogm.c:1809 process_one_work+0x863/0x1600 kernel/workqueue.c:2114 worker_thread+0x5d9/0x1050 kernel/workqueue.c:2248 kthread+0x319/0x430 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 Allocated by task 10904: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x45/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc mm/kasan/kasan.c:551 [inline] kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529 kmem_cache_alloc_trace+0x152/0x790 mm/slab.c:3618 kmalloc include/linux/slab.h:488 [inline] batadv_iv_ogm_iface_enable+0xff/0x2e0 net/batman-adv/bat_iv_ogm.c:374 batadv_hardif_enable_interface+0x251/0xa10 net/batman-adv/hard-interface.c:746 batadv_softif_slave_add+0x8b/0xf0 net/batman-adv/soft-interface.c:889 do_set_master net/core/rtnetlink.c:1961 [inline] do_set_master+0x19f/0x200 net/core/rtnetlink.c:1936 do_setlink+0x99f/0x2c20 net/core/rtnetlink.c:2098 rtnl_newlink+0x11a7/0x1700 net/core/rtnetlink.c:2651 rtnetlink_rcv_msg+0x3da/0xb70 net/core/rtnetlink.c:4306 netlink_rcv_skb+0x14f/0x3c0 net/netlink/af_netlink.c:2432 rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:4318 netlink_unicast_kernel net/netlink/af_netlink.c:1286 [inline] netlink_unicast+0x44d/0x650 net/netlink/af_netlink.c:1312 netlink_sendmsg+0x7c4/0xc60 net/netlink/af_netlink.c:1877 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xce/0x110 net/socket.c:656 SYSC_sendto+0x206/0x310 net/socket.c:1763 SyS_sendto+0x40/0x50 net/socket.c:1731 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 11004: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x45/0xd0 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+0xcc/0x270 mm/slab.c:3815 batadv_iv_ogm_iface_disable+0x39/0x80 net/batman-adv/bat_iv_ogm.c:393 batadv_hardif_disable_interface.cold+0x605/0x840 net/batman-adv/hard-interface.c:836 batadv_softif_destroy_netlink+0xad/0x140 net/batman-adv/soft-interface.c:1134 rtnl_delete_link+0xc3/0x110 net/core/rtnetlink.c:2374 rtnl_dellink+0x206/0x680 net/core/rtnetlink.c:2411 rtnetlink_rcv_msg+0x3da/0xb70 net/core/rtnetlink.c:4306 netlink_rcv_skb+0x14f/0x3c0 net/netlink/af_netlink.c:2432 rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:4318 netlink_unicast_kernel net/netlink/af_netlink.c:1286 [inline] netlink_unicast+0x44d/0x650 net/netlink/af_netlink.c:1312 netlink_sendmsg+0x7c4/0xc60 net/netlink/af_netlink.c:1877 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xce/0x110 net/socket.c:656 ___sys_sendmsg+0x70a/0x840 net/socket.c:2062 __sys_sendmsg+0xb9/0x140 net/socket.c:2096 SYSC_sendmsg net/socket.c:2107 [inline] SyS_sendmsg+0x2d/0x50 net/socket.c:2103 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff88809f1cf240 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 22 bytes inside of 32-byte region [ffff88809f1cf240, ffff88809f1cf260) The buggy address belongs to the page: page:ffffea00027c73c0 count:1 mapcount:0 mapping:ffff88809f1cf000 index:0xffff88809f1cffc1 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffff88809f1cf000 ffff88809f1cffc1 0000000100000035 raw: ffffea00027a8de0 ffffea0002966ca0 ffff8880aa8001c0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809f1cf100: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff88809f1cf180: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc >ffff88809f1cf200: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ^ ffff88809f1cf280: 00 00 01 fc fc fc fc fc fb fb fb fb fc fc fc fc ffff88809f1cf300: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ==================================================================