syzbot


general protection fault in fscrypt_limit_io_blocks

Status: fixed on 2023/05/04 14:51
Reported-by: syzbot+ce0fb3a44af82b598be7@syzkaller.appspotmail.com
Fix commit: a41d63f20471 ext4: don't allow journal inode to have encrypt flag
First crash: 752d, last: 688d
Cause bisection: failed (error log, bisect log)
  
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-15 general protection fault in fscrypt_limit_io_blocks C error 5 693d 752d 2/2 fixed on 2023/02/02 00:40
Last patch testing requests (3)
Created Duration User Patch Repo Result
2022/12/12 08:49 13m tudor.ambarus@linaro.org git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git linux-5.15.y OK log
2022/12/12 08:48 14m tudor.ambarus@linaro.org git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git linux-5.10.y OK log
2022/12/12 08:48 9m tudor.ambarus@linaro.org git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master report log

Sample crash report:
EXT4-fs error (device loop0): ext4_get_journal_inode:5259: inode #3: comm syz-executor350: 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: 371 Comm: syz-executor350 Not tainted 5.10.149-syzkaller-01350-g0118fb827bc7 #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:700 [inline]
RIP: 0010:fscrypt_limit_io_blocks+0xce/0x2b0 fs/crypto/inline_crypt.c:460
Code: 5d 00 81 e3 00 f0 00 00 bf 00 80 00 00 89 de e8 98 28 a7 ff 81 fb 00 80 00 00 75 7b 4c 89 f9 49 8d 5e 11 48 89 d8 48 c1 e8 03 <42> 8a 04 38 84 c0 0f 85 58 01 00 00 0f b6 1b 31 ff 89 de e8 ba 27
RSP: 0018:ffffc900009ef2e0 EFLAGS: 00010202
RAX: 0000000000000002 RBX: 0000000000000011 RCX: dffffc0000000000
RDX: ffff8881065b62c0 RSI: 0000000000008000 RDI: 0000000000008000
RBP: ffffc900009ef310 R08: ffffffff81c5c5a8 R09: ffffed1021ce5b37
R10: ffffed1021ce5b37 R11: 1ffff11021ce5b36 R12: 0000000000000001
R13: ffff88810e72da30 R14: 0000000000000000 R15: dffffc0000000000
FS:  0000555555591300(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000005d84c8 CR3: 00000001063f1000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 ext4_iomap_begin+0x933/0xc00 fs/ext4/inode.c:3564
 iomap_apply+0xf9/0x7f0 fs/iomap/apply.c:46
 iomap_bmap+0x168/0x1f0 fs/iomap/fiemap.c:134
 ext4_bmap+0x3a7/0x420 fs/ext4/inode.c:3303
 bmap+0xa5/0xe0 fs/inode.c:1706
 jbd2_journal_init_inode+0x9d/0x390 fs/jbd2/journal.c:1437
 ext4_get_journal fs/ext4/super.c:5294 [inline]
 ext4_load_journal+0x30b/0x1440 fs/ext4/super.c:5428
 ext4_fill_super+0x60b3/0x9150 fs/ext4/super.c:4804
 mount_bdev+0x25f/0x370 fs/super.c:1419
 ext4_mount+0x34/0x40 fs/ext4/super.c:6611
 legacy_get_tree+0xf0/0x190 fs/fs_context.c:592
 vfs_get_tree+0x88/0x290 fs/super.c:1549
 do_new_mount+0x289/0xad0 fs/namespace.c:2899
 path_mount+0x58d/0xce0 fs/namespace.c:3229
 do_mount fs/namespace.c:3242 [inline]
 __do_sys_mount fs/namespace.c:3450 [inline]
 __se_sys_mount+0x2d2/0x3c0 fs/namespace.c:3427
 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3427
 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x61/0xc6
RIP: 0033:0x7f190e2cd02a
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:00007fff9e8d1d58 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f190e2cd02a
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007fff9e8d1d70
RBP: 00007fff9e8d1d70 R08: 00007fff9e8d1db0 R09: 00005555555912c0
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000004
R13: 00007fff9e8d1db0 R14: 0000000000000026 R15: 0000000020000590
Modules linked in:
---[ end trace 0aacf3972cc60e50 ]---
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:700 [inline]
RIP: 0010:fscrypt_limit_io_blocks+0xce/0x2b0 fs/crypto/inline_crypt.c:460
Code: 5d 00 81 e3 00 f0 00 00 bf 00 80 00 00 89 de e8 98 28 a7 ff 81 fb 00 80 00 00 75 7b 4c 89 f9 49 8d 5e 11 48 89 d8 48 c1 e8 03 <42> 8a 04 38 84 c0 0f 85 58 01 00 00 0f b6 1b 31 ff 89 de e8 ba 27
RSP: 0018:ffffc900009ef2e0 EFLAGS: 00010202
RAX: 0000000000000002 RBX: 0000000000000011 RCX: dffffc0000000000
RDX: ffff8881065b62c0 RSI: 0000000000008000 RDI: 0000000000008000
RBP: ffffc900009ef310 R08: ffffffff81c5c5a8 R09: ffffed1021ce5b37
R10: ffffed1021ce5b37 R11: 1ffff11021ce5b36 R12: 0000000000000001
R13: ffff88810e72da30 R14: 0000000000000000 R15: dffffc0000000000
FS:  0000555555591300(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000005d84c8 CR3: 00000001063f1000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	5d                   	pop    %rbp
   1:	00 81 e3 00 f0 00    	add    %al,0xf000e3(%rcx)
   7:	00 bf 00 80 00 00    	add    %bh,0x8000(%rdi)
   d:	89 de                	mov    %ebx,%esi
   f:	e8 98 28 a7 ff       	callq  0xffa728ac
  14:	81 fb 00 80 00 00    	cmp    $0x8000,%ebx
  1a:	75 7b                	jne    0x97
  1c:	4c 89 f9             	mov    %r15,%rcx
  1f:	49 8d 5e 11          	lea    0x11(%r14),%rbx
  23:	48 89 d8             	mov    %rbx,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 8a 04 38          	mov    (%rax,%r15,1),%al <-- trapping instruction
  2e:	84 c0                	test   %al,%al
  30:	0f 85 58 01 00 00    	jne    0x18e
  36:	0f b6 1b             	movzbl (%rbx),%ebx
  39:	31 ff                	xor    %edi,%edi
  3b:	89 de                	mov    %ebx,%esi
  3d:	e8                   	.byte 0xe8
  3e:	ba                   	.byte 0xba
  3f:	27                   	(bad)

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/10/30 21:12 android12-5.10-lts 0118fb827bc7 2a71366b .config strace log report syz C [mounted in repro] ci2-android-5-10 general protection fault in fscrypt_limit_io_blocks
2022/10/30 20:45 android12-5.10-lts 0118fb827bc7 2a71366b .config strace log report syz C [mounted in repro] ci2-android-5-10 general protection fault in fscrypt_limit_io_blocks
2023/01/03 01:06 android12-5.10-lts 003c389455eb ab32d508 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 general protection fault in fscrypt_limit_io_blocks
2022/10/31 03:52 android12-5.10-lts 0118fb827bc7 2a71366b .config console log report info ci2-android-5-10 general protection fault in fscrypt_limit_io_blocks
2022/10/30 20:37 android12-5.10-lts 0118fb827bc7 2a71366b .config console log report info ci2-android-5-10 general protection fault in fscrypt_limit_io_blocks
* Struck through repros no longer work on HEAD.