================================================================== BUG: KASAN: slab-out-of-bounds in dns_resolver_preparse+0xcaf/0xd20 net/dns_resolver/dns_key.c:127 Read of size 1 at addr ffff88805f89e48c by task syz-executor.1/4031 CPU: 1 PID: 4031 Comm: syz-executor.1 Not tainted 5.15.146-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 dns_resolver_preparse+0xcaf/0xd20 net/dns_resolver/dns_key.c:127 key_create_or_update+0x47b/0xbf0 security/keys/key.c:861 __do_sys_add_key security/keys/keyctl.c:134 [inline] __se_sys_add_key+0x33b/0x480 security/keys/keyctl.c:74 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+0x61/0xcb RIP: 0033:0x7f5154248d29 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 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 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f51527ca0c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000f8 RAX: ffffffffffffffda RBX: 00007f5154377f80 RCX: 00007f5154248d29 RDX: 0000000020000340 RSI: 0000000020000400 RDI: 00000000200003c0 RBP: 00007f515429547a R08: 00000000315a29de R09: 0000000000000000 R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f5154377f80 R15: 00007ffd33629d88 Allocated by task 4031: 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+0xba/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc_node+0x199/0x390 mm/slub.c:4455 kmalloc_node include/linux/slab.h:614 [inline] kvmalloc_node+0x80/0x140 mm/util.c:619 kvmalloc include/linux/mm.h:805 [inline] __do_sys_add_key security/keys/keyctl.c:116 [inline] __se_sys_add_key+0x26c/0x480 security/keys/keyctl.c:74 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+0x61/0xcb The buggy address belongs to the object at ffff88805f89e488 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 4 bytes inside of 8-byte region [ffff88805f89e488, ffff88805f89e490) The buggy address belongs to the page: page:ffffea00017e2780 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5f89e flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 dead000000000122 ffff888011c41280 raw: 0000000000000000 0000000080660066 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 3537, ts 179800771127, free_ts 179800678899 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5421 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xbb/0x4b0 mm/slub.c:1975 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] __kmalloc_node+0x1fa/0x390 mm/slub.c:4451 kmalloc_node include/linux/slab.h:614 [inline] __vmalloc_area_node mm/vmalloc.c:2910 [inline] __vmalloc_node_range+0x2e2/0x8c0 mm/vmalloc.c:3029 __vmalloc_node mm/vmalloc.c:3079 [inline] vzalloc+0x75/0x80 mm/vmalloc.c:3149 alloc_counters+0xcf/0x7d0 net/ipv4/netfilter/arp_tables.c:659 copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:839 [inline] get_entries net/ipv6/netfilter/ip6_tables.c:1041 [inline] do_ip6t_get_ctl+0xea8/0x1890 net/ipv6/netfilter/ip6_tables.c:1671 nf_getsockopt+0x28e/0x2b0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x468/0x2ff0 net/ipv6/ipv6_sockglue.c:1489 tcp_getsockopt+0x26d/0x6c20 net/ipv4/tcp.c:4293 __sys_getsockopt+0x2a6/0x550 net/socket.c:2240 __do_sys_getsockopt net/socket.c:2255 [inline] __se_sys_getsockopt net/socket.c:2252 [inline] __x64_sys_getsockopt+0xb1/0xc0 net/socket.c:2252 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+0x61/0xcb page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396 __vunmap+0x8d4/0xa20 mm/vmalloc.c:2621 copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:884 [inline] get_entries net/ipv6/netfilter/ip6_tables.c:1041 [inline] do_ip6t_get_ctl+0x11db/0x1890 net/ipv6/netfilter/ip6_tables.c:1671 nf_getsockopt+0x28e/0x2b0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x468/0x2ff0 net/ipv6/ipv6_sockglue.c:1489 tcp_getsockopt+0x26d/0x6c20 net/ipv4/tcp.c:4293 __sys_getsockopt+0x2a6/0x550 net/socket.c:2240 __do_sys_getsockopt net/socket.c:2255 [inline] __se_sys_getsockopt net/socket.c:2252 [inline] __x64_sys_getsockopt+0xb1/0xc0 net/socket.c:2252 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+0x61/0xcb Memory state around the buggy address: ffff88805f89e380: fc fc fc fa fc fc fc fc fa fc fc fc fc fa fc fc ffff88805f89e400: fc fc fa fc fc fc fc 05 fc fc fc fc 05 fc fc fc >ffff88805f89e480: fc 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88805f89e500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805f89e580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================