bisecting fixing commit since 4fccc2503536a564a4ba31a1d50439854201659f building syzkaller on 2c36e7a75f8689b3da20e1a81a2ee5391f3af6e5 testing commit 4fccc2503536a564a4ba31a1d50439854201659f with gcc (GCC) 8.4.1 20210217 kernel signature: f45ae528d7b35468a6e783e6ac5bd549c964362178ad5261c692967713edcda0 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: use-after-free Write in decode_data run #7: crashed: KASAN: slab-out-of-bounds 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 1e986fe9ad15b8406034c504afc5ae76f0a8e852 testing commit 1e986fe9ad15b8406034c504afc5ae76f0a8e852 with gcc (GCC) 8.4.1 20210217 kernel signature: 0dc1bb9ebe5d43b43be47c51b0060f31dec8aa94dc5b097e979518ee87132b90 run #0: crashed: KASAN: use-after-free 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: use-after-free Write in decode_data run #7: crashed: KASAN: slab-out-of-bounds Write in decode_data run #8: crashed: KASAN: use-after-free Write in decode_data run #9: crashed: KASAN: slab-out-of-bounds Write in decode_data revisions tested: 2, total time: 33m15.352409536s (build: 25m49.65822846s, test: 6m45.973404686s) the crash still happens on HEAD commit msg: Linux 4.19.191 crash: KASAN: slab-out-of-bounds Write in decode_data 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 ================================================================== 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 ffff8881dc6cb44e by task kworker/u4:1/23 CPU: 0 PID: 23 Comm: kworker/u4:1 Not tainted 4.19.191-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 sp1: Synchronizing with TNC kthread+0x347/0x410 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Allocated by task 7147: 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 ffff8881dc6ca0c0 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 910 bytes to the right of 4096-byte region [ffff8881dc6ca0c0, ffff8881dc6cb0c0) The buggy address belongs to the page: page:ffffea000771b280 count:1 mapcount:0 mapping:ffff8881f6400dc0 index:0x0 compound_mapcount: 0 flags: 0x17ffe0000008100(slab|head) raw: 017ffe0000008100 ffffea00076f3b88 ffffea000770a208 ffff8881f6400dc0 raw: 0000000000000000 ffff8881dc6ca0c0 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881dc6cb300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881dc6cb380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881dc6cb400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8881dc6cb480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881dc6cb500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ================================================================== BUG: KASAN: double-free or invalid-free in __rcu_reclaim kernel/rcu/rcu.h:231 [inline] BUG: KASAN: double-free or invalid-free in rcu_do_batch kernel/rcu/tree.c:2584 [inline] BUG: KASAN: double-free or invalid-free in invoke_rcu_callbacks kernel/rcu/tree.c:2897 [inline] BUG: KASAN: double-free or invalid-free in __rcu_process_callbacks kernel/rcu/tree.c:2864 [inline] BUG: KASAN: double-free or invalid-free in rcu_process_callbacks+0xce8/0x19a0 kernel/rcu/tree.c:2881 CPU: 1 PID: 18 Comm: ksoftirqd/1 Tainted: G B 4.19.191-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 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_invalid_free+0x64/0xa0 mm/kasan/report.c:336 __kasan_slab_free+0x13a/0x150 mm/kasan/kasan.c:501 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3503 [inline] kfree+0xcf/0x220 mm/slab.c:3822 __rcu_reclaim kernel/rcu/rcu.h:231 [inline] rcu_do_batch kernel/rcu/tree.c:2584 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2897 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2864 [inline] rcu_process_callbacks+0xce8/0x19a0 kernel/rcu/tree.c:2881 __do_softirq+0x25f/0x919 kernel/softirq.c:292 run_ksoftirqd kernel/softirq.c:653 [inline] run_ksoftirqd+0x94/0x100 kernel/softirq.c:645 smpboot_thread_fn+0x55f/0x8a0 kernel/smpboot.c:164 kthread+0x347/0x410 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Allocated by task 0: (stack is not available) Freed by task 0: (stack is not available) The buggy address belongs to the object at ffff8881d892c380 which belongs to the cache task_struct of size 6144 The buggy address is located 4848 bytes inside of 6144-byte region [ffff8881d892c380, ffff8881d892db80) kasan: CONFIG_KASAN_INLINE enabled The buggy address belongs to the page: kasan: GPF could be caused by NULL-ptr deref or user memory access page:ffffea0007624b00 count:1 mapcount:0 mapping:ffff8881f6539200 index:0x0 compound_mapcount: 0 general protection fault: 0000 [#1] PREEMPT SMP KASAN flags: 0x17ffe0000008100(slab|head) CPU: 0 PID: 9 Comm: ksoftirqd/0 Tainted: G B 4.19.191-syzkaller #0 raw: 017ffe0000008100 ffffea0007601a08 ffffea0007602c08 ffff8881f6539200 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 raw: 0000000000000000 ffff8881d892c380 0000000100000001 0000000000000000 RIP: 0010:rt6_check_dev net/ipv6/route.c:593 [inline] RIP: 0010:rt6_score_route+0x5c/0x2f0 net/ipv6/route.c:634 page dumped because: kasan: bad access detected Code: 80 3c 01 00 0f 85 92 02 00 00 49 8b 9c 24 b0 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 8d bb 08 01 00 00 48 89 f9 48 c1 e9 03 <0f> b6 04 01 84 c0 74 08 3c 03 0f 8e 42 02 00 00 3b b3 08 01 00 00 RSP: 0018:ffff8881f56d73d8 EFLAGS: 00010206 Memory state around the buggy address: RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000021 ffff8881d892d500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 RDX: 0000000000000003 RSI: 0000000000000033 RDI: 0000000000000108 ffff8881d892d580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 RBP: ffff8881f56d7400 R08: 0000000000000000 R09: ffff8881f56d7540 >ffff8881d892d600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R10: 0000000000000200 R11: 0000000000000033 R12: ffff8881dc6d41c0 ^ R13: 0000000000000003 R14: ffff8881f56d7540 R15: ffff8881dc6d4270 ffff8881d892d680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FS: 0000000000000000(0000) GS:ffff8881f6800000(0000) knlGS:0000000000000000 ffff8881d892d700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 ================================================================== CR2: 00007fff1adaed50 CR3: 000000000846d001 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: find_match net/ipv6/route.c:681 [inline] find_match+0x1bb/0xd90 net/ipv6/route.c:663 find_rr_leaf net/ipv6/route.c:736 [inline] rt6_select net/ipv6/route.c:769 [inline] fib6_table_lookup+0x53b/0xae0 net/ipv6/route.c:1876 ip6_pol_route+0x14b/0x960 net/ipv6/route.c:1909 ip6_pol_route_input+0x4f/0x80 net/ipv6/route.c:1978 fib6_rule_lookup+0x104/0x480 net/ipv6/fib6_rules.c:118 ip6_route_input_lookup+0x7e/0x90 net/ipv6/route.c:1990 ip6_route_input+0x4f2/0x830 net/ipv6/route.c:2125 ip6_rcv_finish_core.isra.15+0xce/0x420 net/ipv6/ip6_input.c:63 ip6_rcv_finish+0x138/0x2b0 net/ipv6/ip6_input.c:74 NF_HOOK include/linux/netfilter.h:289 [inline] NF_HOOK include/linux/netfilter.h:283 [inline] ipv6_rcv+0xfe/0x320 net/ipv6/ip6_input.c:273 __netif_receive_skb_one_core+0x112/0x1a0 net/core/dev.c:4954 __netif_receive_skb+0x1f/0x1b0 net/core/dev.c:5066 process_backlog+0x221/0x740 net/core/dev.c:5848 napi_poll net/core/dev.c:6272 [inline] net_rx_action+0x456/0xe40 net/core/dev.c:6338 __do_softirq+0x25f/0x919 kernel/softirq.c:292 run_ksoftirqd kernel/softirq.c:653 [inline] run_ksoftirqd+0x94/0x100 kernel/softirq.c:645 smpboot_thread_fn+0x55f/0x8a0 kernel/smpboot.c:164 kthread+0x347/0x410 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Modules linked in: ---[ end trace b93e412804c99174 ]--- RIP: 0010:rt6_check_dev net/ipv6/route.c:593 [inline] RIP: 0010:rt6_score_route+0x5c/0x2f0 net/ipv6/route.c:634 Code: 80 3c 01 00 0f 85 92 02 00 00 49 8b 9c 24 b0 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 8d bb 08 01 00 00 48 89 f9 48 c1 e9 03 <0f> b6 04 01 84 c0 74 08 3c 03 0f 8e 42 02 00 00 3b b3 08 01 00 00 kasan: CONFIG_KASAN_INLINE enabled RSP: 0018:ffff8881f56d73d8 EFLAGS: 00010206 kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#2] PREEMPT SMP KASAN RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000021 CPU: 1 PID: 18 Comm: ksoftirqd/1 Tainted: G B D 4.19.191-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:rt6_check_dev net/ipv6/route.c:593 [inline] RIP: 0010:rt6_score_route+0x5c/0x2f0 net/ipv6/route.c:634 Code: 80 3c 01 00 0f 85 92 02 00 00 49 8b 9c 24 b0 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 8d bb 08 01 00 00 48 89 f9 48 c1 e9 03 <0f> b6 04 01 84 c0 74 08 3c 03 0f 8e 42 02 00 00 3b b3 08 01 00 00 RDX: 0000000000000003 RSI: 0000000000000033 RDI: 0000000000000108 RSP: 0018:ffff8881f57473d8 EFLAGS: 00010206 RBP: ffff8881f56d7400 R08: 0000000000000000 R09: ffff8881f56d7540 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000021 RDX: 0000000000000003 RSI: 000000000000003b RDI: 0000000000000108 RBP: ffff8881f5747400 R08: 0000000000000000 R09: ffff8881f5747540 R10: 0000000000000200 R11: 000000000000003b R12: ffff8881dc6d41c0 R13: 0000000000000003 R14: ffff8881f5747540 R15: ffff8881dc6d4270 FS: 0000000000000000(0000) GS:ffff8881f6900000(0000) knlGS:0000000000000000 R10: 0000000000000200 R11: 0000000000000033 R12: ffff8881dc6d41c0 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fe09634b000 CR3: 000000000846d003 CR4: 00000000001606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: R13: 0000000000000003 R14: ffff8881f56d7540 R15: ffff8881dc6d4270 FS: 0000000000000000(0000) GS:ffff8881f6800000(0000) knlGS:0000000000000000 find_match net/ipv6/route.c:681 [inline] find_match+0x1bb/0xd90 net/ipv6/route.c:663 find_rr_leaf net/ipv6/route.c:736 [inline] rt6_select net/ipv6/route.c:769 [inline] fib6_table_lookup+0x53b/0xae0 net/ipv6/route.c:1876 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fff1adaed50 CR3: 000000000846d001 CR4: 00000000001606f0 ip6_pol_route+0x14b/0x960 net/ipv6/route.c:1909 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ip6_pol_route_input+0x4f/0x80 net/ipv6/route.c:1978 fib6_rule_lookup+0x104/0x480 net/ipv6/fib6_rules.c:118