================================================================== BUG: KASAN: slab-use-after-free in qfq_reset_qdisc+0xf9/0x240 net/sched/sch_qfq.c:1484 Read of size 8 at addr ffff88803dc4a550 by task syz.0.0/5320 CPU: 0 UID: 0 PID: 5320 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 qfq_reset_qdisc+0xf9/0x240 net/sched/sch_qfq.c:1484 qdisc_reset+0x10f/0x580 net/sched/sch_generic.c:1038 __qdisc_destroy+0x120/0x420 net/sched/sch_generic.c:1077 qdisc_put net/sched/sch_generic.c:1109 [inline] dev_shutdown+0x34c/0x440 net/sched/sch_generic.c:1497 unregister_netdevice_many_notify+0x118c/0x2390 net/core/dev.c:12272 unregister_netdevice_many net/core/dev.c:12347 [inline] unregister_netdevice_queue+0x33c/0x380 net/core/dev.c:12161 unregister_netdevice include/linux/netdevice.h:3389 [inline] __tun_detach+0x6d9/0x15d0 drivers/net/tun.c:621 tun_detach drivers/net/tun.c:637 [inline] tun_chr_close+0x10a/0x1c0 drivers/net/tun.c:3436 __fput+0x44c/0xa70 fs/file_table.c:468 task_work_run+0x1d4/0x260 kernel/task_work.c:227 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop+0xe9/0x130 kernel/entry/common.c:43 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline] do_syscall_64+0x2bd/0xfa0 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f16f118efc9 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffdf4a3b5a8 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 00007f16f13e7da0 RCX: 00007f16f118efc9 RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 RBP: 00007f16f13e7da0 R08: 0000000000000000 R09: 00000012f4a3b89f R10: 0000000000dffd40 R11: 0000000000000246 R12: 0000000000012921 R13: 00007ffdf4a3b6a0 R14: ffffffffffffffff R15: 00007ffdf4a3b6c0 Allocated by task 5321: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:400 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:417 kasan_kmalloc include/linux/kasan.h:262 [inline] __kmalloc_cache_noprof+0x3d5/0x6f0 mm/slub.c:5755 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] qfq_change_class+0x67c/0x10a0 net/sched/sch_qfq.c:479 __tc_ctl_tclass net/sched/sch_api.c:2274 [inline] tc_ctl_tclass+0xaa0/0x1500 net/sched/sch_api.c:2304 rtnetlink_rcv_msg+0x77c/0xb70 net/core/rtnetlink.c:6963 netlink_rcv_skb+0x208/0x470 net/netlink/af_netlink.c:2552 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x82f/0x9e0 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:742 ____sys_sendmsg+0x505/0x830 net/socket.c:2630 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2684 __sys_sendmsg net/socket.c:2716 [inline] __do_sys_sendmsg net/socket.c:2721 [inline] __se_sys_sendmsg net/socket.c:2719 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2719 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5321: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 __kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:587 kasan_save_free_info mm/kasan/kasan.h:406 [inline] poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2530 [inline] slab_free mm/slub.c:6619 [inline] kfree+0x19a/0x6d0 mm/slub.c:6826 qfq_change_class+0xc60/0x10a0 net/sched/sch_qfq.c:533 __tc_ctl_tclass net/sched/sch_api.c:2274 [inline] tc_ctl_tclass+0xaa0/0x1500 net/sched/sch_api.c:2304 rtnetlink_rcv_msg+0x77c/0xb70 net/core/rtnetlink.c:6963 netlink_rcv_skb+0x208/0x470 net/netlink/af_netlink.c:2552 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x82f/0x9e0 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:742 ____sys_sendmsg+0x505/0x830 net/socket.c:2630 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2684 __sys_sendmsg net/socket.c:2716 [inline] __do_sys_sendmsg net/socket.c:2721 [inline] __se_sys_sendmsg net/socket.c:2719 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2719 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88803dc4a500 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 80 bytes inside of freed 128-byte region [ffff88803dc4a500, ffff88803dc4a580) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3dc4a ksm flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000000 ffff88801a041a00 ffffea0000fd3000 dead000000000003 raw: 0000000000000000 0000000080100010 00000000f5000000 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 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 1, tgid 1 (swapper/0), ts 22674141306, free_ts 22674128398 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3046 [inline] allocate_slab+0x96/0x3a0 mm/slub.c:3219 new_slab mm/slub.c:3273 [inline] ___slab_alloc+0xe94/0x18a0 mm/slub.c:4643 __slab_alloc+0x65/0x100 mm/slub.c:4762 __slab_alloc_node mm/slub.c:4838 [inline] slab_alloc_node mm/slub.c:5260 [inline] __do_kmalloc_node mm/slub.c:5633 [inline] __kmalloc_node_noprof+0x5cc/0x800 mm/slub.c:5640 kmalloc_node_noprof include/linux/slab.h:987 [inline] __vmalloc_area_node mm/vmalloc.c:3702 [inline] __vmalloc_node_range_noprof+0x5bb/0x12d0 mm/vmalloc.c:3897 __vmalloc_node_noprof mm/vmalloc.c:3960 [inline] vzalloc_noprof+0xb2/0xf0 mm/vmalloc.c:4034 tpg_alloc+0xa3/0x870 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:124 vivid_create_instance drivers/media/test-drivers/vivid/vivid-core.c:1857 [inline] vivid_probe+0x1b11/0x7180 drivers/media/test-drivers/vivid/vivid-core.c:2095 platform_probe+0xf9/0x190 drivers/base/platform.c:1405 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x26d/0x9e0 drivers/base/dd.c:659 __driver_probe_device+0x18c/0x2f0 drivers/base/dd.c:801 driver_probe_device+0x4f/0x430 drivers/base/dd.c:831 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2906 __kasan_populate_vmalloc mm/kasan/shadow.c:401 [inline] kasan_populate_vmalloc+0x256/0x270 mm/kasan/shadow.c:435 alloc_vmap_area+0xd7a/0x14c0 mm/vmalloc.c:2098 __get_vm_area_node+0x1f8/0x300 mm/vmalloc.c:3193 __vmalloc_node_range_noprof+0x30c/0x12d0 mm/vmalloc.c:3857 __vmalloc_node_noprof mm/vmalloc.c:3960 [inline] vzalloc_noprof+0xb2/0xf0 mm/vmalloc.c:4034 tpg_alloc+0xa3/0x870 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:124 vivid_create_instance drivers/media/test-drivers/vivid/vivid-core.c:1857 [inline] vivid_probe+0x1b11/0x7180 drivers/media/test-drivers/vivid/vivid-core.c:2095 platform_probe+0xf9/0x190 drivers/base/platform.c:1405 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x26d/0x9e0 drivers/base/dd.c:659 __driver_probe_device+0x18c/0x2f0 drivers/base/dd.c:801 driver_probe_device+0x4f/0x430 drivers/base/dd.c:831 __driver_attach+0x452/0x700 drivers/base/dd.c:1217 bus_for_each_dev+0x233/0x2b0 drivers/base/bus.c:370 bus_add_driver+0x345/0x640 drivers/base/bus.c:678 driver_register+0x23a/0x320 drivers/base/driver.c:249 Memory state around the buggy address: ffff88803dc4a400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 ffff88803dc4a480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88803dc4a500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803dc4a580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88803dc4a600: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc ==================================================================