bisecting fixing commit since 4fccc2503536a564a4ba31a1d50439854201659f building syzkaller on 2c36e7a75f8689b3da20e1a81a2ee5391f3af6e5 testing commit 4fccc2503536a564a4ba31a1d50439854201659f with gcc (GCC) 8.4.1 20210217 kernel signature: 0e89d1f7fd10738cc8dbf895f4ae8e335ad462f1a188e7d2b1112bfba5f35356 run #0: crashed: KASAN: slab-out-of-bounds Write in decode_data run #1: crashed: KASAN: slab-out-of-bounds Write in decode_data run #2: crashed: KASAN: slab-out-of-bounds Write in decode_data run #3: crashed: KASAN: slab-out-of-bounds Write in decode_data run #4: crashed: KASAN: slab-out-of-bounds Write in decode_data run #5: crashed: KASAN: slab-out-of-bounds Write in decode_data run #6: crashed: KASAN: slab-out-of-bounds Write in decode_data run #7: crashed: KASAN: use-after-free Write in decode_data run #8: crashed: KASAN: slab-out-of-bounds Write in decode_data run #9: crashed: KASAN: slab-out-of-bounds Write in decode_data run #10: crashed: KASAN: slab-out-of-bounds Write in decode_data run #11: crashed: KASAN: slab-out-of-bounds Write in decode_data run #12: crashed: KASAN: slab-out-of-bounds Write in decode_data run #13: crashed: KASAN: slab-out-of-bounds Write in decode_data run #14: crashed: KASAN: slab-out-of-bounds Write in decode_data run #15: crashed: KASAN: slab-out-of-bounds Write in decode_data run #16: crashed: KASAN: slab-out-of-bounds Write in decode_data run #17: crashed: KASAN: slab-out-of-bounds Write in decode_data run #18: crashed: KASAN: slab-out-of-bounds Write in decode_data run #19: crashed: KASAN: slab-out-of-bounds Write in decode_data testing current HEAD 78fec1611cbf7b0bdaddfdbf174a3a2463663bff testing commit 78fec1611cbf7b0bdaddfdbf174a3a2463663bff with gcc (GCC) 8.4.1 20210217 kernel signature: 8def9d3bdc7152c5d4a7f263f71e6f08770805177356a8d8f426637d4ceebc06 all runs: crashed: KASAN: slab-out-of-bounds Write in decode_data revisions tested: 2, total time: 22m20.046161216s (build: 15m47.196662028s, test: 6m10.927426575s) the crash still happens on HEAD commit msg: Linux 4.19.183 crash: KASAN: slab-out-of-bounds Write in decode_data IPv6: ADDRCONF(NETDEV_CHANGE): veth0_to_batadv: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready sp0: 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 ffff8881da4d5d4e by task kworker/u4:4/1075 CPU: 0 PID: 1075 Comm: kworker/u4:4 Not tainted 4.19.183-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/0x171 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 mm/kasan/report.c:412 [inline] kasan_report.cold.9+0x242/0x2fe mm/kasan/report.c:396 __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 drivers/net/hamradio/6pack.c:458 [inline] sixpack_receive_buf+0x722/0x1110 drivers/net/hamradio/6pack.c:435 tty_ldisc_receive_buf+0xff/0x1b0 drivers/tty/tty_buffer.c:460 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:2152 worker_thread+0x85/0xb60 kernel/workqueue.c:2295 kthread+0x347/0x410 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Allocated by task 7229: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc mm/kasan/kasan.c:553 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:531 __do_kmalloc_node mm/slab.c:3689 [inline] __kmalloc_node+0x50/0x70 mm/slab.c:3696 kmalloc_node include/linux/slab.h:557 [inline] kvmalloc_node+0x68/0x70 mm/util.c:423 kvmalloc include/linux/mm.h:577 [inline] kvzalloc include/linux/mm.h:585 [inline] alloc_netdev_mqs+0x5d/0xc80 net/core/dev.c:9144 sixpack_open+0xe7/0xbd0 drivers/net/hamradio/6pack.c:563 tty_ldisc_open.isra.3+0x65/0xa0 drivers/tty/tty_ldisc.c:469 tty_set_ldisc+0x249/0x5a0 drivers/tty/tty_ldisc.c:594 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 ksys_ioctl+0x62/0x90 fs/ioctl.c:705 __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 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 0: (stack is not available) The buggy address belongs to the object at ffff8881da4d49c0 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 910 bytes to the right of 4096-byte region [ffff8881da4d49c0, ffff8881da4d59c0) The buggy address belongs to the page: page:ffffea0007693500 count:1 mapcount:0 mapping:ffff8881f6400dc0 index:0x0 compound_mapcount: 0 flags: 0x17ffe0000008100(slab|head) raw: 017ffe0000008100 ffffea00076a1488 ffffea0007868d08 ffff8881f6400dc0 raw: 0000000000000000 ffff8881da4d49c0 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881da4d5c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881da4d5c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881da4d5d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8881da4d5d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881da4d5e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 7229 Comm: syz-executor.5 Tainted: G B 4.19.183-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:insert_entry fs/proc/proc_sysctl.c:153 [inline] RIP: 0010:insert_header+0x282/0xe00 fs/proc/proc_sysctl.c:232 Code: 48 85 db 0f 84 b3 00 00 00 48 8d 7b 18 48 89 f8 48 c1 e8 03 42 80 3c 38 00 0f 85 74 08 00 00 48 8b 43 18 48 89 c2 48 c1 ea 03 <42> 80 3c 3a 00 0f 85 49 08 00 00 48 8d 78 40 48 8b 10 48 89 f9 48 RSP: 0018:ffff8881da457570 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff8881da4d76d0 RCX: 0000000000000005 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8881da4d76e8 RBP: ffff8881da4575e8 R08: fffffbfff10cd805 R09: ffff8881dc324dd0 R10: fffffbfff10cd804 R11: ffffffff8866c023 R12: ffff8881d9607208 R13: ffff8881dc324dd0 R14: ffff8881d03b8850 R15: dffffc0000000000 FS: 00007f3f71ca2700(0000) GS:ffff8881f6800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000000053c000 CR3: 00000001d0291002 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __register_sysctl_table+0x5f8/0xde0 fs/proc/proc_sysctl.c:1345 register_net_sysctl+0x10/0x20 net/sysctl_net.c:120 neigh_sysctl_register+0x2f9/0x7e0 net/core/neighbour.c:3260 devinet_sysctl_register+0x8f/0x1e0 net/ipv4/devinet.c:2381 inetdev_init+0x1f7/0x410 net/ipv4/devinet.c:269 inetdev_event+0xa77/0xd70 net/ipv4/devinet.c:1477 notifier_call_chain+0x8a/0x160 kernel/notifier.c:93 __raw_notifier_call_chain kernel/notifier.c:394 [inline] raw_notifier_call_chain+0x11/0x20 kernel/notifier.c:401 call_netdevice_notifiers_info+0x28/0x60 net/core/dev.c:1744 call_netdevice_notifiers net/core/dev.c:1762 [inline] register_netdevice+0x8a1/0xf10 net/core/dev.c:8753 register_netdev+0x19/0x30 net/core/dev.c:8851 sixpack_open+0x89d/0xbd0 drivers/net/hamradio/6pack.c:628 tty_ldisc_open.isra.3+0x65/0xa0 drivers/tty/tty_ldisc.c:469 tty_set_ldisc+0x249/0x5a0 drivers/tty/tty_ldisc.c:594 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 ksys_ioctl+0x62/0x90 fs/ioctl.c:705 __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 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x463d89 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3f71ca2198 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000583 RCX: 0000000000463d89 RDX: 0000000020fd0ffc RSI: 0000000000005423 RDI: 0000000000000004 RBP: 0000000000000010 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000053bf00 R13: 00007f3f71ca26bc R14: 00000000ffffffff R15: 0000000000000003 Modules linked in: ---[ end trace 18800d622d873a3e ]--- RIP: 0010:insert_entry fs/proc/proc_sysctl.c:153 [inline] RIP: 0010:insert_header+0x282/0xe00 fs/proc/proc_sysctl.c:232 Code: 48 85 db 0f 84 b3 00 00 00 48 8d 7b 18 48 89 f8 48 c1 e8 03 42 80 3c 38 00 0f 85 74 08 00 00 48 8b 43 18 48 89 c2 48 c1 ea 03 <42> 80 3c 3a 00 0f 85 49 08 00 00 48 8d 78 40 48 8b 10 48 89 f9 48 RSP: 0018:ffff8881da457570 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff8881da4d76d0 RCX: 0000000000000005 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8881da4d76e8 RBP: ffff8881da4575e8 R08: fffffbfff10cd805 R09: ffff8881dc324dd0 R10: fffffbfff10cd804 R11: ffffffff8866c023 R12: ffff8881d9607208 R13: ffff8881dc324dd0 R14: ffff8881d03b8850 R15: dffffc0000000000 FS: 00007f3f71ca2700(0000) GS:ffff8881f6800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000000053c000 CR3: 00000001d0291002 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400