================================================================== BUG: KASAN: slab-use-after-free in taprio_dump_tc_entries net/sched/sch_taprio.c:2288 [inline] BUG: KASAN: slab-use-after-free in taprio_dump+0x857/0xd50 net/sched/sch_taprio.c:2401 Read of size 4 at addr ffff88807e3ed0c0 by task syz-executor.0/12494 CPU: 0 PID: 12494 Comm: syz-executor.0 Not tainted 6.9.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 taprio_dump_tc_entries net/sched/sch_taprio.c:2288 [inline] taprio_dump+0x857/0xd50 net/sched/sch_taprio.c:2401 tc_fill_qdisc+0x6a9/0x1210 net/sched/sch_api.c:952 qdisc_notify+0x2ec/0x4b0 net/sched/sch_api.c:1053 tc_modify_qdisc+0x1bfa/0x1de0 net/sched/sch_api.c:1748 rtnetlink_rcv_msg+0x89b/0x10d0 net/core/rtnetlink.c:6595 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2559 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x8e1/0xcb0 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:745 ____sys_sendmsg+0x525/0x7d0 net/socket.c:2584 ___sys_sendmsg net/socket.c:2638 [inline] __sys_sendmsg+0x2b0/0x3a0 net/socket.c:2667 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x88/0x170 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7fcf4aa7dda9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fcf4b71a0c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fcf4ababf80 RCX: 00007fcf4aa7dda9 RDX: 0000000000000000 RSI: 00000000200007c0 RDI: 0000000000000004 RBP: 00007fcf4aaca47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fcf4ababf80 R15: 00007ffcb206b8a8 Allocated by task 12488: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x7d/0x90 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] kmalloc_trace+0x1d6/0x320 mm/slub.c:3997 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] taprio_change+0x1030/0x42d0 net/sched/sch_taprio.c:1862 qdisc_change net/sched/sch_api.c:1416 [inline] tc_modify_qdisc+0x18af/0x1de0 net/sched/sch_api.c:1746 rtnetlink_rcv_msg+0x89b/0x10d0 net/core/rtnetlink.c:6595 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2559 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x8e1/0xcb0 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:745 ____sys_sendmsg+0x525/0x7d0 net/socket.c:2584 ___sys_sendmsg net/socket.c:2638 [inline] __sys_sendmsg+0x2b0/0x3a0 net/socket.c:2667 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x88/0x170 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x76/0x7e Freed by task 5373: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xa6/0xe0 mm/kasan/common.c:240 __kasan_slab_free+0x12/0x30 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2106 [inline] slab_free mm/slub.c:4280 [inline] kfree+0x134/0x370 mm/slub.c:4390 rcu_do_batch kernel/rcu/tree.c:2196 [inline] rcu_core+0xafd/0x1810 kernel/rcu/tree.c:2471 __do_softirq+0x2cc/0x97c kernel/softirq.c:554 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack mm/kasan/generic.c:541 [inline] kasan_record_aux_stack_noalloc+0x84/0x90 mm/kasan/generic.c:551 __call_rcu_common kernel/rcu/tree.c:2734 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:2838 taprio_change+0x32d9/0x42d0 net/sched/sch_taprio.c:1972 qdisc_change net/sched/sch_api.c:1416 [inline] tc_modify_qdisc+0x18af/0x1de0 net/sched/sch_api.c:1746 rtnetlink_rcv_msg+0x89b/0x10d0 net/core/rtnetlink.c:6595 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2559 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x8e1/0xcb0 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:745 ____sys_sendmsg+0x525/0x7d0 net/socket.c:2584 ___sys_sendmsg net/socket.c:2638 [inline] __sys_sendmsg+0x2b0/0x3a0 net/socket.c:2667 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x88/0x170 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x76/0x7e The buggy address belongs to the object at ffff88807e3ed000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 192 bytes inside of freed 512-byte region [ffff88807e3ed000, ffff88807e3ed200) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807e3ec400 pfn:0x7e3ec head: order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff80000000840(slab|head|node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffffff() raw: 00fff80000000840 ffff888014841c80 0000000000000000 dead000000000001 raw: ffff88807e3ec400 000000008010000f 00000001ffffffff 0000000000000000 head: 00fff80000000840 ffff888014841c80 0000000000000000 dead000000000001 head: ffff88807e3ec400 000000008010000f 00000001ffffffff 0000000000000000 head: 00fff80000000002 ffffea0001f8fb01 dead000000000122 00000000ffffffff head: 0000000400000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5023, tgid -1476527657 (syz-executor.0), ts 5023, free_ts 54357913027 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0x33de/0x3570 mm/page_alloc.c:3317 __alloc_pages+0x256/0x6b0 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page+0x5f/0x160 mm/slub.c:2175 allocate_slab mm/slub.c:2338 [inline] new_slab+0x84/0x2f0 mm/slub.c:2391 ___slab_alloc+0xcec/0x1240 mm/slub.c:3525 __slab_alloc mm/slub.c:3610 [inline] __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] kmalloc_trace+0x264/0x320 mm/slub.c:3992 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] inetdev_init+0x7e/0x480 net/ipv4/devinet.c:269 inetdev_event+0x344/0x15c0 net/ipv4/devinet.c:1560 notifier_call_chain+0x19f/0x3d0 kernel/notifier.c:93 call_netdevice_notifiers_extack net/core/dev.c:1988 [inline] call_netdevice_notifiers net/core/dev.c:2002 [inline] register_netdevice+0x154b/0x19b0 net/core/dev.c:10316 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:376 [inline] nsim_create+0x39c/0x480 drivers/net/netdevsim/netdev.c:434 __nsim_dev_port_add+0x6c0/0xae0 drivers/net/netdevsim/dev.c:1390 nsim_dev_port_add_all+0x33/0xf0 drivers/net/netdevsim/dev.c:1446 nsim_drv_probe+0x85f/0xb80 drivers/net/netdevsim/dev.c:1604 really_probe+0x2b8/0xad0 drivers/base/dd.c:656 __driver_probe_device+0x1a2/0x390 drivers/base/dd.c:798 page last free pid 5023 tgid 5023 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x96d/0xa80 mm/page_alloc.c:2347 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2487 stack_depot_save_flags+0x6f0/0x810 lib/stackdepot.c:673 kasan_save_stack mm/kasan/common.c:48 [inline] kasan_save_track+0x51/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x7d/0x90 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] kmalloc_trace+0x1d6/0x320 mm/slub.c:3997 kmalloc include/linux/slab.h:628 [inline] netdevice_queue_work drivers/infiniband/core/roce_gid_mgmt.c:643 [inline] netdevice_event+0x3b7/0x9c0 drivers/infiniband/core/roce_gid_mgmt.c:802 notifier_call_chain+0x19f/0x3d0 kernel/notifier.c:93 call_netdevice_notifiers_extack net/core/dev.c:1988 [inline] call_netdevice_notifiers net/core/dev.c:2002 [inline] register_netdevice+0x154b/0x19b0 net/core/dev.c:10316 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:376 [inline] nsim_create+0x39c/0x480 drivers/net/netdevsim/netdev.c:434 __nsim_dev_port_add+0x6c0/0xae0 drivers/net/netdevsim/dev.c:1390 nsim_dev_port_add_all+0x33/0xf0 drivers/net/netdevsim/dev.c:1446 nsim_drv_probe+0x85f/0xb80 drivers/net/netdevsim/dev.c:1604 really_probe+0x2b8/0xad0 drivers/base/dd.c:656 __driver_probe_device+0x1a2/0x390 drivers/base/dd.c:798 driver_probe_device+0x50/0x430 drivers/base/dd.c:828 Memory state around the buggy address: ffff88807e3ecf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807e3ed000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807e3ed080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807e3ed100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807e3ed180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================