bisecting fixing commit since 4fccc2503536a564a4ba31a1d50439854201659f building syzkaller on 2c36e7a75f8689b3da20e1a81a2ee5391f3af6e5 testing commit 4fccc2503536a564a4ba31a1d50439854201659f with gcc (GCC) 8.1.0 kernel signature: f1af7da5a6593c1a0f4be8b0cd6ebe074732c3d29eb6ccc3464daee015b6afc0 all runs: crashed: KASAN: slab-out-of-bounds Write in decode_data testing current HEAD 1bab61d3e8cd96f2badf515dcb06e4e1029bc017 testing commit 1bab61d3e8cd96f2badf515dcb06e4e1029bc017 with gcc (GCC) 8.1.0 kernel signature: 41ee40bed6717f98c5bbc1b25a86cf85e5806875a75d2dbb2af9bb165f1e0dc4 all runs: crashed: KASAN: slab-out-of-bounds Write in decode_data revisions tested: 2, total time: 23m57.568757582s (build: 17m6.445553678s, test: 6m10.815447805s) the crash still happens on HEAD commit msg: Linux 4.19.124 crash: KASAN: slab-out-of-bounds Write in decode_data IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready sp0: Synchronizing with TNC sp1: Synchronizing with TNC ================================================================== BUG: KASAN: slab-out-of-bounds in decode_data.part.2+0x23c/0x280 drivers/net/hamradio/6pack.c:863 Write of size 1 at addr ffff88808b4d990e by task kworker/u4:4/286 CPU: 0 PID: 286 Comm: kworker/u4:4 Not tainted 4.19.124-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events_unbound flush_to_ldisc Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x123/0x177 lib/dump_stack.c:118 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 __asan_report_store1_noabort+0x17/0x20 mm/kasan/report.c:435 decode_data.part.2+0x23c/0x280 drivers/net/hamradio/6pack.c:863 decode_data drivers/net/hamradio/6pack.c:985 [inline] sixpack_decode drivers/net/hamradio/6pack.c:988 [inline] sixpack_receive_buf+0x722/0x1120 drivers/net/hamradio/6pack.c:458 tty_ldisc_receive_buf+0xff/0x1b0 drivers/tty/tty_buffer.c:460 ------------[ cut here ]------------ tty_port_default_receive_buf+0x5f/0x90 drivers/tty/tty_port.c:38 receive_buf drivers/tty/tty_buffer.c:476 [inline] flush_to_ldisc+0x1aa/0x3a0 drivers/tty/tty_buffer.c:528 process_one_work+0x830/0x1670 kernel/workqueue.c:2155 worker_thread+0x85/0xb60 kernel/workqueue.c:2298 kthread+0x324/0x3e0 kernel/kthread.c:246 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Allocated by task 7888: kernel BUG at arch/x86/mm/physaddr.c:27! invalid opcode: 0000 [#1] PREEMPT SMP KASAN save_stack+0x43/0xd0 mm/kasan/kasan.c:448 CPU: 1 PID: 7887 Comm: syz-executor.2 Not tainted 4.19.124-syzkaller #0 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 __do_kmalloc_node mm/slab.c:3689 [inline] __kmalloc_node+0x50/0x70 mm/slab.c:3696 RIP: 0010:__phys_addr+0x6b/0xc0 arch/x86/mm/physaddr.c:27 kmalloc_node include/linux/slab.h:557 [inline] kvmalloc_node+0x68/0x70 mm/util.c:423 Code: b6 14 11 48 89 f9 83 e1 07 38 ca 7f 04 84 d2 75 1b 0f b6 0d c0 4a f6 07 48 89 c2 48 d3 ea 48 85 d2 75 07 48 83 c4 08 5b 5d c3 <0f> 0b 48 89 45 f0 e8 ca 1b 65 00 48 8b 45 f0 eb d6 48 c7 c7 10 50 kvmalloc include/linux/mm.h:577 [inline] kvzalloc include/linux/mm.h:585 [inline] alloc_netdev_mqs+0x5d/0xc80 net/core/dev.c:9127 RSP: 0018:ffff88808c517728 EFLAGS: 00010087 sixpack_open+0xe7/0xbc2 drivers/net/hamradio/6pack.c:563 RAX: 0000778000000000 RBX: 0000000080000000 RCX: 0000000000000028 tty_ldisc_open.isra.3+0x65/0xa0 drivers/tty/tty_ldisc.c:469 RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000000000 tty_set_ldisc+0x249/0x5a0 drivers/tty/tty_ldisc.c:594 RBP: ffff88808c517738 R08: 000000000002ba00 R09: ffffed101169c21e tiocsetd drivers/tty/tty_io.c:2359 [inline] tty_ioctl+0x31e/0x1290 drivers/tty/tty_io.c:2603 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0x196/0x10c0 fs/ioctl.c:688 R10: ffffed101169c21e R11: ffff88808b4e10f7 R12: 0000000000000000 ksys_ioctl+0x62/0x90 fs/ioctl.c:705 R13: 0000000000000000 R14: 0000000000000000 R15: ffff88808b4e10e8 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6e/0xb0 fs/ioctl.c:710 FS: 00007f20b2ae2700(0000) GS:ffff8880aeb00000(0000) knlGS:0000000000000000 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fd40e1354f8 CR3: 000000008c3d5000 CR4: 00000000001406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 Freed by task 0: (stack is not available) DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: The buggy address belongs to the object at ffff88808b4d8580 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 910 bytes to the right of 4096-byte region [ffff88808b4d8580, ffff88808b4d9580) build_cr3 arch/x86/include/asm/tlbflush.h:127 [inline] load_new_mm_cr3+0x11a/0x200 arch/x86/mm/tlb.c:116 The buggy address belongs to the page: switch_mm_irqs_off+0x68d/0x1370 arch/x86/mm/tlb.c:390 page:ffffea00022d3600 count:1 mapcount:0 mapping:ffff88812c29cdc0 index:0x0 compound_mapcount: 0 context_switch kernel/sched/core.c:2814 [inline] __schedule+0x6db/0x1c10 kernel/sched/core.c:3515 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffffea00022d3588 ffffea00022a0988 ffff88812c29cdc0 raw: 0000000000000000 ffff88808b4d8580 0000000100000001 0000000000000000 schedule+0x7f/0x1b0 kernel/sched/core.c:3559 page dumped because: kasan: bad access detected schedule_timeout+0x6d5/0xda0 kernel/time/timer.c:1782 Memory state around the buggy address: ffff88808b4d9800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88808b4d9880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88808b4d9900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88808b4d9980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc wait_woken+0x149/0x270 kernel/sched/wait.c:419 ffff88808b4d9a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== n_tty_write+0xa19/0x1060 drivers/tty/n_tty.c:2374 do_tty_write drivers/tty/tty_io.c:960 [inline] tty_write+0x346/0x770 drivers/tty/tty_io.c:1044 __vfs_write+0xe3/0x890 fs/read_write.c:485 vfs_write+0x150/0x4d0 fs/read_write.c:549 ksys_write+0x103/0x260 fs/read_write.c:599 __do_sys_write fs/read_write.c:611 [inline] __se_sys_write fs/read_write.c:608 [inline] __x64_sys_write+0x6e/0xb0 fs/read_write.c:608 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45c429 Code: ad b6 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 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f20b2ae1c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f20b2ae26d4 RCX: 000000000045c429 RDX: 000000000000ffa8 RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 000000000076bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000cdb R14: 00000000004cebbb R15: 000000000076bf2c Modules linked in: ======================================================