program: mkdirat(0xffffffffffffff9c, &(0x7f0000004000)='./mnt\x00', 0x1ff) getsockopt$TIPC_DEST_DROPPABLE(0xffffffffffffffff, 0x10f, 0x81, &(0x7f0000000280), &(0x7f00000000c0)=0x4) add_key$user(&(0x7f00000003c0), &(0x7f0000000440), &(0x7f00000000c0), 0xc9, 0xfffffffffffffffd) mount(&(0x7f0000000400), &(0x7f0000000000)='./mnt\x00', &(0x7f0000000480)='ecryptfs\x00', 0x0, &(0x7f0000000500)='ecryptfs_sig=syz,ecryptfs_fnek_sig=syz,ecryptfs_cipher=aes,ecryptfs_key_bytes=16\x00') chown(&(0x7f0000000340)='./mnt\x00', 0x0, 0x0) chdir(&(0x7f0000000040)='./mnt\x00') mkdirat(0xffffffffffffff9c, &(0x7f0000004000)='./mnt\x00', 0x1ff) (async) getsockopt$TIPC_DEST_DROPPABLE(0xffffffffffffffff, 0x10f, 0x81, &(0x7f0000000280), &(0x7f00000000c0)=0x4) (async) add_key$user(&(0x7f00000003c0), &(0x7f0000000440), &(0x7f00000000c0), 0xc9, 0xfffffffffffffffd) (async) mount(&(0x7f0000000400), &(0x7f0000000000)='./mnt\x00', &(0x7f0000000480)='ecryptfs\x00', 0x0, &(0x7f0000000500)='ecryptfs_sig=syz,ecryptfs_fnek_sig=syz,ecryptfs_cipher=aes,ecryptfs_key_bytes=16\x00') (async) chown(&(0x7f0000000340)='./mnt\x00', 0x0, 0x0) (async) chdir(&(0x7f0000000040)='./mnt\x00') (async) [ 105.891221][ T4667] Bluetooth: hci0: command tx timeout [ 106.072196][ T5347] ================================================================== [ 106.072213][ T5347] BUG: KASAN: slab-use-after-free in ecryptfs_write_tag_70_packet+0x1241/0x12e0 [ 106.072501][ T5347] Read of size 4 at addr ffff888035c4c698 by task syz.0.0/5347 [ 106.072511][ T5347] [ 106.072533][ T5347] CPU: 0 UID: 0 PID: 5347 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) [ 106.072545][ T5347] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 106.072566][ T5347] Call Trace: [ 106.072619][ T5347] [ 106.072626][ T5347] dump_stack_lvl+0xe8/0x150 [ 106.072647][ T5347] print_address_description+0x55/0x1e0 [ 106.072685][ T5347] ? ecryptfs_write_tag_70_packet+0x1241/0x12e0 [ 106.072698][ T5347] print_report+0x58/0x70 [ 106.072741][ T5347] kasan_report+0x117/0x150 [ 106.072761][ T5347] ? ecryptfs_write_tag_70_packet+0x1241/0x12e0 [ 106.072776][ T5347] ecryptfs_write_tag_70_packet+0x1241/0x12e0 [ 106.072811][ T5347] ecryptfs_encrypt_and_encode_filename+0x576/0x1580 [ 106.072828][ T5347] ? __pfx_ecryptfs_encrypt_and_encode_filename+0x10/0x10 [ 106.072845][ T5347] ecryptfs_lookup+0x20e/0x780 [ 106.072860][ T5347] ? __pfx_ecryptfs_lookup+0x10/0x10 [ 106.072876][ T5347] ? _raw_spin_unlock+0x28/0x50 [ 106.072940][ T5347] ? d_alloc+0x144/0x190 [ 106.072955][ T5347] lookup_one_qstr_excl+0x12d/0x360 [ 106.072972][ T5347] filename_create+0x20e/0x370 [ 106.072989][ T5347] ? __pfx_filename_create+0x10/0x10 [ 106.073007][ T5347] filename_mkdirat+0xd2/0x550 [ 106.073016][ T5347] ? __might_fault+0xaf/0x130 [ 106.073029][ T5347] ? __pfx_filename_mkdirat+0x10/0x10 [ 106.073040][ T5347] ? do_getname+0x151/0x250 [ 106.073053][ T5347] __se_sys_mkdirat+0x35/0x150 [ 106.073063][ T5347] do_syscall_64+0x171/0x540 [ 106.073078][ T5347] ? trace_irq_disable+0x3b/0x140 [ 106.073094][ T5347] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 106.073106][ T5347] ? clear_bhb_loop+0x70/0xc0 [ 106.073117][ T5347] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 106.073129][ T5347] RIP: 0033:0x7f341d5a9559 [ 106.073141][ T5347] 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 [ 106.073150][ T5347] RSP: 002b:00007f341e547fe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 [ 106.073163][ T5347] RAX: ffffffffffffffda RBX: 00007f341d825fa0 RCX: 00007f341d5a9559 [ 106.073171][ T5347] RDX: 00000000000001ff RSI: 0000200000004000 RDI: ffffffffffffff9c [ 106.073178][ T5347] RBP: 00007f341d638136 R08: 0000000000000000 R09: 0000000000000000 [ 106.073185][ T5347] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 106.073192][ T5347] R13: 00007f341d826038 R14: 00007f341d825fa0 R15: 00007ffdec989668 [ 106.073203][ T5347] [ 106.073207][ T5347] [ 106.073210][ T5347] Allocated by task 5347: [ 106.073216][ T5347] kasan_save_track+0x3f/0x90 [ 106.073230][ T5347] __kasan_kmalloc+0x93/0xb0 [ 106.073244][ T5347] __kvmalloc_node_noprof+0x50a/0x820 [ 106.073258][ T5347] __se_sys_add_key+0x289/0x420 [ 106.073272][ T5347] do_syscall_64+0x171/0x540 [ 106.073285][ T5347] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 106.073294][ T5347] [ 106.073296][ T5347] Freed by task 5347: [ 106.073301][ T5347] kasan_save_track+0x3f/0x90 [ 106.073314][ T5347] kasan_save_free_info+0x40/0x50 [ 106.073325][ T5347] __kasan_slab_free+0x70/0x90 [ 106.073338][ T5347] kfree+0x1c7/0x650 [ 106.073346][ T5347] __se_sys_add_key+0x3a3/0x420 [ 106.073358][ T5347] do_syscall_64+0x171/0x540 [ 106.073370][ T5347] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 106.073379][ T5347] [ 106.073382][ T5347] The buggy address belongs to the object at ffff888035c4c600 [ 106.073382][ T5347] which belongs to the cache kmalloc-256 of size 256 [ 106.073392][ T5347] The buggy address is located 152 bytes inside of [ 106.073392][ T5347] freed 256-byte region [ffff888035c4c600, ffff888035c4c700) [ 106.073403][ T5347] [ 106.073406][ T5347] The buggy address belongs to the physical page: [ 106.073420][ T5347] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x35c4c [ 106.073431][ T5347] flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) [ 106.073441][ T5347] page_type: f5(slab) [ 106.073451][ T5347] raw: 04fff00000000000 ffff88801c841b40 dead000000000122 0000000000000000 [ 106.073460][ T5347] raw: 0000000000000000 0000000000080008 00000000f5000000 0000000000000000 [ 106.073466][ T5347] page dumped because: kasan: bad access detected [ 106.073472][ T5347] page_owner tracks the page as allocated [ 106.073476][ T5347] page last allocated via order 0, migratetype Unmovable, gfp_mask 0xd2c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5300, tgid 5300 (syz-executor), ts 103562808203 [ 106.073493][ T5347] post_alloc_hook+0x1f9/0x250 [ 106.073505][ T5347] prep_new_page+0x22/0xb0 [ 106.073517][ T5347] get_page_from_freelist+0x22a1/0x22e0 [ 106.073530][ T5347] __alloc_frozen_pages_noprof+0x211/0x450 [ 106.073543][ T5347] allocate_slab+0x7d/0x5e0 [ 106.073552][ T5347] refill_objects+0x2d5/0x350 [ 106.073561][ T5347] __pcs_replace_empty_main+0x2c8/0x6c0 [ 106.073575][ T5347] __kmalloc_noprof+0x476/0x710 [ 106.073587][ T5347] security_inode_init_security+0x102/0x3e0 [ 106.073599][ T5347] shmem_mknod+0x1ea/0x340 [ 106.073609][ T5347] shmem_mkdir+0x33/0x70 [ 106.073617][ T5347] vfs_mkdir+0x411/0x660 [ 106.073625][ T5347] filename_mkdirat+0x284/0x550 [ 106.073634][ T5347] __se_sys_mkdirat+0x35/0x150 [ 106.073641][ T5347] do_syscall_64+0x171/0x540 [ 106.073653][ T5347] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 106.073663][ T5347] page last free pid 5300 tgid 5300 ts 103561523182 stack trace: [ 106.073670][ T5347] __free_frozen_pages+0xd1a/0xe10 [ 106.073681][ T5347] __slab_free+0x269/0x2c0 [ 106.073693][ T5347] qlist_free_all+0x99/0x100 [ 106.073706][ T5347] kasan_quarantine_reduce+0x148/0x160 [ 106.073718][ T5347] __kasan_slab_alloc+0x22/0x80 [ 106.073731][ T5347] kmem_cache_alloc_lru_noprof+0x29e/0x5f0 [ 106.073742][ T5347] shmem_alloc_inode+0x28/0x40 [ 106.073757][ T5347] alloc_inode+0x6a/0x1b0 [ 106.073768][ T5347] new_inode+0x1f/0x170 [ 106.073779][ T5347] shmem_get_inode+0x3a4/0x1040 [ 106.073793][ T5347] shmem_mknod+0x17d/0x340 [ 106.073802][ T5347] shmem_mkdir+0x33/0x70 [ 106.073811][ T5347] vfs_mkdir+0x411/0x660 [ 106.073818][ T5347] filename_mkdirat+0x284/0x550 [ 106.073826][ T5347] __se_sys_mkdirat+0x35/0x150 [ 106.073835][ T5347] do_syscall_64+0x171/0x540 [ 106.073847][ T5347] [ 106.073850][ T5347] Memory state around the buggy address: [ 106.073855][ T5347] ffff888035c4c580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 106.073862][ T5347] ffff888035c4c600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 106.073869][ T5347] >ffff888035c4c680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 106.073874][ T5347] ^ [ 106.073880][ T5347] ffff888035c4c700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 106.073886][ T5347] ffff888035c4c780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 106.073891][ T5347] ================================================================== [ 106.073989][ T5347] Kernel panic - not syncing: KASAN: panic_on_warn set ... [ 106.371776][ T5347] CPU: 0 UID: 0 PID: 5347 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) [ 106.375542][ T5347] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 106.379418][ T5347] Call Trace: [ 106.381259][ T5347] [ 106.382766][ T5347] vpanic+0x26f/0x710 [ 106.384730][ T5347] panic+0xc5/0xd0 [ 106.386272][ T5347] ? __pfx_panic+0x10/0x10 [ 106.388257][ T5347] ? preempt_schedule_thunk+0x16/0x40 [ 106.390617][ T5347] ? preempt_schedule_thunk+0x16/0x40 [ 106.392982][ T5347] ? ecryptfs_write_tag_70_packet+0x1241/0x12e0 [ 106.397849][ T5347] check_panic_on_warn+0x89/0xb0 [ 106.400182][ T5347] ? ecryptfs_write_tag_70_packet+0x1241/0x12e0 [ 106.402933][ T5347] end_report+0x73/0x170 [ 106.405013][ T5347] ? ecryptfs_write_tag_70_packet+0x1241/0x12e0 [ 106.407779][ T5347] kasan_report+0x128/0x150 [ 106.409816][ T5347] ? ecryptfs_write_tag_70_packet+0x1241/0x12e0 [ 106.412510][ T5347] ecryptfs_write_tag_70_packet+0x1241/0x12e0 [ 106.415120][ T5347] ecryptfs_encrypt_and_encode_filename+0x576/0x1580 [ 106.417779][ T5347] ? __pfx_ecryptfs_encrypt_and_encode_filename+0x10/0x10 [ 106.420435][ T5347] ecryptfs_lookup+0x20e/0x780 [ 106.422984][ T5347] ? __pfx_ecryptfs_lookup+0x10/0x10 [ 106.425268][ T5347] ? _raw_spin_unlock+0x28/0x50 [ 106.427409][ T5347] ? d_alloc+0x144/0x190 [ 106.429309][ T5347] lookup_one_qstr_excl+0x12d/0x360 [ 106.437470][ T5347] filename_create+0x20e/0x370 [ 106.439749][ T5347] ? __pfx_filename_create+0x10/0x10 [ 106.442176][ T5347] filename_mkdirat+0xd2/0x550 [ 106.444397][ T5347] ? __might_fault+0xaf/0x130 [ 106.446531][ T5347] ? __pfx_filename_mkdirat+0x10/0x10 [ 106.449131][ T5347] ? do_getname+0x151/0x250 [ 106.451580][ T5347] __se_sys_mkdirat+0x35/0x150 [ 106.453710][ T5347] do_syscall_64+0x171/0x540 [ 106.459498][ T5347] ? trace_irq_disable+0x3b/0x140 [ 106.461819][ T5347] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 106.464738][ T5347] ? clear_bhb_loop+0x70/0xc0 [ 106.466998][ T5347] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 106.469692][ T5347] RIP: 0033:0x7f341d5a9559 [ 106.471780][ T5347] 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 [ 106.480490][ T5347] RSP: 002b:00007f341e547fe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 [ 106.484340][ T5347] RAX: ffffffffffffffda RBX: 00007f341d825fa0 RCX: 00007f341d5a9559 [ 106.487701][ T5347] RDX: 00000000000001ff RSI: 0000200000004000 RDI: ffffffffffffff9c [ 106.491126][ T5347] RBP: 00007f341d638136 R08: 0000000000000000 R09: 0000000000000000 [ 106.494718][ T5347] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 106.498185][ T5347] R13: 00007f341d826038 R14: 00007f341d825fa0 R15: 00007ffdec989668 [ 106.501777][ T5347] [ 106.503873][ T5347] Kernel Offset: disabled [ 106.505993][ T5347] Rebooting in 86400 seconds..