================================================================== BUG: KASAN: slab-use-after-free in ecryptfs_write_tag_70_packet+0x117b/0x1410 fs/ecryptfs/keystore.c:742 Read of size 4 at addr ffff888076c17898 by task syz.9.2681/14374 CPU: 0 UID: 0 PID: 14374 Comm: syz.9.2681 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1c0 mm/kasan/report.c:595 ecryptfs_write_tag_70_packet+0x117b/0x1410 fs/ecryptfs/keystore.c:742 ecryptfs_encrypt_filename fs/ecryptfs/crypto.c:1378 [inline] ecryptfs_encrypt_and_encode_filename+0x428/0xa60 fs/ecryptfs/crypto.c:1789 ecryptfs_lookup+0x1f7/0x830 fs/ecryptfs/inode.c:402 __lookup_slow+0x155/0x320 fs/namei.c:1925 lookup_slow+0x54/0x80 fs/namei.c:1942 walk_component fs/namei.c:2288 [inline] lookup_last fs/namei.c:2795 [inline] path_lookupat+0x5e8/0xc40 fs/namei.c:2819 do_o_path fs/namei.c:4987 [inline] path_openat+0x16ed/0x23f0 fs/namei.c:5009 do_file_open+0x20e/0x430 fs/namei.c:5045 do_sys_openat2+0x163/0x1d0 fs/open.c:1443 do_sys_open fs/open.c:1449 [inline] __do_sys_openat fs/open.c:1465 [inline] __se_sys_openat fs/open.c:1460 [inline] __x64_sys_openat+0x12d/0x210 fs/open.c:1460 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x7b0 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f6144fa94d9 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:00007f6145f08028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f6145225fa0 RCX: 00007f6144fa94d9 RDX: 0000000000240000 RSI: 0000200000000140 RDI: ffffffffffffff9c RBP: 00007f614503804e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000041 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f6145226038 R14: 00007f6145225fa0 R15: 00007ffed5c80718 Allocated by task 14365: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:409 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:426 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5531 [inline] __kmalloc_noprof+0x32f/0x840 mm/slub.c:5556 _kmalloc_noprof include/linux/slab.h:995 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] security_inode_init_security+0x113/0x370 security/security.c:1361 shmem_symlink+0x163/0xbf0 mm/shmem.c:4310 vfs_symlink fs/namei.c:5812 [inline] vfs_symlink+0x17b/0x520 fs/namei.c:5791 filename_symlinkat+0x2a6/0x5a0 fs/namei.c:5837 __do_sys_symlinkat fs/namei.c:5857 [inline] __se_sys_symlinkat fs/namei.c:5852 [inline] __x64_sys_symlinkat+0x9c/0xe0 fs/namei.c:5852 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x7b0 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 14365: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:264 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:296 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2780 [inline] slab_free mm/slub.c:6630 [inline] kfree+0x22b/0x6d0 mm/slub.c:6923 security_inode_init_security+0x2bf/0x370 security/security.c:1389 shmem_symlink+0x163/0xbf0 mm/shmem.c:4310 vfs_symlink fs/namei.c:5812 [inline] vfs_symlink+0x17b/0x520 fs/namei.c:5791 filename_symlinkat+0x2a6/0x5a0 fs/namei.c:5837 __do_sys_symlinkat fs/namei.c:5857 [inline] __se_sys_symlinkat fs/namei.c:5852 [inline] __x64_sys_symlinkat+0x9c/0xe0 fs/namei.c:5852 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x7b0 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888076c17800 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 152 bytes inside of freed 256-byte region [ffff888076c17800, ffff888076c17900) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888076c16800 pfn:0x76c16 head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88813ff0bb40 ffffea0000c6bd10 ffffea0001ef8a90 raw: ffff888076c16800 000000000010000f 00000000f5000000 0000000000000000 head: 00fff00000000240 ffff88813ff0bb40 ffffea0000c6bd10 ffffea0001ef8a90 head: ffff888076c16800 000000000010000f 00000000f5000000 0000000000000000 head: 00fff00000000001 ffffffffffffff81 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000002 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 12525, tgid 12525 (syz-executor), ts 432670554727 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1860 prep_new_page mm/page_alloc.c:1868 [inline] get_page_from_freelist+0xdae/0x2c80 mm/page_alloc.c:3950 __alloc_frozen_pages_noprof+0x2ad/0x31e0 mm/page_alloc.c:5492 alloc_slab_page mm/slub.c:3384 [inline] allocate_slab mm/slub.c:3499 [inline] new_slab+0xb1/0x6d0 mm/slub.c:3550 refill_objects+0xe3/0x410 mm/slub.c:7539 refill_sheaf mm/slub.c:2917 [inline] __pcs_replace_empty_main+0x35e/0x650 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+0x677/0x840 mm/slub.c:5556 _kmalloc_noprof include/linux/slab.h:995 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] security_inode_init_security+0x113/0x370 security/security.c:1361 shmem_symlink+0x163/0xbf0 mm/shmem.c:4310 vfs_symlink fs/namei.c:5812 [inline] vfs_symlink+0x17b/0x520 fs/namei.c:5791 filename_symlinkat+0x2a6/0x5a0 fs/namei.c:5837 __do_sys_symlinkat fs/namei.c:5857 [inline] __se_sys_symlinkat fs/namei.c:5852 [inline] __x64_sys_symlinkat+0x9c/0xe0 fs/namei.c:5852 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x7b0 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5651 tgid 5651 ts 410595381172 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1402 [inline] __free_frozen_pages+0x7b1/0x10f0 mm/page_alloc.c:2958 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x47/0xf0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:361 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4720 [inline] slab_alloc_node mm/slub.c:5033 [inline] kmem_cache_alloc_noprof+0x269/0x6a0 mm/slub.c:5047 alloc_filename fs/namei.c:147 [inline] do_getname+0x35/0x390 fs/namei.c:187 class_filename_flags_constructor include/linux/fs.h:2598 [inline] do_sys_openat2+0xc3/0x1d0 fs/open.c:1442 do_sys_open fs/open.c:1449 [inline] __do_sys_openat fs/open.c:1465 [inline] __se_sys_openat fs/open.c:1460 [inline] __x64_sys_openat+0x12d/0x210 fs/open.c:1460 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x7b0 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888076c17780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888076c17800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888076c17880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888076c17900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888076c17980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================