bisecting fixing commit since f6e27dbb1afabcba436e346d6aa88a592a1436bb building syzkaller on a3355dba737fedcd171f8b9e60bf35d733986f16 testing commit f6e27dbb1afabcba436e346d6aa88a592a1436bb with gcc (GCC) 8.1.0 kernel signature: 7ae49952d074ee49d944b3bafc063ab2380ba4b9 run #0: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #1: crashed: KASAN: use-after-free Read in scatterwalk_copychunks run #2: crashed: KASAN: use-after-free Read in scatterwalk_copychunks run #3: crashed: general protection fault in scatterwalk_copychunks run #4: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #5: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #6: crashed: general protection fault in scatterwalk_copychunks run #7: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #8: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #9: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks testing current HEAD a844dc4c544291470aa69edbe2434b040794e269 testing commit a844dc4c544291470aa69edbe2434b040794e269 with gcc (GCC) 8.1.0 kernel signature: 4ad93cf24a097bca68cd06ef1697adb7df7e0d81 run #0: crashed: general protection fault in scatterwalk_copychunks run #1: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #2: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #3: crashed: general protection fault in scatterwalk_copychunks run #4: crashed: general protection fault in scatterwalk_copychunks run #5: crashed: general protection fault in scatterwalk_copychunks run #6: crashed: general protection fault in scatterwalk_copychunks run #7: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #8: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #9: crashed: KASAN: use-after-free Read in scatterwalk_copychunks revisions tested: 2, total time: 23m0.313436639s (build: 15m30.192659694s, test: 6m41.01254932s) the crash still happens on HEAD commit msg: Linux 4.14.158 crash: KASAN: use-after-free Read in scatterwalk_copychunks RBP: 000000000075bf20 R08: 0000000100000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff9a11f66d4 device bridge_slave_0 entered promiscuous mode R13: 00000000004c9222 R14: 00000000004df820 R15: 0000000000000005 ================================================================== BUG: KASAN: use-after-free in memcpy include/linux/string.h:347 [inline] BUG: KASAN: use-after-free in memcpy_dir crypto/scatterwalk.c:28 [inline] BUG: KASAN: use-after-free in scatterwalk_copychunks+0x207/0x690 crypto/scatterwalk.c:43 Read of size 4096 at addr ffff8880a5b16000 by task syz-executor.2/6637 CPU: 1 PID: 6637 Comm: syz-executor.2 Not tainted 4.14.158-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 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x13e/0x1b0 mm/kasan/kasan.c:267 memcpy+0x23/0x50 mm/kasan/kasan.c:302 memcpy include/linux/string.h:347 [inline] memcpy_dir crypto/scatterwalk.c:28 [inline] scatterwalk_copychunks+0x207/0x690 crypto/scatterwalk.c:43 scatterwalk_map_and_copy+0x10d/0x1a0 crypto/scatterwalk.c:72 kobject: 'ip6gretap0' (ffff888080d48cf0): kobject_uevent_env gcmaes_encrypt.constprop.14+0x1c0/0xae0 arch/x86/crypto/aesni-intel_glue.c:778 generic_gcmaes_encrypt+0xf8/0x13d arch/x86/crypto/aesni-intel_glue.c:1111 kobject: 'ip6gretap0' (ffff888080d48cf0): fill_kobj_path: path = '/devices/virtual/net/ip6gretap0' crypto_aead_encrypt include/crypto/aead.h:330 [inline] gcmaes_wrapper_encrypt+0xe0/0x140 arch/x86/crypto/aesni-intel_glue.c:945 crypto_aead_encrypt include/crypto/aead.h:330 [inline] tls_do_encryption net/tls/tls_sw.c:234 [inline] tls_push_record+0x8e6/0x14c0 net/tls/tls_sw.c:270 tls_sw_sendpage+0x443/0xc50 net/tls/tls_sw.c:617 inet_sendpage+0x122/0x600 net/ipv4/af_inet.c:779 kernel_sendpage+0x60/0xd0 net/socket.c:3406 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:0x459a29 RSP: 002b:00007ff9a11f5c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000113 RAX: ffffffffffffffda RBX: 00007ff9a11f5c90 RCX: 0000000000459a29 RDX: 0000000000000004 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 000000000075bf20 R08: 0000000100000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff9a11f66d4 R13: 00000000004c9222 R14: 00000000004df820 R15: 0000000000000005 Allocated by task 6612: 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 kobject: 'queues' (ffff88809452de48): kobject_add_internal: parent: 'ip6gretap0', set: '' kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489 kmem_cache_alloc+0x12e/0x790 mm/slab.c:3552 sk_prot_alloc+0x5d/0x240 net/core/sock.c:1461 sk_alloc+0x30/0xc10 net/core/sock.c:1521 unix_create1+0x6a/0x4c0 net/unix/af_unix.c:767 kobject: 'queues' (ffff88809452de48): kobject_uevent_env unix_create+0x123/0x1c0 net/unix/af_unix.c:829 __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 kobject: 'queues' (ffff88809452de48): kobject_uevent_env: filter function caused the event to drop! Freed by task 6612: 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 sk_prot_free net/core/sock.c:1502 [inline] __sk_destruct+0x358/0x4e0 net/core/sock.c:1581 kobject: 'rx-0' (ffff8880a82fc0d0): kobject_add_internal: parent: 'queues', set: 'queues' sk_destruct+0x83/0xb0 net/core/sock.c:1596 __sk_free+0x47/0x1f0 net/core/sock.c:1604 sk_free+0x23/0x30 net/core/sock.c:1615 sock_put include/net/sock.h:1653 [inline] unix_release_sock+0x7ce/0x970 net/unix/af_unix.c:568 unix_release+0x35/0x70 net/unix/af_unix.c:839 __sock_release+0xc2/0x2a0 net/socket.c:602 sock_close+0x10/0x20 net/socket.c:1139 kobject: 'rx-0' (ffff8880a82fc0d0): kobject_uevent_env __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 ffff8880a5b16000 which belongs to the cache UNIX of size 1728 The buggy address is located 0 bytes inside of 1728-byte region [ffff8880a5b16000, ffff8880a5b166c0) The buggy address belongs to the page: page:ffffea000296c580 count:1 mapcount:0 mapping:ffff8880a5b16000 index:0x0 flags: 0x1fffc0000000100(slab) raw: 01fffc0000000100 ffff8880a5b16000 0000000000000000 0000000100000002 raw: ffffea0002817a20 ffffea000253e960 ffff8880a7374e40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a5b15f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880a5b15f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880a5b16000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb kobject: 'rx-0' (ffff8880a82fc0d0): fill_kobj_path: path = '/devices/virtual/net/ip6gretap0/queues/rx-0' ^ kobject: 'tx-0' (ffff888091332558): kobject_add_internal: parent: 'queues', set: 'queues' ffff8880a5b16080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a5b16100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================