syzbot
KASAN: slab-out-of-bounds Read in ecryptfs_from_hex
Status:
moderation: reported on 2026/10/10 11:15
Subsystems:
ecryptfs
Labels:
prio:high
[Documentation on labels]
Reported-by: syzbot+1a3dae6f4b73cdf3803f@syzkaller.appspotmail.com
First crash: 4d10h, last: 4d10h
Sample crash report:
jffs2: notice: (7625) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
x_tables: duplicate underflow at hook 2
==================================================================
BUG: KASAN: slab-out-of-bounds in ecryptfs_from_hex+0x18c/0x1d0 fs/ecryptfs/crypto.c:45
Read of size 1 at addr ffff88803d7216e0 by task syz.4.349/7625
CPU: 2 UID: 0 PID: 7625 Comm: syz.4.349 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0x13d/0x4b0 mm/kasan/report.c:482
kasan_report+0xdf/0x1c0 mm/kasan/report.c:595
ecryptfs_from_hex+0x18c/0x1d0 fs/ecryptfs/crypto.c:45
write_tag_3_packet+0x145/0x1430 fs/ecryptfs/keystore.c:2182
ecryptfs_generate_key_packet_set+0x7ae/0x1880 fs/ecryptfs/keystore.c:2422
ecryptfs_write_headers_virt fs/ecryptfs/crypto.c:955 [inline]
ecryptfs_write_metadata+0x590/0x930 fs/ecryptfs/crypto.c:1065
ecryptfs_initialize_file+0xb6/0x180 fs/ecryptfs/inode.c:252
ecryptfs_create+0x393/0x550 fs/ecryptfs/inode.c:286
lookup_open+0x1255/0x1990 fs/namei.c:4567
open_last_lookups fs/namei.c:4767 [inline]
path_openat+0xa2c/0x2440 fs/namei.c:4997
do_file_open+0x20e/0x430 fs/namei.c:5029
do_sys_openat2+0x10f/0x1e0 fs/open.c:1417
do_sys_open fs/open.c:1423 [inline]
__do_sys_openat fs/open.c:1439 [inline]
__se_sys_openat fs/open.c:1434 [inline]
__x64_sys_openat+0x12d/0x210 fs/open.c:1434
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fa0b719e199
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:00007fa0b802a028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007fa0b7425fa0 RCX: 00007fa0b719e199
RDX: 0000000000101042 RSI: 0000200000000580 RDI: ffffffffffffff9c
RBP: 00007fa0b72358e0 R08: 0000000000000000 R09: 0000000000000000
R10: 000000000000009d R11: 0000000000000246 R12: 0000000000000000
R13: 00007fa0b7426038 R14: 00007fa0b7425fa0 R15: 00007ffd46d253b8
</TASK>
Allocated by task 6989:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
poison_kmalloc_redzone mm/kasan/common.c:409 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:426
kasan_kmalloc include/linux/kasan.h:263 [inline]
__do_kmalloc_node mm/slub.c:5414 [inline]
__kmalloc_flags_noprof+0x370/0x8e0 mm/slub.c:5602
_kmalloc_flags_noprof mm/slab.h:55 [inline]
alloc_slab_obj_exts+0x6a/0x170 mm/slub.c:2186
account_slab mm/slub.c:3419 [inline]
allocate_slab mm/slub.c:3498 [inline]
new_slab+0x4ac/0x6e0 mm/slub.c:3513
refill_objects+0xe3/0x410 mm/slub.c:7418
refill_sheaf mm/slub.c:2885 [inline]
__pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4774
alloc_from_pcs mm/slub.c:4850 [inline]
slab_alloc_node mm/slub.c:4984 [inline]
kmem_cache_alloc_noprof+0x4c4/0x6a0 mm/slub.c:5010
vm_area_dup+0x27/0x9d0 mm/vma_init.c:128
__split_vma+0x19c/0x1de0 mm/vma.c:560
vms_gather_munmap_vmas+0x3a5/0x1720 mm/vma.c:1528
__mmap_setup mm/vma.c:2546 [inline]
__mmap_region+0x4cc/0x32e0 mm/vma.c:2869
mmap_region+0x3db/0x6d0 mm/vma.c:2974
do_mmap+0x12c7/0x1c30 mm/mmap.c:573
vm_mmap_pgoff+0x28d/0x470 mm/util.c:581
ksys_mmap_pgoff+0x3cb/0x610 mm/mmap.c:619
__do_sys_mmap arch/x86/kernel/sys_x86_64.c:96 [inline]
__se_sys_mmap arch/x86/kernel/sys_x86_64.c:89 [inline]
__x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:89
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff88803d721600
which belongs to the cache kmalloc-256 of size 256
The buggy address is located 24 bytes to the right of
allocated 200-byte region [ffff88803d721600, ffff88803d7216c8)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88803d721c00 pfn:0x3d720
head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000240 ffff88801c042b40 ffffea0000e17b90 ffffea00009afd10
raw: ffff88803d721c00 000000000010000d 00000000f5000000 0000000000000000
head: 00fff00000000240 ffff88801c042b40 ffffea0000e17b90 ffffea00009afd10
head: ffff88803d721c00 000000000010000d 00000000f5000000 0000000000000000
head: 00fff00000000001 ffffffffffffff81 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000002
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 6339, tgid 6339 (modprobe), ts 59223274842
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1871
prep_new_page mm/page_alloc.c:1879 [inline]
get_page_from_freelist+0x110d/0x35d0 mm/page_alloc.c:3943
__alloc_frozen_pages_noprof+0x2eb/0x3300 mm/page_alloc.c:5436
alloc_slab_page mm/slub.c:3347 [inline]
allocate_slab mm/slub.c:3462 [inline]
new_slab+0xa9/0x6e0 mm/slub.c:3513
refill_objects+0xe3/0x410 mm/slub.c:7418
refill_sheaf mm/slub.c:2885 [inline]
__pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4774
alloc_from_pcs mm/slub.c:4850 [inline]
slab_alloc_node mm/slub.c:4984 [inline]
__do_kmalloc_node mm/slub.c:5413 [inline]
__kmalloc_flags_noprof+0x6a9/0x8e0 mm/slub.c:5602
_kmalloc_flags_noprof mm/slab.h:55 [inline]
alloc_slab_obj_exts+0x6a/0x170 mm/slub.c:2186
account_slab mm/slub.c:3419 [inline]
allocate_slab mm/slub.c:3498 [inline]
new_slab+0x4ac/0x6e0 mm/slub.c:3513
refill_objects+0xe3/0x410 mm/slub.c:7418
refill_sheaf mm/slub.c:2885 [inline]
__pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4774
alloc_from_pcs mm/slub.c:4850 [inline]
slab_alloc_node mm/slub.c:4984 [inline]
kmem_cache_alloc_noprof+0x4c4/0x6a0 mm/slub.c:5010
vm_area_alloc+0x1f/0x160 mm/vma_init.c:36
__mmap_new_vma mm/vma.c:2656 [inline]
__mmap_region+0x1025/0x32e0 mm/vma.c:2889
mmap_region+0x3db/0x6d0 mm/vma.c:2974
do_mmap+0x12c7/0x1c30 mm/mmap.c:573
page last free pid 5730 tgid 5730 ts 50592119680 stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
__free_pages_prepare mm/page_alloc.c:1418 [inline]
__free_frozen_pages+0x79f/0x10f0 mm/page_alloc.c:2962
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x47/0xf0 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:361
kasan_slab_alloc include/linux/kasan.h:253 [inline]
slab_post_alloc_hook mm/slub.c:4683 [inline]
slab_alloc_node mm/slub.c:4996 [inline]
kmem_cache_alloc_noprof+0x269/0x6a0 mm/slub.c:5010
alloc_empty_file+0x5b/0x1c0 fs/file_table.c:262
alloc_file fs/file_table.c:396 [inline]
alloc_file_pseudo+0x183/0x290 fs/file_table.c:427
sock_alloc_file+0x50/0x210 net/socket.c:557
sock_map_fd net/socket.c:587 [inline]
__sys_socket+0x1c0/0x260 net/socket.c:1827
__do_sys_socket net/socket.c:1832 [inline]
__se_sys_socket net/socket.c:1830 [inline]
__x64_sys_socket+0x72/0xb0 net/socket.c:1830
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff88803d721580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88803d721600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88803d721680: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
^
ffff88803d721700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88803d721780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
* Struck through repros no longer work on HEAD.