================================================================== BUG: KASAN: use-after-free in tipc_group_bc_cong+0x327/0x3f0 net/tipc/group.c:448 Read of size 2 at addr ffff8881d9575874 by task syz-executor1/27845 CPU: 1 PID: 27845 Comm: syz-executor1 Not tainted 4.20.0-rc6+ #231 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x244/0x39d lib/dump_stack.c:113 print_address_description.cold.7+0x9/0x1ff mm/kasan/report.c:256 kasan: CONFIG_KASAN_INLINE enabled kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.8+0x242/0x309 mm/kasan/report.c:412 __asan_report_load2_noabort+0x14/0x20 mm/kasan/report.c:431 tipc_group_bc_cong+0x327/0x3f0 net/tipc/group.c:448 kasan: GPF could be caused by NULL-ptr deref or user memory access tipc_send_group_bcast+0x50a/0xd90 net/tipc/socket.c:1023 general protection fault: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 27852 Comm: syz-executor1 Not tainted 4.20.0-rc6+ #231 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:tipc_group_find_member net/tipc/group.c:239 [inline] RIP: 0010:tipc_group_find_dest net/tipc/group.c:255 [inline] RIP: 0010:tipc_group_cong+0xfb/0x5d0 net/tipc/group.c:416 __tipc_sendmsg+0xeec/0x1d40 net/tipc/socket.c:1307 Code: 85 63 04 00 00 48 8b 5b 10 e8 51 ef db f9 48 85 db 0f 84 ba 00 00 00 e8 43 ef db f9 48 8d bb 90 00 00 00 48 89 f8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 74 08 3c 03 0f 8e 23 04 00 00 48 8d bb 94 00 RSP: 0018:ffff8881925f71e8 EFLAGS: 00010206 RAX: 00000015e0000017 RBX: 000000af00000028 RCX: ffffc90007ff7000 RDX: 0000000000000491 RSI: ffffffff87a3952d RDI: 000000af000000b8 RBP: ffff8881925f72c8 R08: ffff8881cbd1a5c0 R09: 0000000000000006 R10: 0000000000000000 R11: ffff8881cbd1a5c0 R12: 00000000b675abb1 R13: 3c00405700000020 R14: ffff8881c171d100 R15: dffffc0000000000 FS: 00007fdd08302700(0000) GS:ffff8881dae00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffd92da1bdc CR3: 000000017d4f8000 CR4: 00000000001406f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: tipc_sendmsg+0x50/0x70 net/tipc/socket.c:1272 tipc_group_bc_cong+0x2bd/0x3f0 net/tipc/group.c:459 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:631 ___sys_sendmsg+0x7fd/0x930 net/socket.c:2116 tipc_send_group_bcast+0x50a/0xd90 net/tipc/socket.c:1023 __tipc_sendmsg+0xeec/0x1d40 net/tipc/socket.c:1307 __sys_sendmsg+0x11d/0x280 net/socket.c:2154 __do_sys_sendmsg net/socket.c:2163 [inline] __se_sys_sendmsg net/socket.c:2161 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2161 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457659 Code: fd b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 tipc_sendmsg+0x50/0x70 net/tipc/socket.c:1272 RSP: 002b:00007fdd08322c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457659 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:631 RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000003 ___sys_sendmsg+0x7fd/0x930 net/socket.c:2116 RBP: 000000000072bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fdd083236d4 R13: 00000000004c44bd R14: 00000000004d74a8 R15: 00000000ffffffff Allocated by task 27845: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kmem_cache_alloc_trace+0x152/0x750 mm/slab.c:3620 kmalloc include/linux/slab.h:546 [inline] kzalloc include/linux/slab.h:741 [inline] tipc_group_create+0x152/0xa70 net/tipc/group.c:171 tipc_sk_join net/tipc/socket.c:2829 [inline] tipc_setsockopt+0x2d1/0xd70 net/tipc/socket.c:2944 __sys_setsockopt+0x1ba/0x3c0 net/socket.c:1902 __do_sys_setsockopt net/socket.c:1913 [inline] __se_sys_setsockopt net/socket.c:1910 [inline] __x64_sys_setsockopt+0xbe/0x150 net/socket.c:1910 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe __sys_sendmsg+0x11d/0x280 net/socket.c:2154 Freed by task 27852: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3817 tipc_group_delete+0x2e4/0x3f0 net/tipc/group.c:227 tipc_sk_leave+0x113/0x220 net/tipc/socket.c:2863 __do_sys_sendmsg net/socket.c:2163 [inline] __se_sys_sendmsg net/socket.c:2161 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2161 tipc_setsockopt+0x97d/0xd70 net/tipc/socket.c:2947 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 __sys_setsockopt+0x1ba/0x3c0 net/socket.c:1902 __do_sys_setsockopt net/socket.c:1913 [inline] __se_sys_setsockopt net/socket.c:1910 [inline] __x64_sys_setsockopt+0xbe/0x150 net/socket.c:1910 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8881d9575800 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 116 bytes inside of 192-byte region [ffff8881d9575800, ffff8881d95758c0) The buggy address belongs to the page: page:ffffea0007655d40 count:1 mapcount:0 mapping:ffff8881da800040 index:0x0 entry_SYSCALL_64_after_hwframe+0x49/0xbe flags: 0x2fffc0000000200(slab) RIP: 0033:0x457659 raw: 02fffc0000000200 ffffea0007669908 ffffea0006ecad48 ffff8881da800040 Code: fd b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 raw: 0000000000000000 ffff8881d9575000 0000000100000010 0000000000000000 RSP: 002b:00007fdd08301c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e page dumped because: kasan: bad access detected RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457659 RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000005 Memory state around the buggy address: RBP: 000000000072bfa0 R08: 0000000000000000 R09: 0000000000000000 ffff8881d9575700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb R10: 0000000000000000 R11: 0000000000000246 R12: 00007fdd083026d4 ffff8881d9575780: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc R13: 00000000004c44bd R14: 00000000004d74a8 R15: 00000000ffffffff >ffff8881d9575800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb Modules linked in: ^ ffff8881d9575880: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8881d9575900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ---[ end trace 91cb34552eebeabc ]--- ================================================================== kobject: 'loop4' (000000004118d19a): kobject_uevent_env RIP: 0010:tipc_group_find_member net/tipc/group.c:239 [inline] RIP: 0010:tipc_group_find_dest net/tipc/group.c:255 [inline] RIP: 0010:tipc_group_cong+0xfb/0x5d0 net/tipc/group.c:416 kobject: 'loop4' (000000004118d19a): fill_kobj_path: path = '/devices/virtual/block/loop4' Code: 85 63 04 00 00 48 8b 5b 10 e8 51 ef db f9 48 85 db 0f 84 ba 00 00 00 e8 43 ef db f9 48 8d bb 90 00 00 00 48 89 f8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 74 08 3c 03 0f 8e 23 04 00 00 48 8d bb 94 00 kobject: 'loop2' (0000000067656a0c): kobject_uevent_env kobject: 'loop2' (0000000067656a0c): fill_kobj_path: path = '/devices/virtual/block/loop2' RSP: 0018:ffff8881925f71e8 EFLAGS: 00010206 kobject: 'loop0' (000000007a90747e): kobject_uevent_env kobject: 'loop0' (000000007a90747e): fill_kobj_path: path = '/devices/virtual/block/loop0' RAX: 00000015e0000017 RBX: 000000af00000028 RCX: ffffc90007ff7000 kobject: 'loop2' (0000000067656a0c): kobject_uevent_env RDX: 0000000000000491 RSI: ffffffff87a3952d RDI: 000000af000000b8 kobject: 'loop2' (0000000067656a0c): fill_kobj_path: path = '/devices/virtual/block/loop2'