================================================================== BUG: KASAN: double-free or invalid-free in tcf_exts_destroy+0x53/0xb0 net/sched/cls_api.c:3002 CPU: 0 PID: 8462 Comm: syz-executor.3 Not tainted 5.5.0-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+0x128/0x182 lib/dump_stack.c:118 print_address_description.constprop.8.cold.10+0x9/0x317 mm/kasan/report.c:374 kasan_report_invalid_free+0x60/0xa0 mm/kasan/report.c:468 __kasan_slab_free+0x129/0x140 mm/kasan/common.c:453 __cache_free mm/slab.c:3426 [inline] kfree+0x107/0x2b0 mm/slab.c:3757 tcf_exts_destroy+0x53/0xb0 net/sched/cls_api.c:3002 tcf_exts_change+0xeb/0x140 net/sched/cls_api.c:3059 tcindex_set_parms+0xcce/0x1b90 net/sched/cls_tcindex.c:456 tcindex_change+0x1c2/0x280 net/sched/cls_tcindex.c:519 tc_new_tfilter+0xffa/0x1da0 net/sched/cls_api.c:2103 rtnetlink_rcv_msg+0x60c/0x8c0 net/core/rtnetlink.c:5429 netlink_rcv_skb+0x119/0x340 net/netlink/af_netlink.c:2477 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x434/0x630 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x714/0xc60 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xac/0xe0 net/socket.c:672 ____sys_sendmsg+0x54e/0x750 net/socket.c:2343 ___sys_sendmsg+0xe4/0x160 net/socket.c:2397 __sys_sendmsg+0xce/0x170 net/socket.c:2430 do_syscall_64+0xc6/0x5e0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45c849 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f66f1bbfc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f66f1bc06d4 RCX: 000000000045c849 RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000003 RBP: 000000000076bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000009fd R14: 00000000004ccb4d R15: 000000000076bf0c Allocated by task 7127: save_stack+0x19/0x80 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc.constprop.17+0xc1/0xd0 mm/kasan/common.c:513 __do_kmalloc mm/slab.c:3656 [inline] __kmalloc_track_caller+0x15c/0x7a0 mm/slab.c:3671 kmemdup+0x17/0x40 mm/util.c:127 kmemdup include/linux/string.h:453 [inline] neigh_parms_alloc+0x7a/0x420 net/core/neighbour.c:1615 ipv6_add_dev+0x287/0xed0 net/ipv6/addrconf.c:387 addrconf_notify+0x4d1/0x1ea0 net/ipv6/addrconf.c:3491 notifier_call_chain+0x86/0x150 kernel/notifier.c:83 call_netdevice_notifiers_extack net/core/dev.c:1955 [inline] call_netdevice_notifiers net/core/dev.c:1969 [inline] register_netdevice+0x60b/0xe30 net/core/dev.c:9411 register_netdev+0x15/0x30 net/core/dev.c:9504 ip6_tnl_init_net+0x420/0x6a0 net/ipv6/ip6_tunnel.c:2242 ops_init+0x92/0x350 net/core/net_namespace.c:137 setup_net+0x2c0/0x780 net/core/net_namespace.c:327 copy_net_ns+0x24d/0x490 net/core/net_namespace.c:468 create_new_namespaces+0x491/0x900 kernel/nsproxy.c:108 unshare_nsproxy_namespaces+0x82/0x1a0 kernel/nsproxy.c:229 ksys_unshare+0x321/0x6a0 kernel/fork.c:2955 __do_sys_unshare kernel/fork.c:3023 [inline] __se_sys_unshare kernel/fork.c:3021 [inline] __x64_sys_unshare+0x28/0x40 kernel/fork.c:3021 do_syscall_64+0xc6/0x5e0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 1: save_stack+0x19/0x80 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:335 [inline] __kasan_slab_free+0xf7/0x140 mm/kasan/common.c:474 __cache_free mm/slab.c:3426 [inline] kfree+0x107/0x2b0 mm/slab.c:3757 usb_start_wait_urb+0x194/0x260 drivers/usb/core/message.c:79 usb_internal_control_msg drivers/usb/core/message.c:101 [inline] usb_control_msg+0x305/0x4d0 drivers/usb/core/message.c:152 usb_get_string+0x94/0x120 drivers/usb/core/message.c:693 usb_string_sub+0xaa/0x380 drivers/usb/core/message.c:732 usb_string+0x27e/0x3d0 drivers/usb/core/message.c:836 usb_cache_string+0x5f/0xc0 drivers/usb/core/message.c:878 usb_enumerate_device drivers/usb/core/hub.c:2382 [inline] usb_new_device+0x1ae/0x6d0 drivers/usb/core/hub.c:2507 register_root_hub drivers/usb/core/hcd.c:1008 [inline] usb_add_hcd.cold.50+0xedd/0x11d9 drivers/usb/core/hcd.c:2790 dummy_hcd_probe+0x155/0x26c drivers/usb/gadget/udc/dummy_hcd.c:2639 platform_drv_probe+0x6b/0xf0 drivers/base/platform.c:727 really_probe+0x1f9/0x5e0 drivers/base/dd.c:551 driver_probe_device+0xc9/0x1b0 drivers/base/dd.c:724 bus_for_each_drv+0x117/0x1a0 drivers/base/bus.c:431 __device_attach+0x1be/0x2c0 drivers/base/dd.c:897 bus_probe_device+0x19e/0x250 drivers/base/bus.c:491 device_add+0x10d0/0x1900 drivers/base/core.c:2487 platform_device_add+0x2ad/0x5b0 drivers/base/platform.c:564 test_bit include/asm-generic/bitops/instrumented-non-atomic.h:110 [inline] init+0x3a3/0x767 arch/x86/crypto/chacha_glue.c:299 do_one_initcall+0xc3/0x580 init/main.c:939 do_initcall_level init/main.c:1007 [inline] do_initcalls init/main.c:1015 [inline] do_basic_setup init/main.c:1032 [inline] kernel_init_freeable+0x44d/0x4b9 init/main.c:1203 kernel_init+0x7/0x102 init/main.c:1110 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 The buggy address belongs to the object at ffff88809efc5900 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 16 bytes inside of 192-byte region [ffff88809efc5900, ffff88809efc59c0) The buggy address belongs to the page: page:ffffea00027bf140 refcount:1 mapcount:0 mapping:ffff8880aa400000 index:0x0 raw: 00fffe0000000200 ffffea00027bee88 ffffea00027a5688 ffff8880aa400000 raw: 0000000000000000 ffff88809efc5000 0000000100000010 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809efc5800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88809efc5880: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88809efc5900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88809efc5980: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88809efc5a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================