==================================================================
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 ffff88802110d824 by task syz-executor.1/12991

CPU: 1 PID: 12991 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:
 <TASK>
 __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:0x7fb5b8dc1d29
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:00007fb5b73430c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000f8
RAX: ffffffffffffffda RBX: 00007fb5b8ef0f80 RCX: 00007fb5b8dc1d29
RDX: 0000000020000080 RSI: 0000000000000000 RDI: 00000000200003c0
RBP: 00007fb5b8e0e47a R08: 000000003ee61498 R09: 0000000000000000
R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007fb5b8ef0f80 R15: 00007ffeacf89218
 </TASK>

Allocated by task 12991:
 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 ffff88802110d820
 which belongs to the cache kmalloc-8 of size 8
The buggy address is located 4 bytes inside of
 8-byte region [ffff88802110d820, ffff88802110d828)
The buggy address belongs to the page:
page:ffffea0000844340 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2110d
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea00007e5e00 0000006400000002 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 3558, ts 237777658315, free_ts 237777528402
 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
 __do_replace+0xc4/0xae0 net/ipv6/netfilter/ip6_tables.c:1065
 do_replace net/ipv6/netfilter/ip6_tables.c:1156 [inline]
 do_ip6t_set_ctl+0x2d9c/0x3f50 net/ipv6/netfilter/ip6_tables.c:1638
 nf_setsockopt+0x28a/0x2b0 net/netfilter/nf_sockopt.c:101
 ipv6_setsockopt+0x2f9a/0x43a0 net/ipv6/ipv6_sockglue.c:1011
 tcp_setsockopt+0x23f/0x3680 net/ipv4/tcp.c:3694
 __sys_setsockopt+0x57e/0x990 net/socket.c:2196
 __do_sys_setsockopt net/socket.c:2207 [inline]
 __se_sys_setsockopt net/socket.c:2204 [inline]
 __x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2204
 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:
 ffff88802110d700: fc fa fc fc fc fc fa fc fc fc fc fa fc fc fc fc
 ffff88802110d780: fa fc fc fc fc fa fc fc fc fc fa fc fc fc fc fa
>ffff88802110d800: fc fc fc fc 04 fc fc fc fc fb fc fc fc fc fb fc
                               ^
 ffff88802110d880: fc fc fc fa fc fc fc fc 00 fc fc fc fc fa fc fc
 ffff88802110d900: fc fc fa fc fc fc fc fa fc fc fc fc fa fc fc fc
==================================================================