syzbot


KASAN: invalid-access Read in neon_aes_ctr_encrypt

Status: fixed on 2024/03/25 23:45
Subsystems: arm crypto
[Documentation on labels]
Reported-by: syzbot+f1ceaa1a09ab891e1934@syzkaller.appspotmail.com
Fix commit: 1c0cf6d19690 crypto: arm64/neonbs - fix out-of-bounds access on short input
First crash: 292d, last: 277d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [arm?] [crypto?] KASAN: invalid-access Read in neon_aes_ctr_encrypt 1 (3) 2024/02/17 15:01
Last patch testing requests (2)
Created Duration User Patch Repo Result
2024/02/27 22:18 10m retest repro upstream report log
2024/02/17 14:34 26m ardb@kernel.org git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git neon-aes-ctr-fix OK log

Sample crash report:
==================================================================
BUG: KASAN: invalid-access in neon_aes_ctr_encrypt+0x15c/0x1ec arch/arm64/crypto/aes-modes.S:599
Read at addr fcff000006797ff1 by task syz-executor675/3149
Pointer tag: [fc], memory tag: [fe]

CPU: 1 PID: 3149 Comm: syz-executor675 Not tainted 6.8.0-rc4-syzkaller-00005-gc664e16bb1ba #0
Hardware name: linux,dummy-virt (DT)
Call trace:
 dump_backtrace+0x94/0xec arch/arm64/kernel/stacktrace.c:291
 show_stack+0x18/0x24 arch/arm64/kernel/stacktrace.c:298
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x48/0x60 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:377 [inline]
 print_report+0x108/0x618 mm/kasan/report.c:488
 kasan_report+0x88/0xac mm/kasan/report.c:601
 report_tag_fault arch/arm64/mm/fault.c:334 [inline]
 do_tag_recovery arch/arm64/mm/fault.c:346 [inline]
 __do_kernel_fault+0x17c/0x1e8 arch/arm64/mm/fault.c:393
 do_bad_area arch/arm64/mm/fault.c:493 [inline]
 do_tag_check_fault+0x78/0x8c arch/arm64/mm/fault.c:772
 do_mem_abort+0x44/0x94 arch/arm64/mm/fault.c:848
 el1_abort+0x40/0x60 arch/arm64/kernel/entry-common.c:398
 el1h_64_sync_handler+0xd8/0xe4 arch/arm64/kernel/entry-common.c:458
 el1h_64_sync+0x64/0x68 arch/arm64/kernel/entry.S:593
 neon_aes_ctr_encrypt+0x15c/0x1ec arch/arm64/crypto/aes-modes.S:599
 ctr_encrypt+0xfc/0x144 arch/arm64/crypto/aes-neonbs-glue.c:230
 crypto_skcipher_decrypt+0x4c/0x60 crypto/skcipher.c:695
 _skcipher_recvmsg crypto/algif_skcipher.c:199 [inline]
 skcipher_recvmsg+0x39c/0x46c crypto/algif_skcipher.c:221
 sock_recvmsg_nosec net/socket.c:1046 [inline]
 sock_recvmsg net/socket.c:1068 [inline]
 sock_recvmsg net/socket.c:1064 [inline]
 sock_read_iter+0xec/0x118 net/socket.c:1138
 call_read_iter include/linux/fs.h:2079 [inline]
 new_sync_read fs/read_write.c:395 [inline]
 vfs_read+0x2cc/0x304 fs/read_write.c:476
 ksys_read+0xe8/0x104 fs/read_write.c:619
 __do_sys_read fs/read_write.c:629 [inline]
 __se_sys_read fs/read_write.c:627 [inline]
 __arm64_sys_read+0x1c/0x28 fs/read_write.c:627
 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
 invoke_syscall+0x48/0x114 arch/arm64/kernel/syscall.c:51
 el0_svc_common.constprop.0+0x40/0xe0 arch/arm64/kernel/syscall.c:136
 do_el0_svc+0x1c/0x28 arch/arm64/kernel/syscall.c:155
 el0_svc+0x34/0xd8 arch/arm64/kernel/entry-common.c:678
 el0t_64_sync_handler+0x100/0x12c arch/arm64/kernel/entry-common.c:696
 el0t_64_sync+0x19c/0x1a0 arch/arm64/kernel/entry.S:598

The buggy address belongs to the physical page:
page:0000000060acabc6 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x46797
flags: 0x1ffc28000000000(node=0|zone=0|lastcpupid=0x7ff|kasantag=0xa)
page_type: 0xffffffff()
raw: 01ffc28000000000 fffffc0000168bc8 fffffc0000199e08 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff000006797d00: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
 ffff000006797e00: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
>ffff000006797f00: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
                                                                ^
 ffff000006798000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff000006798100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/02/13 22:16 upstream c664e16bb1ba e66542d7 .config console log report syz C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64-mte KASAN: invalid-access Read in neon_aes_ctr_encrypt
2024/02/13 01:52 upstream 716f4aaa7b48 77b23aa1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64-mte KASAN: invalid-access Read in neon_aes_ctr_encrypt
2024/02/13 01:23 upstream 716f4aaa7b48 77b23aa1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64-mte KASAN: invalid-access Read in neon_aes_ctr_encrypt
* Struck through repros no longer work on HEAD.