bisecting fixing commit since 01fd1694b93c92ad54fa684dac9c8068ecda8288 building syzkaller on cd626f3ba9f85027426d4fbed73e79e523e8e138 testing commit 01fd1694b93c92ad54fa684dac9c8068ecda8288 with gcc (GCC) 8.1.0 kernel signature: 77bfb997f955754938eb3cf0a23386d31a655197ced1dfc69b4a05290765c5d4 run #0: crashed: general protection fault in __smc_diag_dump run #1: crashed: general protection fault in __smc_diag_dump run #2: crashed: general protection fault in __smc_diag_dump run #3: crashed: general protection fault in __smc_diag_dump run #4: crashed: general protection fault in __smc_diag_dump run #5: crashed: KASAN: use-after-free Read in __smc_diag_dump run #6: crashed: KASAN: use-after-free Read in __smc_diag_dump run #7: crashed: KASAN: use-after-free Read in __smc_diag_dump run #8: crashed: general protection fault in __smc_diag_dump run #9: crashed: general protection fault in __smc_diag_dump testing current HEAD 050272a0423e68207fd2367831ae610680129062 testing commit 050272a0423e68207fd2367831ae610680129062 with gcc (GCC) 8.1.0 kernel signature: d39dbe18d3eda870fe1b74315b3a2280a30613102d12fa4a540e9471cf5ad75c run #0: crashed: general protection fault in __smc_diag_dump run #1: crashed: general protection fault in __smc_diag_dump run #2: crashed: general protection fault in __smc_diag_dump run #3: crashed: KASAN: use-after-free Read in __smc_diag_dump run #4: crashed: general protection fault in __smc_diag_dump run #5: crashed: general protection fault in __smc_diag_dump run #6: crashed: general protection fault in __smc_diag_dump run #7: crashed: general protection fault in __smc_diag_dump run #8: crashed: general protection fault in __smc_diag_dump run #9: crashed: KASAN: use-after-free Read in __smc_diag_dump revisions tested: 2, total time: 25m53.827948238s (build: 16m49.697849315s, test: 7m54.600806145s) the crash still happens on HEAD commit msg: Linux 4.14.177 crash: KASAN: use-after-free Read in __smc_diag_dump SELinux: unrecognized netlink message: protocol=4 nlmsg_type=0 sclass=netlink_tcpdiag_socket pig=8439 comm=syz-executor.4 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=0 sclass=netlink_tcpdiag_socket pig=8444 comm=syz-executor.3 ================================================================== BUG: KASAN: use-after-free in smc_diag_msg_common_fill net/smc/smc_diag.c:46 [inline] BUG: KASAN: use-after-free in __smc_diag_dump.isra.4+0x153a/0x1670 net/smc/smc_diag.c:81 Read of size 8 at addr ffff888080a97ae0 by task syz-executor.4/8663 CPU: 1 PID: 8663 Comm: syz-executor.4 Not tainted 4.14.177-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xf7/0x13b lib/dump_stack.c:58 print_address_description.cold.7+0x9/0x1c9 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.8+0x11a/0x2d3 mm/kasan/report.c:409 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 smc_diag_msg_common_fill net/smc/smc_diag.c:46 [inline] __smc_diag_dump.isra.4+0x153a/0x1670 net/smc/smc_diag.c:81 smc_diag_dump+0x1dc/0x2a0 net/smc/smc_diag.c:169 netlink_dump+0x3bf/0xb70 net/netlink/af_netlink.c:2203 __netlink_dump_start+0x4c2/0x780 net/netlink/af_netlink.c:2300 netlink_dump_start include/linux/netlink.h:217 [inline] smc_diag_handler_dump+0x197/0x220 net/smc/smc_diag.c:190 __sock_diag_cmd net/core/sock_diag.c:231 [inline] sock_diag_rcv_msg+0x252/0x350 net/core/sock_diag.c:263 netlink_rcv_skb+0x133/0x370 net/netlink/af_netlink.c:2433 sock_diag_rcv+0x25/0x40 net/core/sock_diag.c:274 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline] netlink_unicast+0x40d/0x5f0 net/netlink/af_netlink.c:1313 netlink_sendmsg+0x730/0xbd0 net/netlink/af_netlink.c:1878 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:656 kernel_sendmsg+0x26/0x30 net/socket.c:664 sock_no_sendpage+0xf7/0x130 net/core/sock.c:2572 kernel_sendpage+0x60/0xd0 net/socket.c:3407 sock_sendpage+0x6d/0xd0 net/socket.c:871 pipe_to_sendpage+0x206/0x420 fs/splice.c:451 splice_from_pipe_feed fs/splice.c:502 [inline] __splice_from_pipe+0x2cb/0x720 fs/splice.c:626 splice_from_pipe+0xb5/0x110 fs/splice.c:661 generic_splice_sendpage+0x10/0x20 fs/splice.c:832 do_splice_from fs/splice.c:851 [inline] do_splice fs/splice.c:1147 [inline] SYSC_splice fs/splice.c:1402 [inline] SyS_splice+0x6e9/0x1580 fs/splice.c:1382 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x459879 RSP: 002b:00007f70382a7c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000113 RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 0000000000459879 RDX: 0000000000000006 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 000000000075c070 R08: 0000000080000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f70382a86d4 R13: 00000000004c907b R14: 00000000004df4f0 R15: 00000000ffffffff Allocated by task 8663: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:551 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489 kmem_cache_alloc+0x12e/0x790 mm/slab.c:3552 sock_alloc_inode+0x18/0x230 net/socket.c:251 alloc_inode+0x56/0x150 fs/inode.c:210 new_inode_pseudo+0xc/0xd0 fs/inode.c:899 sock_alloc+0x3c/0x280 net/socket.c:569 __sock_create+0x7a/0x540 net/socket.c:1239 sock_create_kern+0xf/0x20 net/socket.c:1321 smc_create+0xe1/0x310 net/smc/af_smc.c:1361 __sock_create+0x262/0x540 net/socket.c:1275 sock_create net/socket.c:1315 [inline] SYSC_socket net/socket.c:1345 [inline] SyS_socket+0xc6/0x1a0 net/socket.c:1325 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 8625: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 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:3496 [inline] kmem_cache_free+0x80/0x2d0 mm/slab.c:3758 sock_destroy_inode+0x50/0x60 net/socket.c:281 destroy_inode+0xb3/0x100 fs/inode.c:267 evict+0x36f/0x590 fs/inode.c:572 iput_final fs/inode.c:1524 [inline] iput+0x3ac/0x810 fs/inode.c:1551 __sock_release+0x211/0x2a0 net/socket.c:615 sock_release+0xb/0x10 net/socket.c:623 smc_release+0x1fe/0x5b0 net/smc/af_smc.c:141 __sock_release+0xc2/0x2a0 net/socket.c:602 sock_close+0x10/0x20 net/socket.c:1139 __fput+0x232/0x750 fs/file_table.c:210 ____fput+0x9/0x10 fs/file_table.c:244 task_work_run+0xe5/0x170 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x16a/0x1b0 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x416/0x5b0 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff888080a97ac0 which belongs to the cache sock_inode_cache of size 1000 The buggy address is located 32 bytes inside of 1000-byte region [ffff888080a97ac0, ffff888080a97ea8) The buggy address belongs to the page: page:ffffea000202a5c0 count:1 mapcount:0 mapping:ffff888080a971c0 index:0xffff888080a97ffd flags: 0x1fffc0000000100(slab) raw: 01fffc0000000100 ffff888080a971c0 ffff888080a97ffd 0000000100000001 raw: ffffea000202a820 ffffea0002027fa0 ffff88821b75e6c0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888080a97980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888080a97a00: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc >ffff888080a97a80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff888080a97b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888080a97b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================