BUG: KASAN: use-after-free in tipc_group_self+0x1a2/0x1b0 net/tipc/group.c:335 Read of size 4 at addr ffff88006bd6556c by task syzkaller079720/2975 CPU: 2 PID: 2975 Comm: syzkaller079720 Not tainted 4.14.0-rc5-next-20171018+ #8 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:16 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:52 print_address_description+0x73/0x250 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report+0x25b/0x340 mm/kasan/report.c:409 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:429 tipc_group_self+0x1a2/0x1b0 net/tipc/group.c:335 tipc_sk_leave+0xfc/0x200 net/tipc/socket.c:2781 tipc_release+0x154/0xfe0 net/tipc/socket.c:575 sock_release+0x8d/0x1e0 net/socket.c:596 sock_close+0x16/0x20 net/socket.c:1125 __fput+0x327/0x7e0 fs/file_table.c:210 ____fput+0x15/0x20 fs/file_table.c:244 task_work_run+0x199/0x270 kernel/task_work.c:112 exit_task_work include/linux/task_work.h:21 [inline] do_exit+0x9b5/0x1ad0 kernel/exit.c:869 do_group_exit+0x149/0x400 kernel/exit.c:972 SYSC_exit_group kernel/exit.c:983 [inline] SyS_exit_group+0x1d/0x20 kernel/exit.c:981 entry_SYSCALL_64_fastpath+0x1f/0xbe RIP: 0033:0x433a29 RSP: 002b:00007ffe5b5a1af8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000433a29 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000082 R08: 000000000000003c R09: 00000000000000e7 R10: ffffffffffffffc0 R11: 0000000000000246 R12: 00007ffe5b5a1c18 R13: 00007ffe5b5a1c28 R14: 0000000000000002 R15: 0000000000000000 Allocated by task 2975: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551 kmem_cache_alloc_trace+0x136/0x750 mm/slab.c:3614 kmalloc include/linux/slab.h:502 [inline] kzalloc include/linux/slab.h:691 [inline] tipc_group_create+0x116/0x9c0 net/tipc/group.c:167 tipc_sk_join net/tipc/socket.c:2751 [inline] tipc_setsockopt+0x25e/0xc00 net/tipc/socket.c:2863 SYSC_setsockopt net/socket.c:1851 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1830 entry_SYSCALL_64_fastpath+0x1f/0xbe Freed by task 2975: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3492 [inline] kfree+0xca/0x250 mm/slab.c:3807 tipc_group_delete+0x2c0/0x3c0 net/tipc/group.c:206 tipc_sk_join net/tipc/socket.c:2764 [inline] tipc_setsockopt+0xb33/0xc00 net/tipc/socket.c:2863 SYSC_setsockopt net/socket.c:1851 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1830 entry_SYSCALL_64_fastpath+0x1f/0xbe The buggy address belongs to the object at ffff88006bd65500 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 108 bytes inside of 192-byte region [ffff88006bd65500, ffff88006bd655c0) The buggy address belongs to the page: page:ffffea0001af5940 count:1 mapcount:0 mapping:ffff88006bd65000 index:0x0 flags: 0x500000000000100(slab) raw: 0500000000000100 ffff88006bd65000 0000000000000000 0000000100000010 raw: ffffea0001af7420 ffffea0001af9620 ffff88003e800040 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88006bd65400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88006bd65480: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc >ffff88006bd65500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88006bd65580: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88006bd65600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================