================================================================== BUG: KASAN: use-after-free in memcpy include/linux/string.h:359 [inline] BUG: KASAN: use-after-free in batadv_iv_ogm_aggregate_new net/batman-adv/bat_iv_ogm.c:538 [inline] BUG: KASAN: use-after-free in batadv_iv_ogm_queue_add+0x32f/0xe50 net/batman-adv/bat_iv_ogm.c:634 Read of size 60 at addr ffff88809eef0180 by task kworker/u4:1/21 CPU: 1 PID: 21 Comm: kworker/u4:1 Not tainted 5.2.0-rc5-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+0x113/0x167 lib/dump_stack.c:113 print_address_description.cold.5+0x9/0x1ff mm/kasan/report.c:188 __kasan_report.cold.6+0x1b/0x39 mm/kasan/report.c:317 kasan_report+0x12/0x20 mm/kasan/common.c:614 check_memory_region_inline mm/kasan/generic.c:185 [inline] check_memory_region+0x13e/0x1b0 mm/kasan/generic.c:191 memcpy+0x23/0x50 mm/kasan/common.c:124 memcpy include/linux/string.h:359 [inline] batadv_iv_ogm_aggregate_new net/batman-adv/bat_iv_ogm.c:538 [inline] batadv_iv_ogm_queue_add+0x32f/0xe50 net/batman-adv/bat_iv_ogm.c:634 batadv_iv_ogm_schedule+0xb60/0xe90 net/batman-adv/bat_iv_ogm.c:807 batadv_iv_send_outstanding_bat_ogm_packet+0x4a2/0x790 net/batman-adv/bat_iv_ogm.c:1669 process_one_work+0x830/0x16a0 kernel/workqueue.c:2269 worker_thread+0x85/0xb60 kernel/workqueue.c:2415 kthread+0x324/0x3e0 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 21: save_stack+0x21/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_kmalloc.constprop.12+0xc7/0xd0 mm/kasan/common.c:489 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:503 __do_kmalloc mm/slab.c:3660 [inline] __kmalloc+0x15d/0x760 mm/slab.c:3669 kmalloc include/linux/slab.h:552 [inline] batadv_tvlv_realloc_packet_buff net/batman-adv/tvlv.c:277 [inline] batadv_tvlv_container_ogm_append+0x16f/0x4b0 net/batman-adv/tvlv.c:318 batadv_iv_ogm_schedule+0xc53/0xe90 net/batman-adv/bat_iv_ogm.c:770 batadv_iv_send_outstanding_bat_ogm_packet+0x4a2/0x790 net/batman-adv/bat_iv_ogm.c:1669 process_one_work+0x830/0x16a0 kernel/workqueue.c:2269 worker_thread+0x85/0xb60 kernel/workqueue.c:2415 kthread+0x324/0x3e0 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Freed by task 7984: save_stack+0x21/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459 __cache_free mm/slab.c:3432 [inline] kfree+0xcf/0x220 mm/slab.c:3755 batadv_iv_ogm_iface_disable+0x34/0x70 net/batman-adv/bat_iv_ogm.c:220 batadv_hardif_disable_interface.cold.23+0x5a8/0xc32 net/batman-adv/hard-interface.c:871 batadv_softif_slave_del+0x4e/0x90 net/batman-adv/soft-interface.c:922 do_set_master+0xbb/0x200 net/core/rtnetlink.c:2355 do_setlink+0x95a/0x2db0 net/core/rtnetlink.c:2504 rtnl_group_changelink net/core/rtnetlink.c:2978 [inline] __rtnl_newlink+0x889/0x13f0 net/core/rtnetlink.c:3134 rtnl_newlink+0x61/0x90 net/core/rtnetlink.c:3254 rtnetlink_rcv_msg+0x34f/0x8f0 net/core/rtnetlink.c:5223 netlink_rcv_skb+0x13c/0x380 net/netlink/af_netlink.c:2477 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:5241 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x43b/0x640 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x765/0xc40 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:665 ___sys_sendmsg+0x647/0x950 net/socket.c:2286 __sys_sendmsg+0xd9/0x180 net/socket.c:2324 __do_sys_sendmsg net/socket.c:2333 [inline] __se_sys_sendmsg net/socket.c:2331 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2331 do_syscall_64+0xd0/0x530 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88809eef0180 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff88809eef0180, ffff88809eef01c0) The buggy address belongs to the page: page:ffffea00027bbc00 refcount:1 mapcount:0 mapping:ffff8880aa400340 index:0x0 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea0002277188 ffffea00026a2008 ffff8880aa400340 raw: 0000000000000000 ffff88809eef0000 0000000100000020 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809eef0080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88809eef0100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88809eef0180: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88809eef0200: 00 00 00 00 00 04 fc fc fc fc fc fc fc fc fc fc ffff88809eef0280: 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc fc ==================================================================