================================================================== BUG: KASAN: use-after-free in strlen+0x79/0x90 lib/string.c:565 Read of size 1 at addr ffff88801f692de8 by task syz-executor.4/8372 CPU: 0 PID: 8372 Comm: syz-executor.4 Not tainted 5.11.0-rc7-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+0x9a/0xcc lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:230 __kasan_report mm/kasan/report.c:396 [inline] kasan_report.cold+0x79/0xd5 mm/kasan/report.c:413 strlen+0x79/0x90 lib/string.c:565 strlen include/linux/string.h:322 [inline] nla_strcmp+0x18/0xe0 lib/nlattr.c:826 nft_table_lookup+0xaf/0x1b0 net/netfilter/nf_tables_api.c:520 nft_ctx_init_from_setattr net/netfilter/nf_tables_api.c:3613 [inline] nf_tables_getset+0x13a/0x660 net/netfilter/nf_tables_api.c:4028 nfnetlink_rcv_msg+0x424/0xc90 net/netfilter/nfnetlink.c:241 netlink_rcv_skb+0x118/0x370 net/netlink/af_netlink.c:2502 nfnetlink_rcv+0x143/0x340 net/netfilter/nfnetlink.c:600 netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline] netlink_unicast+0x42e/0x700 net/netlink/af_netlink.c:1338 netlink_sendmsg+0x70e/0xbe0 net/netlink/af_netlink.c:1927 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:672 ____sys_sendmsg+0x5bf/0x7a0 net/socket.c:2345 ___sys_sendmsg+0xd3/0x150 net/socket.c:2399 __sys_sendmsg+0xb2/0x140 net/socket.c:2432 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x4665f9 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0647d23188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665f9 RDX: 0000000000000000 RSI: 0000000020000d80 RDI: 0000000000000004 RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffd7620b60f R14: 00007f0647d23300 R15: 0000000000022000 Allocated by task 8372: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:401 [inline] ____kasan_kmalloc.constprop.0+0x82/0xa0 mm/kasan/common.c:429 kmalloc include/linux/slab.h:557 [inline] nla_strdup+0x93/0x130 lib/nlattr.c:769 nf_tables_newtable+0x8b8/0x19f0 net/netfilter/nf_tables_api.c:1042 nfnetlink_rcv_batch+0x68c/0x2050 net/netfilter/nfnetlink.c:456 nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:580 [inline] nfnetlink_rcv+0x2bc/0x340 net/netfilter/nfnetlink.c:598 netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline] netlink_unicast+0x42e/0x700 net/netlink/af_netlink.c:1338 netlink_sendmsg+0x70e/0xbe0 net/netlink/af_netlink.c:1927 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:672 ____sys_sendmsg+0x5bf/0x7a0 net/socket.c:2345 ___sys_sendmsg+0xd3/0x150 net/socket.c:2399 __sys_sendmsg+0xb2/0x140 net/socket.c:2432 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 8361: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:356 ____kasan_slab_free+0xe1/0x110 mm/kasan/common.c:362 kasan_slab_free include/linux/kasan.h:192 [inline] slab_free_hook mm/slub.c:1547 [inline] slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1580 slab_free mm/slub.c:3143 [inline] kfree+0xdb/0x3b0 mm/slub.c:4139 nf_tables_table_destroy+0xba/0x180 net/netfilter/nf_tables_api.c:1238 __nft_release_table+0xa04/0xe60 net/netfilter/nf_tables_api.c:9073 nft_rcv_nl_event+0x3ac/0x510 net/netfilter/nf_tables_api.c:9113 notifier_call_chain+0x94/0x170 kernel/notifier.c:83 blocking_notifier_call_chain kernel/notifier.c:337 [inline] blocking_notifier_call_chain+0x5d/0x80 kernel/notifier.c:325 netlink_release+0xa1f/0x17d0 net/netlink/af_netlink.c:783 __sock_release+0xbb/0x270 net/socket.c:597 sock_close+0xf/0x20 net/socket.c:1256 __fput+0x204/0x870 fs/file_table.c:280 task_work_run+0xc0/0x160 kernel/task_work.c:140 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:174 [inline] exit_to_user_mode_prepare+0x249/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88801f692de8 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 0 bytes inside of 8-byte region [ffff88801f692de8, ffff88801f692df0) The buggy address belongs to the page: page:00000000cc8bfb2c refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801f692820 pfn:0x1f692 flags: 0xfff00000000200(slab) raw: 00fff00000000200 ffffea0000574040 0000001800000018 ffff88800f441c80 raw: ffff88801f692820 000000008066005a 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 4059, ts 7815528972 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x144/0x1c0 mm/page_alloc.c:2297 prep_new_page mm/page_alloc.c:2306 [inline] get_page_from_freelist+0x1c6e/0x3f80 mm/page_alloc.c:3945 __alloc_pages_nodemask+0x2d6/0x730 mm/page_alloc.c:4995 alloc_pages include/linux/gfp.h:547 [inline] alloc_slab_page mm/slub.c:1618 [inline] allocate_slab+0x2b6/0x4a0 mm/slub.c:1758 new_slab mm/slub.c:1821 [inline] new_slab_objects mm/slub.c:2578 [inline] ___slab_alloc+0x476/0x790 mm/slub.c:2741 __slab_alloc.constprop.0+0x95/0xe0 mm/slub.c:2781 slab_alloc_node mm/slub.c:2857 [inline] slab_alloc mm/slub.c:2900 [inline] __kmalloc+0x34a/0x3e0 mm/slub.c:3981 kmalloc include/linux/slab.h:557 [inline] kzalloc include/linux/slab.h:682 [inline] lsm_cred_alloc security/security.c:534 [inline] security_prepare_creds+0xbf/0x140 security/security.c:1633 prepare_creds+0x3cc/0x590 kernel/cred.c:285 prepare_exec_creds+0x8/0x240 kernel/cred.c:304 prepare_bprm_creds fs/exec.c:1465 [inline] bprm_execve+0xba/0x1520 fs/exec.c:1794 kernel_execve+0x2c2/0x3e0 fs/exec.c:1969 call_usermodehelper_exec_async+0x2c1/0x500 kernel/umh.c:110 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1271 [inline] free_pcp_prepare+0x2cb/0x410 mm/page_alloc.c:1306 free_unref_page_prepare mm/page_alloc.c:3200 [inline] free_unref_page+0x12/0x1b0 mm/page_alloc.c:3248 __vunmap+0x59e/0x940 mm/vmalloc.c:2286 free_work+0x4b/0x70 mm/vmalloc.c:67 process_one_work+0x84c/0x13b0 kernel/workqueue.c:2275 worker_thread+0x598/0xf80 kernel/workqueue.c:2421 kthread+0x36f/0x450 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 Memory state around the buggy address: ffff88801f692c80: 00 fc fc fc fc fb fc fc fc fc fa fc fc fc fc fa ffff88801f692d00: fc fc fc fc fa fc fc fc fc fa fc fc fc fc 00 fc >ffff88801f692d80: fc fc fc 00 fc fc fc fc 00 fc fc fc fc fa fc fc ^ ffff88801f692e00: fc fc fa fc fc fc fc fa fc fc fc fc fb fc fc fc ffff88801f692e80: fc fa fc fc fc fc fb fc fc fc fc fb fc fc fc fc ==================================================================