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') chdir(&(0x7f0000000040)='./mnt\x00') chown(&(0x7f0000000340)='./mnt\x00', 0x0, 0x0) [ 86.340996][ T5299] Bluetooth: hci0: command tx timeout [ 86.544253][ T5352] ================================================================== [ 86.544283][ T5352] BUG: KASAN: slab-use-after-free in ecryptfs_write_tag_70_packet+0x1241/0x12e0 [ 86.544619][ T5352] Read of size 4 at addr ffff888054320c98 by task syz.0.0/5352 [ 86.544652][ T5352] [ 86.544721][ T5352] CPU: 0 UID: 0 PID: 5352 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) [ 86.544755][ T5352] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 86.544763][ T5352] Call Trace: [ 86.544878][ T5352] [ 86.544914][ T5352] dump_stack_lvl+0xe8/0x150 [ 86.544967][ T5352] print_address_description+0x55/0x1e0 [ 86.544987][ T5352] ? ecryptfs_write_tag_70_packet+0x1241/0x12e0 [ 86.545018][ T5352] print_report+0x58/0x70 [ 86.545035][ T5352] kasan_report+0x117/0x150 [ 86.545075][ T5352] ? ecryptfs_write_tag_70_packet+0x1241/0x12e0 [ 86.545089][ T5352] ecryptfs_write_tag_70_packet+0x1241/0x12e0 [ 86.545106][ T5352] ecryptfs_encrypt_and_encode_filename+0x576/0x1580 [ 86.545129][ T5352] ? __pfx_ecryptfs_encrypt_and_encode_filename+0x10/0x10 [ 86.545147][ T5352] ? __d_alloc_parallel+0x156f/0x1700 [ 86.545164][ T5352] ? __d_alloc_parallel+0x39e/0x1700 [ 86.545183][ T5352] ecryptfs_lookup+0x20e/0x780 [ 86.545198][ T5352] ? __pfx_ecryptfs_lookup+0x10/0x10 [ 86.545214][ T5352] ? lock_acquire+0x232/0x350 [ 86.545252][ T5352] __lookup_slow+0x1fb/0x2f0 [ 86.545269][ T5352] lookup_slow+0x59/0x80 [ 86.545283][ T5352] path_lookupat+0x3f5/0x8c0 [ 86.545299][ T5352] filename_lookup+0x265/0x5d0 [ 86.545313][ T5352] ? __pfx_filename_lookup+0x10/0x10 [ 86.545332][ T5352] ? strncpy_from_user+0x150/0x2c0 [ 86.545393][ T5352] ? do_getname+0x151/0x250 [ 86.545406][ T5352] do_fchownat+0xfa/0x250 [ 86.545425][ T5352] ? __pfx_do_fchownat+0x10/0x10 [ 86.545444][ T5352] __x64_sys_chown+0x82/0xa0 [ 86.545461][ T5352] do_syscall_64+0x16a/0x530 [ 86.545560][ T5352] ? trace_irq_disable+0x3b/0x140 [ 86.545579][ T5352] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 86.545608][ T5352] ? clear_bhb_loop+0x70/0xc0 [ 86.545623][ T5352] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 86.545634][ T5352] RIP: 0033:0x7fb9c07a94d9 [ 86.545658][ T5352] 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 [ 86.545669][ T5352] RSP: 002b:00007fb9c168efe8 EFLAGS: 00000246 ORIG_RAX: 000000000000005c [ 86.545697][ T5352] RAX: ffffffffffffffda RBX: 00007fb9c0a25fa0 RCX: 00007fb9c07a94d9 [ 86.545707][ T5352] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000200000000340 [ 86.545716][ T5352] RBP: 00007fb9c083804e R08: 0000000000000000 R09: 0000000000000000 [ 86.545723][ T5352] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 86.545731][ T5352] R13: 00007fb9c0a26038 R14: 00007fb9c0a25fa0 R15: 00007fffce904618 [ 86.545744][ T5352] [ 86.545749][ T5352] [ 86.545752][ T5352] Allocated by task 5352: [ 86.545770][ T5352] kasan_save_track+0x3e/0x80 [ 86.545786][ T5352] __kasan_kmalloc+0x93/0xb0 [ 86.545801][ T5352] __kvmalloc_node_noprof+0x50a/0x820 [ 86.545818][ T5352] __se_sys_add_key+0x289/0x420 [ 86.545857][ T5352] do_syscall_64+0x16a/0x530 [ 86.545869][ T5352] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 86.545880][ T5352] [ 86.545883][ T5352] Freed by task 5352: [ 86.545888][ T5352] kasan_save_track+0x3e/0x80 [ 86.545900][ T5352] kasan_save_free_info+0x40/0x50 [ 86.545917][ T5352] __kasan_slab_free+0x5c/0x80 [ 86.545932][ T5352] kfree+0x1c5/0x650 [ 86.545943][ T5352] __se_sys_add_key+0x3a3/0x420 [ 86.545953][ T5352] do_syscall_64+0x16a/0x530 [ 86.545964][ T5352] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 86.545975][ T5352] [ 86.545977][ T5352] The buggy address belongs to the object at ffff888054320c00 [ 86.545977][ T5352] which belongs to the cache kmalloc-256 of size 256 [ 86.545988][ T5352] The buggy address is located 152 bytes inside of [ 86.545988][ T5352] freed 256-byte region [ffff888054320c00, ffff888054320d00) [ 86.545999][ T5352] [ 86.546002][ T5352] The buggy address belongs to the physical page: [ 86.546010][ T5352] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x54320 [ 86.546023][ T5352] flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) [ 86.546034][ T5352] page_type: f5(slab) [ 86.546045][ T5352] raw: 04fff00000000000 ffff88801c841b40 dead000000000100 dead000000000122 [ 86.546056][ T5352] raw: 0000000000000000 0000000000080008 00000000f5000000 0000000000000000 [ 86.546062][ T5352] page dumped because: kasan: bad access detected [ 86.546068][ T5352] page_owner tracks the page as allocated [ 86.546072][ T5352] page last allocated via order 0, migratetype Unmovable, gfp_mask 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5298, tgid 5298 (syz-executor), ts 84146678543 [ 86.546091][ T5352] post_alloc_hook+0x1f9/0x250 [ 86.546104][ T5352] get_page_from_freelist+0x225d/0x22e0 [ 86.546117][ T5352] __alloc_frozen_pages_noprof+0x211/0x450 [ 86.546130][ T5352] allocate_slab+0x7d/0x5e0 [ 86.546145][ T5352] refill_objects+0x2d5/0x350 [ 86.546155][ T5352] __pcs_replace_empty_main+0x2c8/0x6c0 [ 86.546170][ T5352] __kmalloc_noprof+0x476/0x710 [ 86.546181][ T5352] fib_create_info+0x16fe/0x3170 [ 86.546269][ T5352] fib_table_insert+0xcb/0x1b10 [ 86.546279][ T5352] fib_magic+0x43b/0x530 [ 86.546291][ T5352] fib_add_ifaddr+0x139/0x5d0 [ 86.546303][ T5352] fib_netdev_event+0x382/0x490 [ 86.546316][ T5352] notifier_call_chain+0x1a5/0x3d0 [ 86.546329][ T5352] __dev_notify_flags+0x31e/0x510 [ 86.546363][ T5352] netif_change_flags+0xde/0x1b0 [ 86.546376][ T5352] do_setlink+0xdd6/0x47a0 [ 86.546399][ T5352] page_owner free stack trace missing [ 86.546403][ T5352] [ 86.546405][ T5352] Memory state around the buggy address: [ 86.546411][ T5352] ffff888054320b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 86.546419][ T5352] ffff888054320c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 86.546428][ T5352] >ffff888054320c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 86.546433][ T5352] ^ [ 86.546439][ T5352] ffff888054320d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 86.546447][ T5352] ffff888054320d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 86.546453][ T5352] ================================================================== [ 86.547691][ T5352] Kernel panic - not syncing: KASAN: panic_on_warn set ... [ 86.814094][ T5352] CPU: 0 UID: 0 PID: 5352 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) [ 86.818512][ T5352] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 86.824567][ T5352] Call Trace: [ 86.826522][ T5352] [ 86.828120][ T5352] vpanic+0x26f/0x710 [ 86.830293][ T5352] panic+0xc5/0xd0 [ 86.831996][ T5352] ? __pfx_panic+0x10/0x10 [ 86.833983][ T5352] ? preempt_schedule_thunk+0x16/0x40 [ 86.836189][ T5352] ? preempt_schedule_thunk+0x16/0x40 [ 86.838525][ T5352] ? ecryptfs_write_tag_70_packet+0x1241/0x12e0 [ 86.841379][ T5352] check_panic_on_warn+0x89/0xb0 [ 86.843727][ T5352] ? ecryptfs_write_tag_70_packet+0x1241/0x12e0 [ 86.846505][ T5352] end_report+0x73/0x170 [ 86.848365][ T5352] ? ecryptfs_write_tag_70_packet+0x1241/0x12e0 [ 86.851062][ T5352] kasan_report+0x128/0x150 [ 86.852969][ T5352] ? ecryptfs_write_tag_70_packet+0x1241/0x12e0 [ 86.855602][ T5352] ecryptfs_write_tag_70_packet+0x1241/0x12e0 [ 86.858010][ T5352] ecryptfs_encrypt_and_encode_filename+0x576/0x1580 [ 86.860599][ T5352] ? __pfx_ecryptfs_encrypt_and_encode_filename+0x10/0x10 [ 86.863688][ T5352] ? __d_alloc_parallel+0x156f/0x1700 [ 86.866369][ T5352] ? __d_alloc_parallel+0x39e/0x1700 [ 86.869053][ T5352] ecryptfs_lookup+0x20e/0x780 [ 86.871589][ T5352] ? __pfx_ecryptfs_lookup+0x10/0x10 [ 86.874030][ T5352] ? lock_acquire+0x232/0x350 [ 86.876073][ T5352] __lookup_slow+0x1fb/0x2f0 [ 86.878089][ T5352] lookup_slow+0x59/0x80 [ 86.879960][ T5352] path_lookupat+0x3f5/0x8c0 [ 86.881939][ T5352] filename_lookup+0x265/0x5d0 [ 86.883987][ T5352] ? __pfx_filename_lookup+0x10/0x10 [ 86.886307][ T5352] ? strncpy_from_user+0x150/0x2c0 [ 86.888535][ T5352] ? do_getname+0x151/0x250 [ 86.890485][ T5352] do_fchownat+0xfa/0x250 [ 86.892294][ T5352] ? __pfx_do_fchownat+0x10/0x10 [ 86.894256][ T5352] __x64_sys_chown+0x82/0xa0 [ 86.896120][ T5352] do_syscall_64+0x16a/0x530 [ 86.898846][ T5352] ? trace_irq_disable+0x3b/0x140 [ 86.901080][ T5352] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 86.903783][ T5352] ? clear_bhb_loop+0x70/0xc0 [ 86.905772][ T5352] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 86.908222][ T5352] RIP: 0033:0x7fb9c07a94d9 [ 86.910209][ T5352] 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 [ 86.917677][ T5352] RSP: 002b:00007fb9c168efe8 EFLAGS: 00000246 ORIG_RAX: 000000000000005c [ 86.921184][ T5352] RAX: ffffffffffffffda RBX: 00007fb9c0a25fa0 RCX: 00007fb9c07a94d9 [ 86.924611][ T5352] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000200000000340 [ 86.928074][ T5352] RBP: 00007fb9c083804e R08: 0000000000000000 R09: 0000000000000000 [ 86.931415][ T5352] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 86.934730][ T5352] R13: 00007fb9c0a26038 R14: 00007fb9c0a25fa0 R15: 00007fffce904618 [ 86.938055][ T5352] [ 86.942460][ T5352] Kernel Offset: disabled [ 86.944243][ T5352] Rebooting in 86400 seconds..