syzbot


general protection fault in fscrypt_limit_io_blocks

Status: fixed on 2023/02/02 00:40
Reported-by: syzbot+ba9dac45bc76c490b7c3@syzkaller.appspotmail.com
Fix commit: 58fef3ebc83c ext4: don't allow journal inode to have encrypt flag
First crash: 488d, last: 429d
Cause bisection: failed (error log, bisect log)
  
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] fscrypt: Fix null pointer when defer i_crypt_info 4 (4) 2022/12/14 06:54
[PATCH] ext4: don't allow journal inode to have encrypt flag 4 (4) 2022/12/08 03:41
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-10 general protection fault in fscrypt_limit_io_blocks C error 5 424d 488d 2/2 fixed on 2023/05/04 14:51
Last patch testing requests (3)
Created Duration User Patch Repo Result
2022/12/12 10:14 7m jun.nie@linaro.org android13-5.15-lts report log
2022/12/09 15:49 12m tudor.ambarus@linaro.org git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git linux-5.15.y OK log
2022/12/09 15:47 7m tudor.ambarus@linaro.org upstream report log

Sample crash report:
EXT4-fs error (device loop0): ext4_get_journal_inode:5148: inode #3: comm syz-executor138: casefold flag without casefold feature
general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]
CPU: 0 PID: 416 Comm: syz-executor138 Not tainted 5.15.74-syzkaller-04383-g7f2e600bf63a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022
RIP: 0010:__fscrypt_inode_uses_inline_crypto fs/crypto/inline_crypt.c:233 [inline]
RIP: 0010:fscrypt_inode_uses_inline_crypto include/linux/fscrypt.h:798 [inline]
RIP: 0010:fscrypt_limit_io_blocks+0xc7/0x2a0 fs/crypto/inline_crypt.c:477
Code: c4 c8 02 00 00 4d 89 e6 49 c1 ee 03 43 80 3c 2e 00 74 08 4c 89 e7 e8 18 90 db ff 49 8b 1c 24 48 83 c3 11 48 89 d8 48 c1 e8 03 <42> 8a 04 28 84 c0 0f 85 53 01 00 00 0f b6 1b 31 ff 89 de e8 51 46
RSP: 0018:ffffc900003ff260 EFLAGS: 00010202
RAX: 0000000000000002 RBX: 0000000000000011 RCX: 0000000000000000
RDX: ffff888106fde2c0 RSI: 0000000000008000 RDI: 0000000000008000
RBP: ffffc900003ff290 R08: ffffffff81d84dff R09: ffffed102132e19a
R10: ffffed102132e19a R11: 1ffff1102132e199 R12: ffff888109970fd0
R13: dffffc0000000000 R14: 1ffff1102132e1fa R15: 0000000000000001
FS:  000055555750e300(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000056418e982c60 CR3: 000000011f40f000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 ext4_iomap_begin+0xa05/0xd90 fs/ext4/inode.c:3476
 iomap_iter+0x660/0x830 fs/iomap/iter.c:74
 iomap_bmap+0x2b5/0x550 fs/iomap/fiemap.c:113
 ext4_bmap+0x3b0/0x430 fs/ext4/inode.c:3216
 bmap+0xa5/0xe0 fs/inode.c:1714
 jbd2_journal_init_inode+0x9e/0x3f0 fs/jbd2/journal.c:1485
 ext4_get_journal fs/ext4/super.c:5183 [inline]
 ext4_load_journal+0x30b/0x1440 fs/ext4/super.c:5317
 ext4_fill_super+0x6241/0x9650 fs/ext4/super.c:4663
 mount_bdev+0x280/0x3b0 fs/super.c:1368
 ext4_mount+0x34/0x40 fs/ext4/super.c:6545
 legacy_get_tree+0xf0/0x190 fs/fs_context.c:610
 vfs_get_tree+0x88/0x290 fs/super.c:1498
 do_new_mount+0x289/0xad0 fs/namespace.c:2994
 path_mount+0x60b/0x1050 fs/namespace.c:3324
 do_mount fs/namespace.c:3337 [inline]
 __do_sys_mount fs/namespace.c:3545 [inline]
 __se_sys_mount+0x2d2/0x3c0 fs/namespace.c:3522
 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3522
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f4d16c1402a
Code: 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff6f25ff18 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f4d16c1402a
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007fff6f25ff30
RBP: 00007fff6f25ff30 R08: 00007fff6f25ff70 R09: 000055555750e2c0
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000004
R13: 00007fff6f25ff70 R14: 0000000000000026 R15: 0000000020000590
 </TASK>
Modules linked in:
---[ end trace ea2d8bfb1c4dbd14 ]---
RIP: 0010:__fscrypt_inode_uses_inline_crypto fs/crypto/inline_crypt.c:233 [inline]
RIP: 0010:fscrypt_inode_uses_inline_crypto include/linux/fscrypt.h:798 [inline]
RIP: 0010:fscrypt_limit_io_blocks+0xc7/0x2a0 fs/crypto/inline_crypt.c:477
Code: c4 c8 02 00 00 4d 89 e6 49 c1 ee 03 43 80 3c 2e 00 74 08 4c 89 e7 e8 18 90 db ff 49 8b 1c 24 48 83 c3 11 48 89 d8 48 c1 e8 03 <42> 8a 04 28 84 c0 0f 85 53 01 00 00 0f b6 1b 31 ff 89 de e8 51 46
RSP: 0018:ffffc900003ff260 EFLAGS: 00010202
RAX: 0000000000000002 RBX: 0000000000000011 RCX: 0000000000000000
RDX: ffff888106fde2c0 RSI: 0000000000008000 RDI: 0000000000008000
RBP: ffffc900003ff290 R08: ffffffff81d84dff R09: ffffed102132e19a
R10: ffffed102132e19a R11: 1ffff1102132e199 R12: ffff888109970fd0
R13: dffffc0000000000 R14: 1ffff1102132e1fa R15: 0000000000000001
FS:  000055555750e300(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000056418e982c60 CR3: 000000011f40f000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
   0:	c8 02 00 00          	enterq $0x2,$0x0
   4:	4d 89 e6             	mov    %r12,%r14
   7:	49 c1 ee 03          	shr    $0x3,%r14
   b:	43 80 3c 2e 00       	cmpb   $0x0,(%r14,%r13,1)
  10:	74 08                	je     0x1a
  12:	4c 89 e7             	mov    %r12,%rdi
  15:	e8 18 90 db ff       	callq  0xffdb9032
  1a:	49 8b 1c 24          	mov    (%r12),%rbx
  1e:	48 83 c3 11          	add    $0x11,%rbx
  22:	48 89 d8             	mov    %rbx,%rax
  25:	48 c1 e8 03          	shr    $0x3,%rax
* 29:	42 8a 04 28          	mov    (%rax,%r13,1),%al <-- trapping instruction
  2d:	84 c0                	test   %al,%al
  2f:	0f 85 53 01 00 00    	jne    0x188
  35:	0f b6 1b             	movzbl (%rbx),%ebx
  38:	31 ff                	xor    %edi,%edi
  3a:	89 de                	mov    %ebx,%esi
  3c:	e8                   	.byte 0xe8
  3d:	51                   	push   %rcx
  3e:	46                   	rex.RX

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/10/30 21:02 android13-5.15-lts 7f2e600bf63a 2a71366b .config strace log report syz C [disk image] [vmlinux] [mounted in repro] ci2-android-5-15 general protection fault in fscrypt_limit_io_blocks
2022/10/30 20:47 android13-5.15-lts 7f2e600bf63a 2a71366b .config strace log report syz C [disk image] [vmlinux] [mounted in repro] ci2-android-5-15 general protection fault in fscrypt_limit_io_blocks
2022/12/29 13:46 android13-5.15-lts c73b4619ad86 44712fbc .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-15 general protection fault in fscrypt_limit_io_blocks
2022/10/31 03:40 android13-5.15-lts 7f2e600bf63a 2a71366b .config console log report info [disk image] [vmlinux] ci2-android-5-15 general protection fault in fscrypt_limit_io_blocks
2022/10/30 20:41 android13-5.15-lts 7f2e600bf63a 2a71366b .config console log report info [disk image] [vmlinux] ci2-android-5-15 general protection fault in fscrypt_limit_io_blocks
* Struck through repros no longer work on HEAD.