bisecting fixing commit since 4fccc2503536a564a4ba31a1d50439854201659f building syzkaller on 2c36e7a75f8689b3da20e1a81a2ee5391f3af6e5 testing commit 4fccc2503536a564a4ba31a1d50439854201659f with gcc (GCC) 8.4.1 20210217 kernel signature: d987a7c7529ab15716619dfe5af86be2c4dce7d44e310ca52ee85ba30f3e701b all runs: crashed: KASAN: slab-out-of-bounds Write in decode_data testing current HEAD 2965db2e004cf9c92b87c1f559e9812c0ae878c1 testing commit 2965db2e004cf9c92b87c1f559e9812c0ae878c1 with gcc (GCC) 8.4.1 20210217 kernel signature: 1d4d2bef533d457397b89f9074190eb83e2e5374f04fa5e4d7740d9c5570aac9 all runs: crashed: KASAN: slab-out-of-bounds Write in decode_data revisions tested: 2, total time: 33m22.160809759s (build: 26m22.603921683s, test: 6m21.125202063s) the crash still happens on HEAD commit msg: Linux 4.19.188 crash: KASAN: slab-out-of-bounds Write in decode_data batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 sp0: Synchronizing with TNC batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! ================================================================== batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 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 ffff8881dc6cfdce by task kworker/u4:1/23 CPU: 0 PID: 23 Comm: kworker/u4:1 Not tainted 4.19.188-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 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! __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 batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 worker_thread+0x85/0xb60 kernel/workqueue.c:2295 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! kthread+0x347/0x410 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Allocated by task 7139: 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 IPv6: ADDRCONF(NETDEV_UP): batadv_slave_0: link is not ready kvmalloc include/linux/mm.h:577 [inline] kvzalloc include/linux/mm.h:585 [inline] alloc_netdev_mqs+0x5d/0xc80 net/core/dev.c:9144 batman_adv: batadv0: Interface activated: batadv_slave_0 sixpack_open+0xe7/0xbd0 drivers/net/hamradio/6pack.c:563 IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_0: link becomes ready tty_ldisc_open.isra.3+0x65/0xa0 drivers/tty/tty_ldisc.c:469 IPv6: ADDRCONF(NETDEV_CHANGE): veth0_to_batadv: link becomes ready 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 ffff8881dc6cea40 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 910 bytes to the right of 4096-byte region [ffff8881dc6cea40, ffff8881dc6cfa40) The buggy address belongs to the page: page:ffffea000771b380 count:1 mapcount:0 mapping:ffff8881f6400dc0 index:0x0 compound_mapcount: 0 flags: 0x17ffe0000008100(slab|head) raw: 017ffe0000008100 ffffea0007774d08 ffffea0007716008 ffff8881f6400dc0 IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_0: link becomes ready raw: 0000000000000000 ffff8881dc6cea40 0000000100000001 0000000000000000 IPv6: ADDRCONF(NETDEV_CHANGE): veth0_to_batadv: link becomes ready page dumped because: kasan: bad access detected sp1: Synchronizing with TNC Memory state around the buggy address: ffff8881dc6cfc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881dc6cfd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881dc6cfd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8881dc6cfe00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881dc6cfe80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! IPv6: ADDRCONF(NETDEV_UP): batadv_slave_1: link is not ready batman_adv: batadv0: Interface activated: batadv_slave_1 batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! IPv6: ADDRCONF(NETDEV_UP): batadv_slave_1: link is not ready batman_adv: batadv0: Interface activated: batadv_slave_1 IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth1_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 sp1: Synchronizing with TNC sp0: Synchronizing with TNC sp1: Synchronizing with TNC BUG: Bad rss-counter state mm:000000003cd99878 idx:0 val:27 BUG: Bad rss-counter state mm:00000000961f8ded idx:0 val:1 BUG: Bad rss-counter state mm:00000000961f8ded idx:1 val:5 sp0: Synchronizing with TNC sp1: Synchronizing with TNC ------------[ cut here ]------------ kernel BUG at arch/x86/mm/physaddr.c:27! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 5881 Comm: syz-executor.4 Tainted: G B 4.19.188-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:__phys_addr+0x6b/0xc0 arch/x86/mm/physaddr.c:27 Code: b6 14 11 48 89 f9 83 e1 07 38 ca 7f 04 84 d2 75 1b 0f b6 0d 20 55 f7 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 3a 0d 64 00 48 8b 45 f0 eb d6 48 c7 c7 10 50 RSP: 0018:ffff8881ea227ad0 EFLAGS: 00010087 RAX: 0000778000000000 RBX: 0000000080000000 RCX: 0000000000000058 RDX: 0000000000000001 RSI: 0000000000000003 RDI: 0000000000000000 RBP: ffff8881ea227ae0 R08: 000000000002bb40 R09: 0000000000000308 R10: ffffed103af1deee R11: ffff8881d78ef777 R12: 0000000000000000 R13: 0000000000000003 R14: 0000000000000003 R15: ffff8881d78ef768 FS: 0000000002a0b400(0000) GS:ffff8881f6800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f2ebb026074 CR3: 00000001cf53a006 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: build_cr3 arch/x86/include/asm/tlbflush.h:124 [inline] load_new_mm_cr3+0x21/0x200 arch/x86/mm/tlb.c:116 switch_mm_irqs_off+0x68d/0x1370 arch/x86/mm/tlb.c:396 context_switch kernel/sched/core.c:2816 [inline] __schedule+0xd04/0x1d40 kernel/sched/core.c:3517 schedule+0x7f/0x1b0 kernel/sched/core.c:3561 freezable_schedule include/linux/freezer.h:172 [inline] do_nanosleep+0x1f2/0x5d0 kernel/time/hrtimer.c:1709 hrtimer_nanosleep+0x1f7/0x550 kernel/time/hrtimer.c:1763 common_nsleep+0x15/0x20 kernel/time/posix-timers.c:1204 __do_sys_clock_nanosleep kernel/time/posix-timers.c:1231 [inline] __se_sys_clock_nanosleep kernel/time/posix-timers.c:1209 [inline] __x64_sys_clock_nanosleep+0x271/0x3e0 kernel/time/posix-timers.c:1209 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4883ca Code: 83 ff 03 74 3b 48 83 ec 28 b8 fa ff ff ff 83 ff 02 49 89 ca 0f 44 f8 64 8b 04 25 18 00 00 00 85 c0 75 2d b8 e6 00 00 00 0f 05 <89> c2 f7 da 3d 00 f0 ff ff b8 00 00 00 00 0f 47 c2 48 83 c4 28 c3 RSP: 002b:00007ffd49a3b540 EFLAGS: 00000246 ORIG_RAX: 00000000000000e6 RAX: ffffffffffffffda RBX: 0000000000001c75 RCX: 00000000004883ca RDX: 00007ffd49a3b580 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007ffd49a3b5fc R08: 00007ffd49bd2000 R09: 0000000c3280181c R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffd49a3b660 R13: 000000000000a812 R14: 000000000000a7df R15: 0000000000000007 Modules linked in: ---[ end trace 964671b72e89bccf ]--- RIP: 0010:__phys_addr+0x6b/0xc0 arch/x86/mm/physaddr.c:27 Code: b6 14 11 48 89 f9 83 e1 07 38 ca 7f 04 84 d2 75 1b 0f b6 0d 20 55 f7 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 3a 0d 64 00 48 8b 45 f0 eb d6 48 c7 c7 10 50 RSP: 0018:ffff8881ea227ad0 EFLAGS: 00010087 RAX: 0000778000000000 RBX: 0000000080000000 RCX: 0000000000000058 RDX: 0000000000000001 RSI: 0000000000000003 RDI: 0000000000000000 RBP: ffff8881ea227ae0 R08: 000000000002bb40 R09: 0000000000000308 R10: ffffed103af1deee R11: ffff8881d78ef777 R12: 0000000000000000 R13: 0000000000000003 R14: 0000000000000003 R15: ffff8881d78ef768 FS: 0000000002a0b400(0000) GS:ffff8881f6800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f2ebb026074 CR3: 00000001cf53a006 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400