bisecting fixing commit since 3906fe9bb7f1a2c8667ae54e967dc8690824f4ea building syzkaller on d50eb50a564f0774e935b4f77390e3f591b4206d testing commit 3906fe9bb7f1a2c8667ae54e967dc8690824f4ea compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 2f917dca446b149da9050fc35083dceaed727c8a914908d0bcdb67ea08e66b86 run #0: crashed: KASAN: use-after-free Read in dump_schedule run #1: crashed: KASAN: use-after-free Read in dump_schedule run #2: crashed: KASAN: use-after-free Read in dump_schedule run #3: crashed: KASAN: use-after-free Read in dump_schedule run #4: crashed: KASAN: use-after-free Read in dump_schedule run #5: crashed: KASAN: use-after-free Read in dump_schedule run #6: crashed: KASAN: use-after-free Read in dump_schedule run #7: crashed: KASAN: use-after-free Read in dump_schedule run #8: crashed: KASAN: use-after-free Read in dump_schedule run #9: crashed: KASAN: use-after-free Read in dump_schedule run #10: crashed: KASAN: use-after-free Read in dump_schedule run #11: crashed: KASAN: use-after-free Read in dump_schedule run #12: crashed: KASAN: use-after-free Read in dump_schedule run #13: OK run #14: OK run #15: OK run #16: OK run #17: OK run #18: OK run #19: OK testing current HEAD 23d04328444a8fa0ca060c5e532220dac8e8bc26 testing commit 23d04328444a8fa0ca060c5e532220dac8e8bc26 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: fa122d4c0ea66e8554f4b9493bf8483d279711725f7fa5d557c4e8638d8e86c0 run #0: crashed: KASAN: use-after-free Read in dump_schedule run #1: crashed: KASAN: use-after-free Read in dump_schedule run #2: crashed: KASAN: use-after-free Read in dump_schedule run #3: OK run #4: crashed: KASAN: use-after-free Read in dump_schedule run #5: OK run #6: OK run #7: OK run #8: OK run #9: OK reproducer seems to be flaky Reproducer flagged being flaky revisions tested: 2, total time: 36m14.998981809s (build: 13m5.60496674s, test: 22m14.437436717s) the crash still happens on HEAD commit msg: Merge tag 'for-5.17/parisc-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux crash: KASAN: use-after-free Read in dump_schedule ================================================================== BUG: KASAN: use-after-free in dump_schedule+0x68e/0x6f0 net/sched/sch_taprio.c:1848 Read of size 8 at addr ffff888061087ac0 by task syz-executor390/7232 CPU: 0 PID: 7232 Comm: syz-executor390 Not tainted 5.17.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x57/0x7d lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x336 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 dump_schedule+0x68e/0x6f0 net/sched/sch_taprio.c:1848 taprio_dump+0x431/0xb70 net/sched/sch_taprio.c:1917 tc_fill_qdisc+0x570/0xf60 net/sched/sch_api.c:924 qdisc_notify.isra.0+0x22b/0x2a0 net/sched/sch_api.c:990 tc_modify_qdisc+0xc4d/0x1680 net/sched/sch_api.c:1633 rtnetlink_rcv_msg+0x31d/0x8d0 net/core/rtnetlink.c:5596 netlink_rcv_skb+0x118/0x370 net/netlink/af_netlink.c:2494 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x430/0x700 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x770/0xc10 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:725 sock_no_sendpage+0xea/0x130 net/core/sock.c:3091 kernel_sendpage.part.0+0x121/0x250 net/socket.c:3492 kernel_sendpage net/socket.c:3489 [inline] sock_sendpage+0xc7/0x1a0 net/socket.c:1007 pipe_to_sendpage+0x245/0x410 fs/splice.c:364 splice_from_pipe_feed fs/splice.c:418 [inline] __splice_from_pipe+0x362/0x810 fs/splice.c:562 splice_from_pipe fs/splice.c:597 [inline] generic_splice_sendpage+0xba/0x120 fs/splice.c:746 do_splice_from fs/splice.c:767 [inline] do_splice+0x9ef/0x1b30 fs/splice.c:1079 __do_splice+0xf4/0x1b0 fs/splice.c:1144 __do_sys_splice fs/splice.c:1350 [inline] __se_sys_splice fs/splice.c:1332 [inline] __x64_sys_splice+0x14a/0x200 fs/splice.c:1332 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f1d6f928c99 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 31 19 00 00 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 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f1d6faccc88 EFLAGS: 00000246 ORIG_RAX: 0000000000000113 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f1d6f928c99 RDX: 0000000000000004 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000000010976 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f1d6facccc8 R13: 00007f1d6faccce0 R14: 00007f1d6faccd20 R15: 0000000000002202 Allocated by task 7226: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:524 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:714 [inline] taprio_change+0x51b/0x3a80 net/sched/sch_taprio.c:1484 qdisc_change net/sched/sch_api.c:1329 [inline] tc_modify_qdisc+0xafd/0x1680 net/sched/sch_api.c:1631 rtnetlink_rcv_msg+0x31d/0x8d0 net/core/rtnetlink.c:5596 netlink_rcv_skb+0x118/0x370 net/netlink/af_netlink.c:2494 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x430/0x700 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x770/0xc10 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:725 sock_no_sendpage+0xea/0x130 net/core/sock.c:3091 kernel_sendpage.part.0+0x121/0x250 net/socket.c:3492 kernel_sendpage net/socket.c:3489 [inline] sock_sendpage+0xc7/0x1a0 net/socket.c:1007 pipe_to_sendpage+0x245/0x410 fs/splice.c:364 splice_from_pipe_feed fs/splice.c:418 [inline] __splice_from_pipe+0x362/0x810 fs/splice.c:562 splice_from_pipe fs/splice.c:597 [inline] generic_splice_sendpage+0xba/0x120 fs/splice.c:746 do_splice_from fs/splice.c:767 [inline] do_splice+0x9ef/0x1b30 fs/splice.c:1079 __do_splice+0xf4/0x1b0 fs/splice.c:1144 __do_sys_splice fs/splice.c:1350 [inline] __se_sys_splice fs/splice.c:1332 [inline] __x64_sys_splice+0x14a/0x200 fs/splice.c:1332 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 7232: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x126/0x160 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:236 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754 slab_free mm/slub.c:3509 [inline] kfree+0xd0/0x390 mm/slub.c:4562 rcu_do_batch kernel/rcu/tree.c:2527 [inline] rcu_core+0x7b1/0x1820 kernel/rcu/tree.c:2778 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3026 [inline] call_rcu+0xb1/0x740 kernel/rcu/tree.c:3106 taprio_change+0x259a/0x3a80 net/sched/sch_taprio.c:1604 qdisc_change net/sched/sch_api.c:1329 [inline] tc_modify_qdisc+0xafd/0x1680 net/sched/sch_api.c:1631 rtnetlink_rcv_msg+0x31d/0x8d0 net/core/rtnetlink.c:5596 netlink_rcv_skb+0x118/0x370 net/netlink/af_netlink.c:2494 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x430/0x700 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x770/0xc10 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:725 sock_no_sendpage+0xea/0x130 net/core/sock.c:3091 kernel_sendpage.part.0+0x121/0x250 net/socket.c:3492 kernel_sendpage net/socket.c:3489 [inline] sock_sendpage+0xc7/0x1a0 net/socket.c:1007 pipe_to_sendpage+0x245/0x410 fs/splice.c:364 splice_from_pipe_feed fs/splice.c:418 [inline] __splice_from_pipe+0x362/0x810 fs/splice.c:562 splice_from_pipe fs/splice.c:597 [inline] generic_splice_sendpage+0xba/0x120 fs/splice.c:746 do_splice_from fs/splice.c:767 [inline] do_splice+0x9ef/0x1b30 fs/splice.c:1079 __do_splice+0xf4/0x1b0 fs/splice.c:1144 __do_sys_splice fs/splice.c:1350 [inline] __se_sys_splice fs/splice.c:1332 [inline] __x64_sys_splice+0x14a/0x200 fs/splice.c:1332 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3026 [inline] call_rcu+0xb1/0x740 kernel/rcu/tree.c:3106 taprio_change+0x259a/0x3a80 net/sched/sch_taprio.c:1604 qdisc_change net/sched/sch_api.c:1329 [inline] tc_modify_qdisc+0xafd/0x1680 net/sched/sch_api.c:1631 rtnetlink_rcv_msg+0x31d/0x8d0 net/core/rtnetlink.c:5596 netlink_rcv_skb+0x118/0x370 net/netlink/af_netlink.c:2494 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x430/0x700 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x770/0xc10 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:725 sock_no_sendpage+0xea/0x130 net/core/sock.c:3091 kernel_sendpage.part.0+0x121/0x250 net/socket.c:3492 kernel_sendpage net/socket.c:3489 [inline] sock_sendpage+0xc7/0x1a0 net/socket.c:1007 pipe_to_sendpage+0x245/0x410 fs/splice.c:364 splice_from_pipe_feed fs/splice.c:418 [inline] __splice_from_pipe+0x362/0x810 fs/splice.c:562 splice_from_pipe fs/splice.c:597 [inline] generic_splice_sendpage+0xba/0x120 fs/splice.c:746 do_splice_from fs/splice.c:767 [inline] do_splice+0x9ef/0x1b30 fs/splice.c:1079 __do_splice+0xf4/0x1b0 fs/splice.c:1144 __do_sys_splice fs/splice.c:1350 [inline] __se_sys_splice fs/splice.c:1332 [inline] __x64_sys_splice+0x14a/0x200 fs/splice.c:1332 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff888061087a80 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 64 bytes inside of 96-byte region [ffff888061087a80, ffff888061087ae0) The buggy address belongs to the page: page:ffffea00018421c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x61087 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea00007da7c0 dead000000000002 ffff88800fc41780 raw: 0000000000000000 0000000000200020 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 3939, ts 59112571770, free_ts 59112429262 prep_new_page mm/page_alloc.c:2434 [inline] get_page_from_freelist+0xa6f/0x2f10 mm/page_alloc.c:4165 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5389 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab+0x27f/0x3c0 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0xbe3/0x12a0 mm/slub.c:3018 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105 slab_alloc_node mm/slub.c:3196 [inline] slab_alloc mm/slub.c:3238 [inline] __kmalloc_track_caller+0x35a/0x430 mm/slub.c:4926 kmemdup+0x1a/0x40 mm/util.c:128 kmemdup include/linux/fortify-string.h:304 [inline] xt_register_table+0x142/0x6d0 net/netfilter/x_tables.c:1461 ip6t_register_table+0x127/0x320 net/ipv6/netfilter/ip6_tables.c:1752 ip6table_nat_table_init+0x3d/0x360 net/ipv6/netfilter/ip6table_nat.c:116 xt_find_table_lock+0x2d8/0x500 net/netfilter/x_tables.c:1259 xt_request_find_table_lock+0x17/0xa0 net/netfilter/x_tables.c:1284 get_info+0x128/0x5f0 net/ipv6/netfilter/ip6_tables.c:981 do_ip6t_get_ctl+0x125/0x800 net/ipv6/netfilter/ip6_tables.c:1663 nf_getsockopt+0x57/0xb0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x137/0x1c0 net/ipv6/ipv6_sockglue.c:1502 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1352 [inline] free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1404 free_unref_page_prepare mm/page_alloc.c:3325 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3404 __vunmap+0x5af/0x9e0 mm/vmalloc.c:2635 copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:884 [inline] get_entries net/ipv6/netfilter/ip6_tables.c:1041 [inline] do_ip6t_get_ctl+0x66a/0x800 net/ipv6/netfilter/ip6_tables.c:1672 nf_getsockopt+0x57/0xb0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x137/0x1c0 net/ipv6/ipv6_sockglue.c:1502 __sys_getsockopt+0x1a8/0x550 net/socket.c:2224 __do_sys_getsockopt net/socket.c:2239 [inline] __se_sys_getsockopt net/socket.c:2236 [inline] __x64_sys_getsockopt+0xb5/0x150 net/socket.c:2236 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff888061087980: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff888061087a00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc >ffff888061087a80: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff888061087b00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff888061087b80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ==================================================================