================================================================== 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 ffff8881419a1e14 by task syz-executor.3/5396 CPU: 0 PID: 5396 Comm: syz-executor.3 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:0x7f0b6e7a1da9 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:00007f0b6cd230c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000f8 RAX: ffffffffffffffda RBX: 00007f0b6e8d0f80 RCX: 00007f0b6e7a1da9 RDX: 0000000020000440 RSI: 0000000020000400 RDI: 00000000200003c0 RBP: 00007f0b6e7ee47a R08: 0000000027e09b72 R09: 0000000000000000 R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f0b6e8d0f80 R15: 00007ffd82b457d8 Allocated by task 5396: 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 ffff8881419a1e10 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 4 bytes inside of 8-byte region [ffff8881419a1e10, ffff8881419a1e18) The buggy address belongs to the page: page:ffffea0005066840 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1419a1 flags: 0x57ff00000000200(slab|node=1|zone=2|lastcpupid=0x7ff) raw: 057ff00000000200 ffffea000190cf40 0000000b0000000b 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 2678325313, free_ts 2578311606 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+0x1c9/0x300 mm/slub.c:4403 kmalloc include/linux/slab.h:596 [inline] kzalloc include/linux/slab.h:721 [inline] acpi_os_allocate_zeroed include/acpi/platform/aclinuxex.h:57 [inline] acpi_ns_internalize_name+0x415/0x600 drivers/acpi/acpica/nsutils.c:331 acpi_ns_get_node_unlocked drivers/acpi/acpica/nsutils.c:666 [inline] acpi_ns_get_node+0x1b3/0x3c0 drivers/acpi/acpica/nsutils.c:726 acpi_get_handle+0x197/0x290 drivers/acpi/acpica/nsxfname.c:98 acpi_has_method+0x9a/0xe0 drivers/acpi/utils.c:553 acpi_bay_match+0x97/0x200 drivers/acpi/scan.c:1154 is_ejectable_bay drivers/acpi/scan.c:1182 [inline] acpi_scan_init_hotplug drivers/acpi/scan.c:1932 [inline] acpi_bus_check_add+0x493/0x940 drivers/acpi/scan.c:2059 acpi_ns_walk_namespace+0x28c/0x4e0 acpi_walk_namespace+0xe7/0x130 drivers/acpi/acpica/nsxfeval.c:606 acpi_bus_scan+0xd9/0x200 drivers/acpi/scan.c:2368 acpi_scan_init+0x263/0x7b5 drivers/acpi/scan.c:2550 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 free_slab mm/slub.c:2015 [inline] discard_slab mm/slub.c:2021 [inline] __unfreeze_partials+0x1b7/0x210 mm/slub.c:2507 unfreeze_partials mm/slub.c:2526 [inline] flush_cpu_slab+0x1f3/0x2c0 mm/slub.c:2666 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Memory state around the buggy address: ffff8881419a1d00: fc fc fc fc fb fc fc fc fc fb fc fc fc fc fb fc ffff8881419a1d80: fc fc fc fb fc fc fc fc fb fc fc fc fc fb fc fc >ffff8881419a1e00: fc fc 04 fc fc fc fc 05 fc fc fc fc fb fc fc fc ^ ffff8881419a1e80: fc 01 fc fc fc fc fb fc fc fc fc fb fc fc fc fc ffff8881419a1f00: 02 fc fc fc fc 02 fc fc fc fc fb fc fc fc fc 00 ==================================================================