================================================================== BUG: KASAN: slab-use-after-free in taprio_dump_tc_entries net/sched/sch_taprio.c:2231 [inline] BUG: KASAN: slab-use-after-free in taprio_dump+0xa7b/0xb90 net/sched/sch_taprio.c:2276 Read of size 4 at addr ffff8880264f74c0 by task syz-executor.5/15444 CPU: 0 PID: 15444 Comm: syz-executor.5 Not tainted 6.3.0-rc2-syzkaller-00047-g6015b1aca1a2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:319 print_report mm/kasan/report.c:430 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:536 taprio_dump_tc_entries net/sched/sch_taprio.c:2231 [inline] taprio_dump+0xa7b/0xb90 net/sched/sch_taprio.c:2276 tc_fill_qdisc+0x60b/0x1290 net/sched/sch_api.c:944 qdisc_notify.isra.0+0x2c7/0x330 net/sched/sch_api.c:1016 tc_modify_qdisc+0xfd7/0x1a40 net/sched/sch_api.c:1653 rtnetlink_rcv_msg+0x43d/0xd50 net/core/rtnetlink.c:6174 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2574 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x925/0xe30 net/netlink/af_netlink.c:1942 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0xde/0x190 net/socket.c:747 sock_no_sendpage+0x10c/0x160 net/core/sock.c:3235 kernel_sendpage.part.0+0x1d5/0x700 net/socket.c:3580 kernel_sendpage net/socket.c:3577 [inline] sock_sendpage+0xe7/0x180 net/socket.c:1080 pipe_to_sendpage+0x2b1/0x380 fs/splice.c:454 splice_from_pipe_feed fs/splice.c:508 [inline] __splice_from_pipe+0x449/0x8a0 fs/splice.c:652 splice_from_pipe fs/splice.c:687 [inline] generic_splice_sendpage+0xd8/0x140 fs/splice.c:835 do_splice_from fs/splice.c:856 [inline] do_splice+0xb5b/0x1960 fs/splice.c:1165 __do_splice+0x134/0x250 fs/splice.c:1230 __do_sys_splice fs/splice.c:1437 [inline] __se_sys_splice fs/splice.c:1419 [inline] __x64_sys_splice+0x19c/0x250 fs/splice.c:1419 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f29f8c88a39 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:00007f29f9e68188 EFLAGS: 00000246 ORIG_RAX: 0000000000000113 RAX: ffffffffffffffda RBX: 00007f29f8d8bf60 RCX: 00007f29f8c88a39 RDX: 0000000000000004 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 00007f29f8ce2c5f R08: 0000000000010976 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcef27024f R14: 00007f29f9e68300 R15: 0000000000022000 Allocated by task 15420: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] ____kasan_kmalloc mm/kasan/common.c:333 [inline] __kasan_kmalloc+0xa3/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:580 [inline] kzalloc include/linux/slab.h:720 [inline] taprio_change+0x612/0x47f0 net/sched/sch_taprio.c:1824 qdisc_change net/sched/sch_api.c:1356 [inline] tc_modify_qdisc+0xe4e/0x1a40 net/sched/sch_api.c:1651 rtnetlink_rcv_msg+0x43d/0xd50 net/core/rtnetlink.c:6174 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2574 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x925/0xe30 net/netlink/af_netlink.c:1942 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0xde/0x190 net/socket.c:747 sock_no_sendpage+0x10c/0x160 net/core/sock.c:3235 kernel_sendpage.part.0+0x1d5/0x700 net/socket.c:3580 kernel_sendpage net/socket.c:3577 [inline] sock_sendpage+0xe7/0x180 net/socket.c:1080 pipe_to_sendpage+0x2b1/0x380 fs/splice.c:454 splice_from_pipe_feed fs/splice.c:508 [inline] __splice_from_pipe+0x449/0x8a0 fs/splice.c:652 splice_from_pipe fs/splice.c:687 [inline] generic_splice_sendpage+0xd8/0x140 fs/splice.c:835 do_splice_from fs/splice.c:856 [inline] do_splice+0xb5b/0x1960 fs/splice.c:1165 __do_splice+0x134/0x250 fs/splice.c:1230 __do_sys_splice fs/splice.c:1437 [inline] __se_sys_splice fs/splice.c:1419 [inline] __x64_sys_splice+0x19c/0x250 fs/splice.c:1419 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 15441: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:521 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x13b/0x1a0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] __cache_free mm/slab.c:3390 [inline] __do_kmem_cache_free mm/slab.c:3577 [inline] __kmem_cache_free+0xcd/0x2c0 mm/slab.c:3584 rcu_do_batch kernel/rcu/tree.c:2112 [inline] rcu_core+0x814/0x1960 kernel/rcu/tree.c:2372 __do_softirq+0x1d4/0x905 kernel/softirq.c:571 Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0x7b/0x90 mm/kasan/generic.c:491 __call_rcu_common.constprop.0+0x99/0x7e0 kernel/rcu/tree.c:2622 taprio_change+0x30b4/0x47f0 net/sched/sch_taprio.c:1934 qdisc_change net/sched/sch_api.c:1356 [inline] tc_modify_qdisc+0xe4e/0x1a40 net/sched/sch_api.c:1651 rtnetlink_rcv_msg+0x43d/0xd50 net/core/rtnetlink.c:6174 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2574 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x925/0xe30 net/netlink/af_netlink.c:1942 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0xde/0x190 net/socket.c:747 sock_no_sendpage+0x10c/0x160 net/core/sock.c:3235 kernel_sendpage.part.0+0x1d5/0x700 net/socket.c:3580 kernel_sendpage net/socket.c:3577 [inline] sock_sendpage+0xe7/0x180 net/socket.c:1080 pipe_to_sendpage+0x2b1/0x380 fs/splice.c:454 splice_from_pipe_feed fs/splice.c:508 [inline] __splice_from_pipe+0x449/0x8a0 fs/splice.c:652 splice_from_pipe fs/splice.c:687 [inline] generic_splice_sendpage+0xd8/0x140 fs/splice.c:835 do_splice_from fs/splice.c:856 [inline] do_splice+0xb5b/0x1960 fs/splice.c:1165 __do_splice+0x134/0x250 fs/splice.c:1230 __do_sys_splice fs/splice.c:1437 [inline] __se_sys_splice fs/splice.c:1419 [inline] __x64_sys_splice+0x19c/0x250 fs/splice.c:1419 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0x7b/0x90 mm/kasan/generic.c:491 __call_rcu_common.constprop.0+0x99/0x7e0 kernel/rcu/tree.c:2622 taprio_change+0x30b4/0x47f0 net/sched/sch_taprio.c:1934 qdisc_change net/sched/sch_api.c:1356 [inline] tc_modify_qdisc+0xe4e/0x1a40 net/sched/sch_api.c:1651 rtnetlink_rcv_msg+0x43d/0xd50 net/core/rtnetlink.c:6174 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2574 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x925/0xe30 net/netlink/af_netlink.c:1942 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0xde/0x190 net/socket.c:747 sock_no_sendpage+0x10c/0x160 net/core/sock.c:3235 kernel_sendpage.part.0+0x1d5/0x700 net/socket.c:3580 kernel_sendpage net/socket.c:3577 [inline] sock_sendpage+0xe7/0x180 net/socket.c:1080 pipe_to_sendpage+0x2b1/0x380 fs/splice.c:454 splice_from_pipe_feed fs/splice.c:508 [inline] __splice_from_pipe+0x449/0x8a0 fs/splice.c:652 splice_from_pipe fs/splice.c:687 [inline] generic_splice_sendpage+0xd8/0x140 fs/splice.c:835 do_splice_from fs/splice.c:856 [inline] do_splice+0xb5b/0x1960 fs/splice.c:1165 __do_splice+0x134/0x250 fs/splice.c:1230 __do_sys_splice fs/splice.c:1437 [inline] __se_sys_splice fs/splice.c:1419 [inline] __x64_sys_splice+0x19c/0x250 fs/splice.c:1419 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8880264f7400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 192 bytes inside of freed 512-byte region [ffff8880264f7400, ffff8880264f7600) The buggy address belongs to the physical page: page:ffffea0000993dc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880264f7800 pfn:0x264f7 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffff888012440600 ffffea0000ac0e10 ffffea00008aa9d0 raw: ffff8880264f7800 ffff8880264f7000 0000000100000003 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 0x2420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 2199, tgid 2199 (kworker/u4:0), ts 11036747630, free_ts 11035616921 prep_new_page mm/page_alloc.c:2552 [inline] get_page_from_freelist+0x1190/0x2e20 mm/page_alloc.c:4325 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:5591 __alloc_pages_node include/linux/gfp.h:237 [inline] kmem_getpages mm/slab.c:1360 [inline] cache_grow_begin+0x9b/0x3b0 mm/slab.c:2570 cache_alloc_refill+0x27f/0x380 mm/slab.c:2943 ____cache_alloc mm/slab.c:3019 [inline] ____cache_alloc mm/slab.c:3002 [inline] __do_cache_alloc mm/slab.c:3202 [inline] slab_alloc_node mm/slab.c:3250 [inline] __kmem_cache_alloc_node+0x360/0x3f0 mm/slab.c:3541 kmalloc_trace+0x26/0xe0 mm/slab_common.c:1061 kmalloc include/linux/slab.h:580 [inline] kzalloc include/linux/slab.h:720 [inline] alloc_bprm+0x51/0x900 fs/exec.c:1511 kernel_execve+0xaf/0x500 fs/exec.c:1985 call_usermodehelper_exec_async+0x260/0x4e0 kernel/umh.c:110 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1453 [inline] free_pcp_prepare+0x5d5/0xa50 mm/page_alloc.c:1503 free_unref_page_prepare mm/page_alloc.c:3387 [inline] free_unref_page_list+0x176/0xbc0 mm/page_alloc.c:3528 release_pages+0xcd7/0x1380 mm/swap.c:1042 tlb_batch_pages_flush+0xa8/0x1a0 mm/mmu_gather.c:97 tlb_flush_mmu_free mm/mmu_gather.c:292 [inline] tlb_flush_mmu mm/mmu_gather.c:299 [inline] tlb_finish_mmu+0x14b/0x7e0 mm/mmu_gather.c:391 exit_mmap+0x205/0x690 mm/mmap.c:3047 __mmput+0x128/0x4c0 kernel/fork.c:1209 mmput+0x60/0x70 kernel/fork.c:1231 free_bprm+0x144/0x3e0 fs/exec.c:1489 kernel_execve+0x3fe/0x500 fs/exec.c:2022 call_usermodehelper_exec_async+0x260/0x4e0 kernel/umh.c:110 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Memory state around the buggy address: ffff8880264f7380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880264f7400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880264f7480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880264f7500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880264f7580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================