================================================================== BUG: KASAN: slab-out-of-bounds in ecryptfs_write_tag_70_packet+0x1241/0x12e0 fs/ecryptfs/keystore.c:742 Read of size 4 at addr ffff888030fe4698 by task syz.0.0/5347 CPU: 0 UID: 0 PID: 5347 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description+0x55/0x1e0 mm/kasan/report.c:378 print_report+0x58/0x70 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 ecryptfs_write_tag_70_packet+0x1241/0x12e0 fs/ecryptfs/keystore.c:742 ecryptfs_encrypt_filename fs/ecryptfs/crypto.c:1378 [inline] ecryptfs_encrypt_and_encode_filename+0x576/0x1580 fs/ecryptfs/crypto.c:1789 ecryptfs_lookup+0x20e/0x780 fs/ecryptfs/inode.c:402 lookup_one_qstr_excl+0x12d/0x360 fs/namei.c:1816 __start_dirop fs/namei.c:2926 [inline] start_dirop fs/namei.c:2948 [inline] filename_create+0x20e/0x370 fs/namei.c:5108 filename_mknodat+0x18c/0x680 fs/namei.c:5325 __do_sys_mknodat fs/namei.c:5368 [inline] __se_sys_mknodat+0x3b/0x150 fs/namei.c:5364 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fb3b759f559 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb3b83d6fe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000103 RAX: ffffffffffffffda RBX: 00007fb3b7825fa0 RCX: 00007fb3b759f559 RDX: 0000000000000020 RSI: 00002000000004c0 RDI: 0000000000000005 RBP: 00007fb3b7636b50 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fb3b7826038 R14: 00007fb3b7825fa0 R15: 00007ffef0fd65c8 Allocated by task 1: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:409 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:426 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5531 [inline] __kmalloc_node_track_caller_noprof+0x4af/0x720 mm/slub.c:5662 kvasprintf+0xeb/0x1a0 lib/kasprintf.c:25 kasprintf+0xe2/0x140 lib/kasprintf.c:59 wq_init_lockdep kernel/workqueue.c:5170 [inline] alloc_workqueue_va kernel/workqueue.c:6255 [inline] alloc_workqueue_noprof+0x12e/0x210 kernel/workqueue.c:6269 dm_multipath_init+0x19/0xf0 drivers/md/dm-mpath.c:2323 do_one_initcall+0x250/0x870 init/main.c:1419 do_initcall_level+0x10a/0x1a0 init/main.c:1481 do_initcalls+0x59/0xa0 init/main.c:1497 kernel_init_freeable+0x29d/0x3e0 init/main.c:1732 kernel_init+0x22/0x1d0 init/main.c:1622 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff888030fe4680 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 1 bytes to the right of allocated 23-byte region [ffff888030fe4680, ffff888030fe4697) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x30fe4 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000000 ffff88801c841780 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000400040 00000000f5000000 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 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 3835682717 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1856 prep_new_page mm/page_alloc.c:1864 [inline] get_page_from_freelist+0x220f/0x2280 mm/page_alloc.c:3935 __alloc_frozen_pages_noprof+0x1fe/0x410 mm/page_alloc.c:5444 alloc_slab_page mm/slub.c:3384 [inline] allocate_slab+0x7d/0x5e0 mm/slub.c:3499 new_slab mm/slub.c:3550 [inline] refill_objects+0x2d5/0x350 mm/slub.c:7539 refill_sheaf mm/slub.c:2917 [inline] __pcs_replace_empty_main+0x2c8/0x6c0 mm/slub.c:4811 alloc_from_pcs mm/slub.c:4887 [inline] slab_alloc_node mm/slub.c:5021 [inline] __do_kmalloc_node mm/slub.c:5530 [inline] __kmalloc_noprof+0x476/0x710 mm/slub.c:5556 _kmalloc_noprof include/linux/slab.h:995 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] acpi_ns_get_normalized_pathname+0x86/0x230 drivers/acpi/acpica/nsnames.c:312 acpi_ns_evaluate+0x38f/0x1320 drivers/acpi/acpica/nseval.c:96 acpi_ut_evaluate_object+0xe1/0x560 drivers/acpi/acpica/uteval.c:60 acpi_ut_execute_HID+0xb8/0x3c0 drivers/acpi/acpica/utids.c:45 acpi_ns_get_device_callback+0x1c5/0x4c0 drivers/acpi/acpica/nsxfeval.c:679 acpi_ns_walk_namespace+0x273/0x700 drivers/acpi/acpica/nswalk.c:-1 acpi_get_devices+0x14b/0x1e0 drivers/acpi/acpica/nsxfeval.c:805 acpi_ec_dsdt_probe+0x43/0xf0 drivers/acpi/ec.c:1842 acpi_bus_init+0x27c/0x360 drivers/acpi/bus.c:1408 page last free pid 1 tgid 1 ts 3815705907 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1403 [inline] __free_frozen_pages+0xc97/0xd90 mm/page_alloc.c:2954 __slab_free+0x269/0x2c0 mm/slub.c:5926 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x99/0x100 mm/kasan/quarantine.c:179 kasan_quarantine_remove_cache+0x35d/0x380 mm/kasan/quarantine.c:388 kmem_cache_shrink+0xd/0x20 mm/slab_common.c:620 acpi_os_purge_cache+0x15/0x20 drivers/acpi/osl.c:1622 acpi_purge_cached_objects+0xd5/0x100 drivers/acpi/acpica/utxface.c:240 acpi_initialize_objects+0x2e/0xb0 drivers/acpi/acpica/utxfinit.c:250 acpi_bus_init+0xa8/0x360 drivers/acpi/bus.c:1381 acpi_init+0xa1/0x1f0 drivers/acpi/bus.c:1471 do_one_initcall+0x250/0x870 init/main.c:1419 do_initcall_level+0x10a/0x1a0 init/main.c:1481 do_initcalls+0x59/0xa0 init/main.c:1497 kernel_init_freeable+0x29d/0x3e0 init/main.c:1732 kernel_init+0x22/0x1d0 init/main.c:1622 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 Memory state around the buggy address: ffff888030fe4580: fa fb fb fb fc fc fc fc 00 00 00 02 fc fc fc fc ffff888030fe4600: 00 00 00 fc fc fc fc fc 00 00 00 00 fc fc fc fc >ffff888030fe4680: 00 00 07 fc fc fc fc fc 00 00 07 fc fc fc fc fc ^ ffff888030fe4700: fa fb fb fb fc fc fc fc 00 00 00 03 fc fc fc fc ffff888030fe4780: 00 00 06 fc fc fc fc fc 00 00 00 fc fc fc fc fc ==================================================================