================================================================== 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 ffff88801f5a170c by task syz-executor.0/4160 CPU: 0 PID: 4160 Comm: syz-executor.0 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:0x7fbfd280ed29 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:00007fbfd0d900c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000f8 RAX: ffffffffffffffda RBX: 00007fbfd293df80 RCX: 00007fbfd280ed29 RDX: 0000000020000340 RSI: 0000000020000400 RDI: 00000000200003c0 RBP: 00007fbfd285b47a R08: 000000001ced853a R09: 0000000000000000 R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fbfd293df80 R15: 00007fff38831728 Allocated by task 4160: 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 ffff88801f5a1708 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 4 bytes inside of 8-byte region [ffff88801f5a1708, ffff88801f5a1710) The buggy address belongs to the page: page:ffffea00007d6840 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801f5a1d70 pfn:0x1f5a1 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000526dc0 0000000a0000000a ffff888011c41280 raw: ffff88801f5a1d70 0000000080660062 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 1, ts 9742713040, free_ts 0 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_page_interleave+0x22/0x1c0 mm/mempolicy.c:2031 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] slab_alloc mm/slub.c:3228 [inline] __kmalloc_track_caller+0x1c7/0x300 mm/slub.c:4925 kstrdup mm/util.c:60 [inline] kstrdup_const+0x51/0x90 mm/util.c:83 __kernfs_new_node+0x99/0x750 fs/kernfs/dir.c:589 kernfs_new_node fs/kernfs/dir.c:657 [inline] kernfs_create_dir_ns+0x90/0x230 fs/kernfs/dir.c:993 sysfs_create_dir_ns+0x185/0x390 fs/sysfs/dir.c:59 create_dir lib/kobject.c:89 [inline] kobject_add_internal+0x6e0/0xe00 lib/kobject.c:263 kobject_add_varg lib/kobject.c:398 [inline] kobject_add+0x14e/0x210 lib/kobject.c:450 device_add+0x476/0xfd0 drivers/base/core.c:3329 usb_create_ep_devs+0x12c/0x220 drivers/usb/core/endpoint.c:169 usb_new_device+0xd0a/0x18d0 drivers/usb/core/hub.c:2604 register_root_hub+0x25f/0x540 drivers/usb/core/hcd.c:1021 page_owner free stack trace missing Memory state around the buggy address: ffff88801f5a1600: fc fc fc 05 fc fc fc fc 05 fc fc fc fc 05 fc fc ffff88801f5a1680: fc fc 05 fc fc fc fc 06 fc fc fc fc 06 fc fc fc >ffff88801f5a1700: fc 04 fc fc fc fc fb fc fc fc fc 05 fc fc fc fc ^ ffff88801f5a1780: 05 fc fc fc fc fa fc fc fc fc fa fc fc fc fc 05 ffff88801f5a1800: fc fc fc fc 05 fc fc fc fc 07 fc fc fc fc 06 fc ==================================================================