KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key

Status: upstream: reported C repro on 2026/09/17 10:18
Reported-by: syzbot+d0373a1c57c97e6f7566@syzkaller.appspotmail.com
First crash: 2d18h, last: 2d17h
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key prio:high ecryptfs 17 syz, C 24 8h05m 3d12h 0/29 upstream: reported C repro on 2026/09/16 15:53

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in ecryptfs_verify_auth_tok_from_key+0x34b/0x390 fs/ecryptfs/keystore.c:466
Read of size 2 at addr ffff88801db9d999 by task syz.0.17/4434

CPU: 1 PID: 4434 Comm: syz.0.17 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:316 [inline]
 print_report+0xa8/0x210 mm/kasan/report.c:420
 kasan_report+0x10b/0x140 mm/kasan/report.c:524
 ecryptfs_verify_auth_tok_from_key+0x34b/0x390 fs/ecryptfs/keystore.c:466
 ecryptfs_keyring_auth_tok_for_sig+0xe8/0x240 fs/ecryptfs/keystore.c:1645
 ecryptfs_init_global_auth_toks fs/ecryptfs/main.c:194 [inline]
 ecryptfs_parse_options fs/ecryptfs/main.c:458 [inline]
 ecryptfs_mount+0xbee/0x1980 fs/ecryptfs/main.c:501
 legacy_get_tree+0xe6/0x180 fs/fs_context.c:632
 vfs_get_tree+0x88/0x270 fs/super.c:1584
 do_new_mount+0x247/0xa40 fs/namespace.c:3078
 do_mount fs/namespace.c:3421 [inline]
 __do_sys_mount fs/namespace.c:3629 [inline]
 __se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3606
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f3e3c59e159
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:00007ffcd39403a8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f3e3c825fa0 RCX: 00007f3e3c59e159
RDX: 0000200000000480 RSI: 0000200000000000 RDI: 0000200000000400
RBP: 00007f3e3c63506b R08: 0000200000000500 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f3e3c825fac R14: 00007f3e3c825fa0 R15: 00007f3e3c825fa0
 </TASK>

Allocated by task 4434:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
 ____kasan_kmalloc mm/kasan/common.c:375 [inline]
 __kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:384
 kasan_kmalloc include/linux/kasan.h:211 [inline]
 __do_kmalloc_node mm/slab_common.c:936 [inline]
 __kmalloc+0xb3/0x240 mm/slab_common.c:949
 kmalloc include/linux/slab.h:568 [inline]
 user_preparse+0x9a/0x160 security/keys/user_defined.c:67
 key_create_or_update+0x432/0xa40 security/keys/key.c:862
 __do_sys_add_key security/keys/keyctl.c:134 [inline]
 __se_sys_add_key+0x34b/0x410 security/keys/keyctl.c:74
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

The buggy address belongs to the object at ffff88801db9d980
 which belongs to the cache kmalloc-32 of size 32
The buggy address is located 25 bytes inside of
 32-byte region [ffff88801db9d980, ffff88801db9d9a0)

The buggy address belongs to the physical page:
page:ffffea000076e740 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1db9d
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 0000000000000000 dead000000000122 ffff888017441500
raw: 0000000000000000 0000000000400040 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 4381, tgid 4381 (syz-executor), ts 80773862792, free_ts 80773764744
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2560
 prep_new_page mm/page_alloc.c:2567 [inline]
 get_page_from_freelist+0x206b/0x2180 mm/page_alloc.c:4358
 __alloc_pages+0x1ec/0x4f0 mm/page_alloc.c:5658
 alloc_slab_page+0x5d/0x180 mm/slub.c:1799
 allocate_slab mm/slub.c:1944 [inline]
 new_slab+0x87/0x2d0 mm/slub.c:1997
 ___slab_alloc+0xbc5/0x1240 mm/slub.c:3154
 __slab_alloc mm/slub.c:3240 [inline]
 slab_alloc_node mm/slub.c:3325 [inline]
 __kmem_cache_alloc_node+0x126/0x270 mm/slub.c:3398
 kmalloc_trace+0x26/0xe0 mm/slab_common.c:1026
 kmalloc include/linux/slab.h:563 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 nf_nat_register_fn+0x29a/0x540 net/netfilter/nf_nat_core.c:1037
 ipt_nat_register_lookups net/ipv4/netfilter/iptable_nat.c:77 [inline]
 iptable_nat_table_init+0xd0/0x2d0 net/ipv4/netfilter/iptable_nat.c:121
 xt_find_table_lock+0x220/0x360 net/netfilter/x_tables.c:1282
 xt_request_find_table_lock+0x22/0x100 net/netfilter/x_tables.c:1307
 get_info net/ipv4/netfilter/ip_tables.c:963 [inline]
 do_ipt_get_ctl+0x6e2/0x11a0 net/ipv4/netfilter/ip_tables.c:1658
 nf_getsockopt+0x25e/0x280 net/netfilter/nf_sockopt.c:116
 ip_getsockopt+0x19b/0x230 net/ipv4/ip_sockglue.c:1826
 __sys_getsockopt+0x1b0/0x230 net/socket.c:2332
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1487 [inline]
 free_pcp_prepare mm/page_alloc.c:1537 [inline]
 free_unref_page_prepare+0x8e5/0x9e0 mm/page_alloc.c:3414
 free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3509
 __vunmap+0x874/0xa40 mm/vmalloc.c:2783
 copy_entries_to_user net/ipv4/netfilter/ip_tables.c:866 [inline]
 get_entries net/ipv4/netfilter/ip_tables.c:1022 [inline]
 do_ipt_get_ctl+0xe89/0x11a0 net/ipv4/netfilter/ip_tables.c:1667
 nf_getsockopt+0x25e/0x280 net/netfilter/nf_sockopt.c:116
 ip_getsockopt+0x19b/0x230 net/ipv4/ip_sockglue.c:1826
 __sys_getsockopt+0x1b0/0x230 net/socket.c:2332
 __do_sys_getsockopt net/socket.c:2347 [inline]
 __se_sys_getsockopt net/socket.c:2344 [inline]
 __x64_sys_getsockopt+0xb1/0xc0 net/socket.c:2344
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Memory state around the buggy address:
 ffff88801db9d880: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
 ffff88801db9d900: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
>ffff88801db9d980: 00 00 00 01 fc fc fc fc fa fb fb fb fc fc fc fc
                            ^
 ffff88801db9da00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
 ffff88801db9da80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/09/17 11:24 linux-6.1.y 1a8763b93150 95928915 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
2026/09/17 10:21 linux-6.1.y 1a8763b93150 95928915 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
2026/09/17 10:18 linux-6.1.y 1a8763b93150 95928915 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: slab-out-of-bounds Read in ecryptfs_verify_auth_tok_from_key
* Struck through repros no longer work on HEAD.