================================================================== BUG: KASAN: use-after-free in inc_rlimit_ucounts+0x7a/0x1f0 kernel/ucount.c:257 Read of size 8 at addr ffff888028bb8410 by task syz-executor.1/30184 CPU: 0 PID: 30184 Comm: syz-executor.1 Not tainted 5.13.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:79 [inline] dump_stack_lvl+0x1ae/0x29f lib/dump_stack.c:96 print_address_description+0x66/0x3b0 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report+0x163/0x210 mm/kasan/report.c:436 inc_rlimit_ucounts+0x7a/0x1f0 kernel/ucount.c:257 __sigqueue_alloc+0x24c/0x540 kernel/signal.c:428 __send_signal+0x213/0xe50 kernel/signal.c:1116 force_sig_info_to_task+0x2a4/0x3f0 kernel/signal.c:1337 force_sig_fault_to_task kernel/signal.c:1676 [inline] force_sig_fault+0x11e/0x1c0 kernel/signal.c:1683 __bad_area_nosemaphore+0x390/0x570 arch/x86/mm/fault.c:840 do_kern_addr_fault arch/x86/mm/fault.c:1200 [inline] handle_page_fault arch/x86/mm/fault.c:1473 [inline] exc_page_fault+0x153/0x1e0 arch/x86/mm/fault.c:1531 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:568 RIP: 0033:0x404677 Code: 38 5d 41 5c c3 48 8d 3d e3 a4 0b 00 e8 12 fb ff ff 48 8d 3d e5 a4 0b 00 e8 06 fb ff ff 66 0f 1f 44 00 00 55 48 8b 76 10 89 fd <64> 8b 14 25 b8 ff ff ff 48 8d 86 00 00 f0 ff 48 3d 00 00 30 06 76 RSP: 002b:00007fda2df44ab0 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 000000000056bf80 RCX: 000000000056bf80 RDX: 00007fda2df44ac0 RSI: ffffffffffffffb8 RDI: 000000000000000b RBP: 000000000000000b R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffd294af80f R14: 00007fda2df46300 R15: 0000000000022000 Allocated by task 30142: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xc4/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:263 [inline] kmem_cache_alloc_trace+0x96/0x340 mm/slub.c:2997 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] alloc_ucounts+0x176/0x420 kernel/ucount.c:169 set_cred_ucounts kernel/cred.c:684 [inline] copy_creds+0xb3c/0xd70 kernel/cred.c:375 copy_process+0xbae/0x5b30 kernel/fork.c:1992 kernel_clone+0x21a/0x7d0 kernel/fork.c:2509 __do_sys_clone kernel/fork.c:2626 [inline] __se_sys_clone kernel/fork.c:2610 [inline] __x64_sys_clone+0x236/0x2b0 kernel/fork.c:2610 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 30184: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x3d/0x70 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0x109/0x150 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:229 [inline] slab_free_hook mm/slub.c:1639 [inline] slab_free_freelist_hook+0x1d8/0x290 mm/slub.c:1664 slab_free mm/slub.c:3224 [inline] kfree+0xcf/0x2d0 mm/slub.c:4268 __sigqueue_free kernel/signal.c:455 [inline] dequeue_synchronous_signal kernel/signal.c:745 [inline] get_signal+0xadf/0x20d0 kernel/signal.c:2676 arch_do_signal_or_restart+0x8e/0x6d0 arch/x86/kernel/signal.c:789 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x191/0x220 kernel/entry/common.c:209 irqentry_exit_to_user_mode+0x6/0x40 kernel/entry/common.c:315 exc_page_fault+0xe0/0x1e0 arch/x86/mm/fault.c:1534 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:568 Last potentially related work creation: kasan_save_stack+0x27/0x50 mm/kasan/common.c:38 kasan_record_aux_stack+0xee/0x120 mm/kasan/generic.c:348 insert_work+0x54/0x400 kernel/workqueue.c:1332 __queue_work+0x90e/0xc40 kernel/workqueue.c:1498 queue_work_on+0x111/0x200 kernel/workqueue.c:1525 queue_work include/linux/workqueue.h:507 [inline] call_usermodehelper_exec+0x283/0x470 kernel/umh.c:435 kobject_uevent_env+0x1337/0x1700 lib/kobject_uevent.c:618 rx_queue_add_kobject net/core/net-sysfs.c:1020 [inline] net_rx_queue_update_kobjects+0x20f/0x4a0 net/core/net-sysfs.c:1060 register_queue_kobjects net/core/net-sysfs.c:1711 [inline] netdev_register_kobject+0x222/0x310 net/core/net-sysfs.c:1959 register_netdevice+0x12a1/0x1c20 net/core/dev.c:10315 __ip_tunnel_create+0x2a0/0x360 net/ipv4/ip_tunnel.c:267 ip_tunnel_init_net+0x217/0x6f0 net/ipv4/ip_tunnel.c:1060 ops_init+0x327/0x410 net/core/net_namespace.c:140 setup_net+0x35b/0x9d0 net/core/net_namespace.c:333 copy_net_ns+0x392/0x5e0 net/core/net_namespace.c:474 create_new_namespaces+0x4ce/0xa00 kernel/nsproxy.c:110 copy_namespaces+0x2f6/0x350 kernel/nsproxy.c:178 copy_process+0x23a4/0x5b30 kernel/fork.c:2122 kernel_clone+0x21a/0x7d0 kernel/fork.c:2509 __do_sys_clone kernel/fork.c:2626 [inline] __se_sys_clone kernel/fork.c:2610 [inline] __x64_sys_clone+0x236/0x2b0 kernel/fork.c:2610 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Second to last potentially related work creation: kasan_save_stack+0x27/0x50 mm/kasan/common.c:38 kasan_record_aux_stack+0xee/0x120 mm/kasan/generic.c:348 kvfree_call_rcu+0x114/0x7a0 kernel/rcu/tree.c:3597 fib_rule_put include/net/fib_rules.h:134 [inline] fib_rules_cleanup_ops net/core/fib_rules.c:194 [inline] fib_rules_unregister+0x2af/0x370 net/core/fib_rules.c:206 ip6mr_rules_exit+0x1e7/0x200 net/ipv6/ip6mr.c:266 ip6mr_net_exit+0x71/0xc0 net/ipv6/ip6mr.c:1344 ops_exit_list net/core/net_namespace.c:175 [inline] cleanup_net+0x758/0xc60 net/core/net_namespace.c:595 process_one_work+0x833/0x10c0 kernel/workqueue.c:2276 worker_thread+0xac1/0x1320 kernel/workqueue.c:2422 kthread+0x453/0x480 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff888028bb8400 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 16 bytes inside of 192-byte region [ffff888028bb8400, ffff888028bb84c0) The buggy address belongs to the page: page:ffffea0000a2ee00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x28bb8 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea000062d680 0000000500000002 ffff888011841a00 raw: 0000000000000000 0000000000100010 00000001ffffffff 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 19135, ts 415648730122, free_ts 415646972903 prep_new_page mm/page_alloc.c:2445 [inline] get_page_from_freelist+0x779/0xa30 mm/page_alloc.c:4178 __alloc_pages+0x26c/0x5f0 mm/page_alloc.c:5386 alloc_slab_page mm/slub.c:1702 [inline] allocate_slab+0xf1/0x540 mm/slub.c:1842 new_slab mm/slub.c:1905 [inline] new_slab_objects mm/slub.c:2651 [inline] ___slab_alloc+0x1cf/0x350 mm/slub.c:2814 __slab_alloc mm/slub.c:2854 [inline] slab_alloc_node mm/slub.c:2936 [inline] __kmalloc_node+0x310/0x430 mm/slub.c:4154 kmalloc_node include/linux/slab.h:614 [inline] kvmalloc_node+0x81/0xf0 mm/util.c:587 kvmalloc include/linux/mm.h:798 [inline] kvzalloc include/linux/mm.h:806 [inline] bucket_table_alloc lib/rhashtable.c:184 [inline] rhashtable_init+0x515/0xc40 lib/rhashtable.c:1061 rhltable_init+0x18/0x60 lib/rhashtable.c:1090 mr_table_alloc+0xf1/0x250 net/ipv4/ipmr_base.c:48 ip6mr_new_table net/ipv6/ip6mr.c:387 [inline] ip6mr_rules_init net/ipv6/ip6mr.c:237 [inline] ip6mr_net_init+0x238/0x3a0 net/ipv6/ip6mr.c:1311 ops_init+0x327/0x410 net/core/net_namespace.c:140 setup_net+0x35b/0x9d0 net/core/net_namespace.c:333 copy_net_ns+0x392/0x5e0 net/core/net_namespace.c:474 create_new_namespaces+0x4ce/0xa00 kernel/nsproxy.c:110 copy_namespaces+0x2f6/0x350 kernel/nsproxy.c:178 copy_process+0x23a4/0x5b30 kernel/fork.c:2122 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1355 [inline] free_pcp_prepare+0xc29/0xd20 mm/page_alloc.c:1406 free_unref_page_prepare mm/page_alloc.c:3341 [inline] free_unref_page+0x7e/0x550 mm/page_alloc.c:3420 __vunmap+0x926/0xa70 mm/vmalloc.c:2569 copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:883 [inline] get_entries net/ipv6/netfilter/ip6_tables.c:1040 [inline] do_ip6t_get_ctl+0x16fc/0x1c80 net/ipv6/netfilter/ip6_tables.c:1671 nf_getsockopt+0x2ab/0x2d0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x469/0x3f40 net/ipv6/ipv6_sockglue.c:1486 __sys_getsockopt+0x29b/0x560 net/socket.c:2196 __do_sys_getsockopt net/socket.c:2211 [inline] __se_sys_getsockopt net/socket.c:2208 [inline] __x64_sys_getsockopt+0xb1/0xc0 net/socket.c:2208 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff888028bb8300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888028bb8380: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc >ffff888028bb8400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888028bb8480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888028bb8500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================