[ 258.148693] loop0: detected capacity change from 0 to 32768 [ 258.267740] ================================================================== [ 258.270623] BUG: KASAN: slab-use-after-free in utf32_to_utf8+0x13c/0x180 [ 258.273243] Write of size 1 at addr ffff888111b7f000 by task ls/1823 [ 258.276664] CPU: 1 UID: 1000 PID: 1823 Comm: ls Not tainted 7.0.0-kasan-kcov #15.15.kasan PREEMPT(lazy) [ 258.276691] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 258.276713] Call Trace: [ 258.276721] [ 258.276730] dump_stack_lvl+0xa7/0xf0 [ 258.276766] ? utf32_to_utf8+0x13c/0x180 [ 258.276784] print_report+0x174/0x4f6 [ 258.276816] ? __pfx__raw_spin_lock_irqsave+0x10/0x10 [ 258.276851] ? __virt_addr_valid+0xdb/0x190 [ 258.276872] ? utf32_to_utf8+0x13c/0x180 [ 258.276890] kasan_report+0xce/0x100 [ 258.276922] ? utf32_to_utf8+0x13c/0x180 [ 258.276945] utf32_to_utf8+0x13c/0x180 [ 258.276967] uni2char+0x38/0x80 [nls_utf8] [ 258.277001] jfs_strfromUCS_le+0xd9/0x230 [jfs] [ 258.277161] jfs_readdir+0x110c/0x2360 [jfs] [ 258.277324] ? __pfx_jfs_readdir+0x10/0x10 [jfs] [ 258.277481] ? from_kgid_munged+0xb0/0xf0 [ 258.277522] ? down_write+0xb9/0x120 [ 258.277546] ? __pfx_down_write+0x10/0x10 [ 258.277571] ? __pfx_down_read_killable+0x10/0x10 [ 258.277597] ? selinux_file_permission+0x35/0x460 [ 258.277620] ? __pfx_jfs_readdir+0x10/0x10 [jfs] [ 258.277771] wrap_directory_iterator+0x70/0xa0 [ 258.277795] iterate_dir+0x17f/0x570 [ 258.277817] __x64_sys_getdents64+0x107/0x250 [ 258.277839] ? __pfx___x64_sys_getdents64+0x10/0x10 [ 258.277862] ? __pfx_filldir64+0x10/0x10 [ 258.277887] do_syscall_64+0x120/0x1640 [ 258.277908] ? __handle_mm_fault+0x448/0x2060 [ 258.277938] ? fpregs_assert_state_consistent+0x98/0xe0 [ 258.277971] ? do_syscall_64+0x15e/0x1640 [ 258.277990] ? __pfx___handle_mm_fault+0x10/0x10 [ 258.278019] ? css_rstat_updated+0xfe/0x2a0 [ 258.278039] ? __pfx_css_rstat_updated+0x10/0x10 [ 258.278066] ? count_memcg_events+0x1c5/0x260 [ 258.278101] ? __rcu_read_unlock+0x33/0x50 [ 258.278119] ? handle_mm_fault+0x296/0x5d0 [ 258.278150] ? do_user_addr_fault+0x3b0/0xbc0 [ 258.278176] ? fpregs_assert_state_consistent+0x98/0xe0 [ 258.278209] ? irqentry_exit+0x7b/0x590 [ 258.278231] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 258.278253] RIP: 0033:0x7ff9364f67d7 [ 258.278274] Code: 11 00 64 c7 00 16 00 00 00 31 c0 eb 9f e8 61 ec 04 00 90 f3 0f 1e fa b8 ff ff ff 7f 48 39 c2 48 0f 47 d0 b8 d9 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 8b 15 01 b6 11 00 f7 d8 64 89 02 48 [ 258.278299] RSP: 002b:00007ffd3e584d28 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 [ 258.278318] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ff9364f67d7 [ 258.278332] RDX: 0000000000008000 RSI: 000055e65319d430 RDI: 0000000000000003 [ 258.278345] RBP: 00007ffd3e584d60 R08: 000055e65319d404 R09: 0000000000000000 [ 258.278357] R10: 0000000000000001 R11: 0000000000000293 R12: 00007ffd3e585150 [ 258.278370] R13: 00007ffd3e585c78 R14: 000055e653187c20 R15: 00007ff93663c6f0 [ 258.278393] [ 258.382628] Allocated by task 1: [ 258.384029] kasan_save_stack+0x30/0x50 [ 258.384065] kasan_save_track+0x14/0x30 [ 258.384095] __kasan_slab_alloc+0x89/0x90 [ 258.384127] kmem_cache_alloc_noprof+0x188/0x480 [ 258.384159] do_getname+0x3a/0x2a0 [ 258.384190] do_sys_openat2+0xbe/0x1c0 [ 258.384221] __x64_sys_openat+0xf7/0x1a0 [ 258.384252] do_syscall_64+0x120/0x1640 [ 258.384273] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 258.385095] Freed by task 1: [ 258.386345] kasan_save_stack+0x30/0x50 [ 258.386380] kasan_save_track+0x14/0x30 [ 258.386410] kasan_save_free_info+0x3b/0x70 [ 258.386435] __kasan_slab_free+0x5f/0x80 [ 258.386466] kmem_cache_free+0x116/0x480 [ 258.386495] putname+0x87/0xd0 [ 258.386522] do_sys_openat2+0x13c/0x1c0 [ 258.386552] __x64_sys_openat+0xf7/0x1a0 [ 258.386583] do_syscall_64+0x120/0x1640 [ 258.386605] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 258.387522] The buggy address belongs to the object at ffff888111b7f000 which belongs to the cache names_cache of size 192 [ 258.391751] The buggy address is located 0 bytes inside of freed 192-byte region [ffff888111b7f000, ffff888111b7f0c0) [ 258.396847] The buggy address belongs to the physical page: [ 258.399012] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x111b7f [ 258.399051] flags: 0x17ffffc0000000(node=0|zone=2|lastcpupid=0x1fffff) [ 258.399077] page_type: f5(slab) [ 258.399105] raw: 0017ffffc0000000 ffff8881002cf2c0 dead000000000100 dead000000000122 [ 258.399133] raw: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000 [ 258.399150] page dumped because: kasan: bad access detected