device bridge_slave_0 left promiscuous mode bridge0: port 1(bridge_slave_0) entered disabled state batman_adv: batadv0: Interface deactivated: batadv_slave_0 batman_adv: batadv0: Removing interface: batadv_slave_0 ================================================================== BUG: KASAN: use-after-free in memcpy include/linux/string.h:352 [inline] BUG: KASAN: use-after-free in batadv_iv_ogm_aggregate_new net/batman-adv/bat_iv_ogm.c:550 [inline] BUG: KASAN: use-after-free in batadv_iv_ogm_queue_add+0x326/0xe50 net/batman-adv/bat_iv_ogm.c:646 Read of size 60 at addr ffff888095c19f00 by task kworker/u4:0/7 CPU: 1 PID: 7 Comm: kworker/u4:0 Not tainted 5.0.0-rc6-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:77 [inline] dump_stack+0x165/0x21a lib/dump_stack.c:113 print_address_description.cold.3+0x9/0x211 mm/kasan/report.c:187 kasan_report.cold.4+0x1b/0x37 mm/kasan/report.c:317 check_memory_region_inline mm/kasan/generic.c:185 [inline] check_memory_region+0x13c/0x1b0 mm/kasan/generic.c:191 memcpy+0x23/0x50 mm/kasan/common.c:130 memcpy include/linux/string.h:352 [inline] batadv_iv_ogm_aggregate_new net/batman-adv/bat_iv_ogm.c:550 [inline] batadv_iv_ogm_queue_add+0x326/0xe50 net/batman-adv/bat_iv_ogm.c:646 batadv_iv_ogm_schedule+0xb47/0xe80 net/batman-adv/bat_iv_ogm.c:819 batadv_iv_send_outstanding_bat_ogm_packet+0x4a2/0x790 net/batman-adv/bat_iv_ogm.c:1681 process_one_work+0x7b9/0x15e0 kernel/workqueue.c:2173 worker_thread+0x85/0xb60 kernel/workqueue.c:2319 kthread+0x324/0x3e0 kernel/kthread.c:246 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 7: save_stack mm/kasan/common.c:73 [inline] set_track mm/kasan/common.c:85 [inline] __kasan_kmalloc.part.0+0x66/0x100 mm/kasan/common.c:496 __kasan_kmalloc.constprop.1+0xb5/0xc0 mm/kasan/common.c:477 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:504 __do_kmalloc mm/slab.c:3711 [inline] __kmalloc+0x164/0x3e0 mm/slab.c:3720 kmalloc include/linux/slab.h:550 [inline] batadv_tvlv_realloc_packet_buff net/batman-adv/tvlv.c:289 [inline] batadv_tvlv_container_ogm_append+0x16f/0x4b0 net/batman-adv/tvlv.c:330 batadv_iv_ogm_schedule+0xc39/0xe80 net/batman-adv/bat_iv_ogm.c:782 batadv_iv_send_outstanding_bat_ogm_packet+0x4a2/0x790 net/batman-adv/bat_iv_ogm.c:1681 process_one_work+0x7b9/0x15e0 kernel/workqueue.c:2173 worker_thread+0x85/0xb60 kernel/workqueue.c:2319 kthread+0x324/0x3e0 kernel/kthread.c:246 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Freed by task 7528: save_stack mm/kasan/common.c:73 [inline] set_track mm/kasan/common.c:85 [inline] __kasan_slab_free+0x13c/0x220 mm/kasan/common.c:458 kasan_slab_free+0xe/0x10 mm/kasan/common.c:466 __cache_free mm/slab.c:3487 [inline] kfree+0xcf/0x220 mm/slab.c:3806 batadv_iv_ogm_iface_disable+0x34/0x70 net/batman-adv/bat_iv_ogm.c:232 batadv_hardif_disable_interface.cold.9+0x712/0x107a net/batman-adv/hard-interface.c:883 batadv_softif_destroy_netlink+0x94/0x100 net/batman-adv/soft-interface.c:1149 default_device_exit_batch+0x239/0x3d0 net/core/dev.c:9674 ops_exit_list.isra.0+0xd3/0x120 net/core/net_namespace.c:156 cleanup_net+0x363/0x840 net/core/net_namespace.c:551 process_one_work+0x7b9/0x15e0 kernel/workqueue.c:2173 worker_thread+0x85/0xb60 kernel/workqueue.c:2319 kthread+0x324/0x3e0 kernel/kthread.c:246 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 The buggy address belongs to the object at ffff888095c19f00 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff888095c19f00, ffff888095c19f40) The buggy address belongs to the page: page:ffffea0002570640 count:1 mapcount:0 mapping:ffff88812c3f6340 index:0xffff888095c19080 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00027e7d88 ffffea00022751c8 ffff88812c3f6340 raw: ffff888095c19080 ffff888095c19000 0000000100000016 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888095c19e00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888095c19e80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff888095c19f00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff888095c19f80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888095c1a000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================