================================================================== BUG: KASAN: use-after-free in tcindex_set_parms net/sched/cls_tcindex.c:455 [inline] BUG: KASAN: use-after-free in tcindex_change+0x1c4d/0x2760 net/sched/cls_tcindex.c:519 Write of size 16 at addr ffff8880a9430430 by task syz-executor.2/8520 CPU: 0 PID: 8520 Comm: syz-executor.2 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+0x1e9/0x30e lib/dump_stack.c:118 print_address_description+0x74/0x5c0 mm/kasan/report.c:374 __kasan_report+0x14b/0x1c0 mm/kasan/report.c:506 kasan_report+0x25/0x50 mm/kasan/common.c:639 check_memory_region_inline mm/kasan/generic.c:182 [inline] check_memory_region+0x2a5/0x2e0 mm/kasan/generic.c:192 memcpy+0x38/0x50 mm/kasan/common.c:126 tcindex_set_parms net/sched/cls_tcindex.c:455 [inline] tcindex_change+0x1c4d/0x2760 net/sched/cls_tcindex.c:519 tc_new_tfilter+0x1490/0x2f50 net/sched/cls_api.c:2103 rtnetlink_rcv_msg+0x8fb/0xd40 net/core/rtnetlink.c:5429 netlink_rcv_skb+0x190/0x3a0 net/netlink/af_netlink.c:2477 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x786/0x940 net/netlink/af_netlink.c:1328 netlink_sendmsg+0xa57/0xd70 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg net/socket.c:672 [inline] ____sys_sendmsg+0x4f9/0x7c0 net/socket.c:2343 ___sys_sendmsg net/socket.c:2397 [inline] __sys_sendmsg+0x1ed/0x290 net/socket.c:2430 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45c8c9 Code: 2d 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 fb b5 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fe43a1e5c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fe43a1e66d4 RCX: 000000000045c8c9 RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000003 RBP: 000000000076bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000009f9 R14: 00000000004ccb91 R15: 000000000076bf0c Allocated by task 7197: save_stack mm/kasan/common.c:72 [inline] set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc+0x118/0x1c0 mm/kasan/common.c:513 __do_kmalloc mm/slab.c:3656 [inline] __kmalloc+0x24b/0x330 mm/slab.c:3665 kmalloc include/linux/slab.h:561 [inline] kzalloc+0x1d/0x40 include/linux/slab.h:670 lsm_cred_alloc security/security.c:532 [inline] security_prepare_creds+0x46/0x220 security/security.c:1586 prepare_creds+0x3dc/0x590 kernel/cred.c:285 set_current_groups kernel/groups.c:143 [inline] __do_sys_setgroups kernel/groups.c:210 [inline] __se_sys_setgroups+0x2dc/0x430 kernel/groups.c:190 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7204: save_stack mm/kasan/common.c:72 [inline] set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:335 [inline] __kasan_slab_free+0x12e/0x1e0 mm/kasan/common.c:474 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x220 mm/slab.c:3757 security_cred_free+0xbf/0x100 security/security.c:1580 put_cred_rcu+0xca/0x350 kernel/cred.c:114 rcu_do_batch kernel/rcu/tree.c:2186 [inline] rcu_core+0x7e4/0x1080 kernel/rcu/tree.c:2410 __do_softirq+0x268/0x7c5 kernel/softirq.c:292 The buggy address belongs to the object at ffff8880a9430400 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 48 bytes inside of 192-byte region [ffff8880a9430400, ffff8880a94304c0) The buggy address belongs to the page: page:ffffea0002a50c00 refcount:1 mapcount:0 mapping:ffff8880aa400000 index:0x0 raw: 00fffe0000000200 ffffea000263bf08 ffffea0002a28d48 ffff8880aa400000 raw: 0000000000000000 ffff8880a9430000 0000000100000010 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a9430300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880a9430380: 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880a9430400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a9430480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880a9430500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================