program: syz_mount_image$ext4(&(0x7f00000000c0)='ext4\x00', &(0x7f0000000280)='mnt\x00', 0x808018, &(0x7f0000000200)={[{@max_dir_size_kb={'max_dir_size_kb', 0x3d, 0xc500}}, {@dioread_lock}]}, 0x0, 0x236, &(0x7f0000000300)="$eJzs3TFoM2UcBvDnLomf/b4gVRdBUEFEtFDqJrjURaEgpYgIKlREXJRWqC1urZOLg84qnVyKuFkdpUtxUQSnqh3qImhxsDjoELlcK9VGFFNz8t3vB5fcJe97//e4e95kOS5Aa00nmU/SSTKTpJekON/grnqZPt3cntpfTgaDx38shu3q7dpZv2tJtpI8mGSvLPJiN9nYffro54NH731jvXfPe7tPTU30IE8dHx0+dvLu4usfLjyw8fmX3y8WmU//D8d1+YoRn3WL5Jb/otj/RNFtegT8E0uvfvBVlftbk9w9zH8vZeqT9+baDXu93P/OX/V964cvbp/kWIHLNxj0qt/ArQHQOmWSfopyNkm9Xpazs/V/+K87V8uXVtdemXlhdX3l+aZnKuCy9JPDRz6+8tG1P+X/u06df+D6VeX/iaWdb6r1k07TowEmqcr/zLOb90X+oXXkH9pL/qG95B/aS/6hveQf2kv+ob3kH9pL/qG95B/a63z+AYB2GVxp+g5koClNzz8AAAAAAAAAAAAAAAAAAMBF21P7y2fLpGp++nZy/HCS7qj6neHziJMbh69XfyqqZr8r6m5jeebOMXcwpvcbvvv6pm+brf/ZHc3W31xJtl5LMtftXrz+itPr79+7+W++7z03ZoExPfRks/V/3Wm2/sJB8kk1/8yNmn/K3DZ8Hz3/9KvzN2b9l38ZcwcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMzG8BAAD//8n0bSk=") mkdirat(0xffffffffffffff9c, &(0x7f0000000000)='./lower\x00', 0x1ff) add_key$user(&(0x7f0000000100), &(0x7f0000000140)={'syz', 0x0}, &(0x7f0000000700)="0400"/400, 0x190, 0xfffffffffffffffd) mount(&(0x7f0000000a40)=@filename='./lower\x00', &(0x7f0000000a80)='./mnt\x00', &(0x7f0000000ac0)='ecryptfs\x00', 0x0, &(0x7f0000000b00)='ecryptfs_sig=syz ,ecryptfs_cipher=aes,ecryptfs_key_bytes=16\x00') mkdirat(0xffffffffffffff9c, &(0x7f0000000640)='mnt/encrypted_dir\x00', 0x0) chdir(&(0x7f00000002c0)='mnt/encrypted_dir\x00') openat$cgroup_ro(0xffffffffffffff9c, &(0x7f0000000080)='memory.events\x00', 0x275a, 0x0) [ 74.462978][ T4646] Bluetooth: hci0: command tx timeout [ 74.569391][ T5312] loop0: detected capacity change from 0 to 128 [ 74.738576][ T5312] EXT4-fs (loop0): mounted filesystem 76b65be2-f6da-4727-8c75-0525a5b65a09 r/w without journal. Quota mode: none. [ 74.739704][ T5312] ext4 filesystem being mounted at /0/mnt supports timestamps until 2038-01-19 (0x7fffffff) [ 74.849700][ T5312] ================================================================== [ 74.849717][ T5312] BUG: KASAN: slab-out-of-bounds in ecryptfs_from_hex+0x138/0x1c0 [ 74.849899][ T5312] Read of size 1 at addr ffff8880149092e0 by task syz.0.0/5312 [ 74.849909][ T5312] [ 74.849956][ T5312] CPU: 0 UID: 0 PID: 5312 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) [ 74.849970][ T5312] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 74.849978][ T5312] Call Trace: [ 74.850000][ T5312] [ 74.850006][ T5312] dump_stack_lvl+0xe8/0x150 [ 74.850034][ T5312] print_address_description+0x55/0x1e0 [ 74.850051][ T5312] ? ecryptfs_from_hex+0x138/0x1c0 [ 74.850070][ T5312] print_report+0x58/0x70 [ 74.850092][ T5312] kasan_report+0x117/0x150 [ 74.850120][ T5312] ? __mutex_unlock_slowpath+0x731/0x900 [ 74.850244][ T5312] ? ecryptfs_from_hex+0x138/0x1c0 [ 74.850265][ T5312] ecryptfs_from_hex+0x138/0x1c0 [ 74.850280][ T5312] ? __pfx_ecryptfs_from_hex+0x10/0x10 [ 74.850293][ T5312] ? ecryptfs_find_global_auth_tok_for_sig+0x231/0x330 [ 74.850310][ T5312] ecryptfs_generate_key_packet_set+0x401/0x2aa0 [ 74.850332][ T5312] ? __pfx_ecryptfs_generate_key_packet_set+0x10/0x10 [ 74.850348][ T5312] ? crng_make_state+0x2c5/0x600 [ 74.850418][ T5312] ? __asan_memset+0x22/0x50 [ 74.850436][ T5312] ecryptfs_write_metadata+0x407/0x920 [ 74.850453][ T5312] ? __pfx_ecryptfs_write_metadata+0x10/0x10 [ 74.850466][ T5312] ? ecryptfs_init_crypt_ctx+0x198/0x200 [ 74.850481][ T5312] ? ecryptfs_new_file_context+0x704/0xa50 [ 74.850495][ T5312] ? ecryptfs_get_lower_file+0x199/0x250 [ 74.850507][ T5312] ecryptfs_initialize_file+0xf8/0x190 [ 74.850524][ T5312] ecryptfs_create+0xaf/0x430 [ 74.850535][ T5312] lookup_open+0xc0d/0x1a40 [ 74.850552][ T5312] path_openat+0x677/0x1d60 [ 74.850568][ T5312] do_file_open+0x23e/0x4a0 [ 74.850580][ T5312] ? __pfx_do_file_open+0x10/0x10 [ 74.850596][ T5312] ? _raw_spin_unlock+0x28/0x50 [ 74.850613][ T5312] ? alloc_fd+0x651/0x6c0 [ 74.850629][ T5312] do_sys_openat2+0x115/0x200 [ 74.850643][ T5312] ? __se_sys_futex+0x3a8/0x450 [ 74.850676][ T5312] ? __pfx_do_sys_openat2+0x10/0x10 [ 74.850691][ T5312] ? rcu_is_watching+0x16/0xb0 [ 74.850707][ T5312] __x64_sys_openat+0x138/0x170 [ 74.850722][ T5312] do_syscall_64+0x166/0x520 [ 74.850734][ T5312] ? trace_irq_disable+0x3b/0x140 [ 74.850747][ T5312] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 74.850758][ T5312] ? clear_bhb_loop+0x70/0xc0 [ 74.850770][ T5312] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 74.850780][ T5312] RIP: 0033:0x7fcec3f9e1d9 [ 74.850813][ T5312] 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 [ 74.850823][ T5312] RSP: 002b:00007fcec4dd5fe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 [ 74.850839][ T5312] RAX: ffffffffffffffda RBX: 00007fcec4225fa0 RCX: 00007fcec3f9e1d9 [ 74.850847][ T5312] RDX: 000000000000275a RSI: 0000200000000080 RDI: ffffffffffffff9c [ 74.850856][ T5312] RBP: 00007fcec4035888 R08: 0000000000000000 R09: 0000000000000000 [ 74.850864][ T5312] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 74.850871][ T5312] R13: 00007fcec4226038 R14: 00007fcec4225fa0 R15: 00007ffdec4a0248 [ 74.850883][ T5312] [ 74.850887][ T5312] [ 74.850890][ T5312] Allocated by task 5312: [ 74.850897][ T5312] kasan_save_track+0x3e/0x80 [ 74.850908][ T5312] __kasan_kmalloc+0x93/0xb0 [ 74.850919][ T5312] __kmalloc_noprof+0x36b/0x720 [ 74.850928][ T5312] user_preparse+0x9e/0x160 [ 74.850983][ T5312] __key_create_or_update+0x354/0xa70 [ 74.850998][ T5312] key_create_or_update+0x42/0x60 [ 74.851011][ T5312] __se_sys_add_key+0x349/0x420 [ 74.851021][ T5312] do_syscall_64+0x166/0x520 [ 74.851031][ T5312] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 74.851040][ T5312] [ 74.851043][ T5312] The buggy address belongs to the object at ffff888014909000 [ 74.851043][ T5312] which belongs to the cache kmalloc-512 of size 512 [ 74.851052][ T5312] The buggy address is located 312 bytes to the right of [ 74.851052][ T5312] allocated 424-byte region [ffff888014909000, ffff8880149091a8) [ 74.851063][ T5312] [ 74.851066][ T5312] The buggy address belongs to the physical page: [ 74.851073][ T5312] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x14908 [ 74.851101][ T5312] head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 [ 74.851111][ T5312] flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) [ 74.851123][ T5312] page_type: f5(slab) [ 74.851134][ T5312] raw: 00fff00000000040 ffff88801c041c80 dead000000000100 dead000000000122 [ 74.851143][ T5312] raw: 0000000000000000 0000000000080008 00000000f5000000 0000000000000000 [ 74.851154][ T5312] head: 00fff00000000040 ffff88801c041c80 dead000000000100 dead000000000122 [ 74.851186][ T5312] head: 0000000000000000 0000000000080008 00000000f5000000 0000000000000000 [ 74.851199][ T5312] head: 00fff00000000001 ffffffffffffff81 00000000ffffffff 00000000ffffffff [ 74.851209][ T5312] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000002 [ 74.851215][ T5312] page dumped because: kasan: bad access detected [ 74.851221][ T5312] page_owner tracks the page as allocated [ 74.851225][ T5312] page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5275, tgid 5275 (syz-executor), ts 73255061818 [ 74.851246][ T5312] post_alloc_hook+0x1f9/0x250 [ 74.851263][ T5312] get_page_from_freelist+0x2209/0x2280 [ 74.851275][ T5312] __alloc_frozen_pages_noprof+0x217/0x5a0 [ 74.851286][ T5312] allocate_slab+0x7d/0x620 [ 74.851299][ T5312] refill_objects+0x2d5/0x350 [ 74.851311][ T5312] __pcs_replace_empty_main+0x2c8/0x6c0 [ 74.851323][ T5312] __kmalloc_node_track_caller_noprof+0x548/0x720 [ 74.851334][ T5312] kmemdup_array+0x3f/0x80 [ 74.851345][ T5312] xt_register_table+0xac/0xa40 [ 74.851381][ T5312] ip6t_register_table+0x16e/0x320 [ 74.851410][ T5312] ip6table_mangle_table_init+0x41/0x70 [ 74.851421][ T5312] xt_find_table_lock+0x311/0x400 [ 74.851431][ T5312] xt_request_find_table_lock+0x26/0x100 [ 74.851442][ T5312] do_ip6t_get_ctl+0x77b/0x12f0 [ 74.851457][ T5312] nf_getsockopt+0x26e/0x290 [ 74.851473][ T5312] ipv6_getsockopt+0x213/0x2c0 [ 74.851486][ T5312] page last free pid 77 tgid 77 ts 73223785541 stack trace: [ 74.851494][ T5312] free_unref_folios+0xdc2/0x14e0 [ 74.851508][ T5312] shrink_folio_list+0x4a2d/0x5250 [ 74.851518][ T5312] evict_folios+0x3055/0x3fb0 [ 74.851533][ T5312] try_to_shrink_lruvec+0xe3b/0x1340 [ 74.851542][ T5312] shrink_one+0x233/0x730 [ 74.851551][ T5312] shrink_node+0x35d0/0x3e30 [ 74.851560][ T5312] kswapd+0x185e/0x32c0 [ 74.851571][ T5312] kthread+0x38b/0x480 [ 74.851580][ T5312] ret_from_fork+0x514/0xb70 [ 74.851590][ T5312] ret_from_fork_asm+0x1a/0x30 [ 74.851600][ T5312] [ 74.851603][ T5312] Memory state around the buggy address: [ 74.851609][ T5312] ffff888014909180: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc [ 74.851617][ T5312] ffff888014909200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 74.851626][ T5312] >ffff888014909280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 74.851631][ T5312] ^ [ 74.851637][ T5312] ffff888014909300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 74.851644][ T5312] ffff888014909380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 74.851649][ T5312] ================================================================== [ 74.851712][ T5312] Kernel panic - not syncing: KASAN: panic_on_warn set ... [ 75.158547][ T5312] CPU: 0 UID: 0 PID: 5312 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) [ 75.162654][ T5312] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 75.166906][ T5312] Call Trace: [ 75.168348][ T5312] [ 75.169621][ T5312] vpanic+0x56d/0xa60 [ 75.171393][ T5312] ? rcu_is_watching+0x16/0xb0 [ 75.173477][ T5312] ? __pfx_vpanic+0x10/0x10 [ 75.175433][ T5312] panic+0xc5/0xd0 [ 75.177212][ T5312] ? __pfx_panic+0x10/0x10 [ 75.179145][ T5312] ? ecryptfs_from_hex+0x138/0x1c0 [ 75.181331][ T5312] ? ecryptfs_from_hex+0x138/0x1c0 [ 75.183494][ T5312] check_panic_on_warn+0x89/0xb0 [ 75.185604][ T5312] ? ecryptfs_from_hex+0x138/0x1c0 [ 75.187752][ T5312] end_report+0x73/0x170 [ 75.189559][ T5312] ? ecryptfs_from_hex+0x138/0x1c0 [ 75.191705][ T5312] kasan_report+0x128/0x150 [ 75.193659][ T5312] ? __mutex_unlock_slowpath+0x731/0x900 [ 75.195936][ T5312] ? ecryptfs_from_hex+0x138/0x1c0 [ 75.198057][ T5312] ecryptfs_from_hex+0x138/0x1c0 [ 75.200427][ T5312] ? __pfx_ecryptfs_from_hex+0x10/0x10 [ 75.202761][ T5312] ? ecryptfs_find_global_auth_tok_for_sig+0x231/0x330 [ 75.205666][ T5312] ecryptfs_generate_key_packet_set+0x401/0x2aa0 [ 75.208504][ T5312] ? __pfx_ecryptfs_generate_key_packet_set+0x10/0x10 [ 75.211361][ T5312] ? crng_make_state+0x2c5/0x600 [ 75.213526][ T5312] ? __asan_memset+0x22/0x50 [ 75.215588][ T5312] ecryptfs_write_metadata+0x407/0x920 [ 75.218009][ T5312] ? __pfx_ecryptfs_write_metadata+0x10/0x10 [ 75.220713][ T5312] ? ecryptfs_init_crypt_ctx+0x198/0x200 [ 75.223292][ T5312] ? ecryptfs_new_file_context+0x704/0xa50 [ 75.225887][ T5312] ? ecryptfs_get_lower_file+0x199/0x250 [ 75.228322][ T5312] ecryptfs_initialize_file+0xf8/0x190 [ 75.230882][ T5312] ecryptfs_create+0xaf/0x430 [ 75.232956][ T5312] lookup_open+0xc0d/0x1a40 [ 75.234897][ T5312] path_openat+0x677/0x1d60 [ 75.237084][ T5312] do_file_open+0x23e/0x4a0 [ 75.239203][ T5312] ? __pfx_do_file_open+0x10/0x10 [ 75.241505][ T5312] ? _raw_spin_unlock+0x28/0x50 [ 75.243812][ T5312] ? alloc_fd+0x651/0x6c0 [ 75.245562][ T5312] do_sys_openat2+0x115/0x200 [ 75.247671][ T5312] ? __se_sys_futex+0x3a8/0x450 [ 75.249927][ T5312] ? __pfx_do_sys_openat2+0x10/0x10 [ 75.252317][ T5312] ? rcu_is_watching+0x16/0xb0 [ 75.254536][ T5312] __x64_sys_openat+0x138/0x170 [ 75.256803][ T5312] do_syscall_64+0x166/0x520 [ 75.258879][ T5312] ? trace_irq_disable+0x3b/0x140 [ 75.261148][ T5312] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 75.263953][ T5312] ? clear_bhb_loop+0x70/0xc0 [ 75.266079][ T5312] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 75.268683][ T5312] RIP: 0033:0x7fcec3f9e1d9 [ 75.270777][ T5312] 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 [ 75.279510][ T5312] RSP: 002b:00007fcec4dd5fe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 [ 75.283278][ T5312] RAX: ffffffffffffffda RBX: 00007fcec4225fa0 RCX: 00007fcec3f9e1d9 [ 75.286772][ T5312] RDX: 000000000000275a RSI: 0000200000000080 RDI: ffffffffffffff9c [ 75.290342][ T5312] RBP: 00007fcec4035888 R08: 0000000000000000 R09: 0000000000000000 [ 75.293852][ T5312] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 75.297343][ T5312] R13: 00007fcec4226038 R14: 00007fcec4225fa0 R15: 00007ffdec4a0248 [ 75.300823][ T5312] [ 75.304407][ T5312] Kernel Offset: disabled [ 75.306389][ T5312] Rebooting in 86400 seconds..