syzbot


general protection fault in ext4_xattr_set_entry

Status: fixed on 2023/03/28 12:29
Reported-by: syzbot+2dacb8f015bf1420155f@syzkaller.appspotmail.com
Fix commit: 0473082f7ad7 UPSTREAM: ext4: optimize ea_inode block expansion 3c4f88430679 UPSTREAM: ext4: refuse to create ea block when umounted
First crash: 526d, last: 446d
Cause bisection: failed (error log, bisect log)
  
Discussions (2)
Title Replies (including bot) Last reply
[PATCH v2 0/2] optimize ea_inode block expansion to fix panic 4 (4) 2023/02/19 05:40
[PATCH 1/2] ext4: optimize ea_inode block expansion 4 (4) 2022/12/31 03:27
Similar bugs (14)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-10 general protection fault in ext4_xattr_set_entry (4) C error 62 349d 378d 2/2 fixed on 2023/06/07 17:22
android-5-10 general protection fault in ext4_xattr_set_entry (2) ext4 C error 423 385d 584d 2/2 fixed on 2023/05/03 13:06
android-54 KASAN: out-of-bounds Read in ext4_xattr_set_entry ext4 C 14 391d 1157d 0/2 auto-obsoleted due to no activity on 2023/08/23 09:06
android-5-10 general protection fault in ext4_xattr_set_entry (3) C error 9 380d 383d 2/2 fixed on 2023/05/08 19:06
android-5-10 general protection fault in ext4_xattr_set_entry C error 2 607d 621d 0/2 closed as invalid on 2022/09/26 18:30
android-5-10 general protection fault in ext4_xattr_set_entry (5) C done 11 346d 349d 2/2 fixed on 2023/06/13 02:27
linux-4.19 KASAN: use-after-free Read in ext4_xattr_set_entry (2) C done 7 982d 1440d 1/1 fixed on 2021/10/13 07:23
android-5-15 KASAN: out-of-bounds Read in ext4_xattr_set_entry 1 338d 338d 0/2 auto-obsoleted due to no activity on 2023/09/17 07:02
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (5) ext4 2 666d 725d 0/26 auto-obsoleted due to no activity on 2022/11/22 17:19
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (4) ext4 C error done 21 820d 1207d 20/26 fixed on 2022/03/28 10:17
linux-6.1 KASAN: out-of-bounds Read in ext4_xattr_set_entry origin:upstream missing-backport syz unreliable 2 6d03h 369d 0/3 upstream: reported syz repro on 2023/05/19 08:42
android-5-10 KASAN: out-of-bounds Read in ext4_xattr_set_entry C inconclusive 1 35d 245d 0/2 upstream: reported C repro on 2023/09/20 02:40
linux-4.14 KASAN: out-of-bounds Read in ext4_xattr_set_entry C error 2 621d 1135d 0/1 upstream: reported C repro on 2021/04/12 14:20
android-6-1 KASAN: out-of-bounds Read in ext4_xattr_set_entry origin:lts C 1 8d15h 8d15h 0/2 upstream: reported C repro on 2024/05/13 18:18
Last patch testing requests (8)
Created Duration User Patch Repo Result
2022/12/30 03:34 14m jun.nie@linaro.org patch android13-5.15-lts OK log
2022/12/30 03:14 13m jun.nie@linaro.org patch upstream OK log
2022/12/29 10:07 14m jun.nie@linaro.org patch upstream OK log
2022/12/15 03:16 13m jun.nie@linaro.org patch git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git linux-5.15.y OK log
2022/12/14 08:21 7m jun.nie@linaro.org patch git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git linux-5.15.y error OK
2022/12/14 02:40 11m jun.nie@linaro.org git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git linux-5.15.y report log
2022/12/14 01:15 0m jun.nie@linaro.org git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git stable-linux-5.15.y error OK
2022/12/13 09:36 16m jun.nie@linaro.org upstream OK log
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2023/03/02 16:30 25m bisect fix android13-5.15-lts job log (0) log
2023/01/30 21:40 22m bisect fix android13-5.15-lts job log (0) log

Sample crash report:
EXT4-fs (loop0): mounted filesystem without journal. Opts: nouser_xattr,acl,debug_want_extra_isize=0x0000000000000080,lazytime,nobh,quota,,errors=continue. Quota mode: writeback.
general protection fault, probably for non-canonical address 0xdffffc0000000006: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000030-0x0000000000000037]
CPU: 1 PID: 410 Comm: syz-executor331 Not tainted 5.15.77-syzkaller-00764-g7048384c9872 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
RIP: 0010:ext4_xattr_inode_create fs/ext4/xattr.c:1429 [inline]
RIP: 0010:ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1537 [inline]
RIP: 0010:ext4_xattr_set_entry+0x276a/0x3950 fs/ext4/xattr.c:1665
Code: 8b 1b 48 83 c3 68 48 89 d8 48 c1 e8 03 42 80 3c 38 00 74 08 48 89 df e8 e4 01 b4 ff 48 8b 1b 48 83 c3 30 48 89 d8 48 c1 e8 03 <42> 80 3c 38 00 74 08 48 89 df e8 c7 01 b4 ff 4c 8b 23 48 8b 44 24
RSP: 0018:ffffc9000033efa0 EFLAGS: 00010206
RAX: 0000000000000006 RBX: 0000000000000030 RCX: ffff8881069b3b40
RDX: dffffc0000000000 RSI: 0000000000000000 RDI: ffffffff868f1994
RBP: ffffc9000033f230 R08: ffffffff816d6a71 R09: ffffed1020e77803
R10: ffffed1020e77803 R11: 1ffff11020e77802 R12: ffffc9000033f154
R13: ffffffff868f1940 R14: ffff88811cdd4020 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7712701498 CR3: 000000010d5b3000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 ext4_xattr_block_set+0x8f8/0x3820 fs/ext4/xattr.c:1971
 ext4_xattr_move_to_block fs/ext4/xattr.c:2603 [inline]
 ext4_xattr_make_inode_space fs/ext4/xattr.c:2672 [inline]
 ext4_expand_extra_isize_ea+0x1591/0x1f30 fs/ext4/xattr.c:2764
 __ext4_expand_extra_isize+0x29e/0x3d0 fs/ext4/inode.c:5826
 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5869 [inline]
 __ext4_mark_inode_dirty+0x4bf/0x7a0 fs/ext4/inode.c:5947
 ext4_dirty_inode+0xbc/0x100 fs/ext4/inode.c:5979
 __mark_inode_dirty+0x1f9/0x9d0 fs/fs-writeback.c:2431
 mark_inode_dirty_sync include/linux/fs.h:2429 [inline]
 iput+0x155/0x7d0 fs/inode.c:1686
 dentry_unlink_inode+0x349/0x430 fs/dcache.c:376
 __dentry_kill+0x3e2/0x5d0 fs/dcache.c:582
 shrink_dentry_list+0x379/0x4d0 fs/dcache.c:1176
 shrink_dcache_parent+0xcd/0x350
 do_one_tree fs/dcache.c:1657 [inline]
 shrink_dcache_for_umount+0x7c/0x1a0 fs/dcache.c:1674
 generic_shutdown_super+0x69/0x2d0 fs/super.c:447
 kill_block_super+0x80/0xe0 fs/super.c:1395
 deactivate_locked_super+0xb0/0x100 fs/super.c:335
 deactivate_super+0xa5/0xd0 fs/super.c:366
 cleanup_mnt+0x45f/0x510 fs/namespace.c:1143
 __cleanup_mnt+0x19/0x20 fs/namespace.c:1150
 task_work_run+0x147/0x1b0 kernel/task_work.c:164
 exit_task_work include/linux/task_work.h:32 [inline]
 do_exit+0x67e/0x24d0 kernel/exit.c:828
 do_group_exit+0x13a/0x300 kernel/exit.c:925
 __do_sys_exit_group kernel/exit.c:936 [inline]
 __se_sys_exit_group kernel/exit.c:934 [inline]
 __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:934
 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:0x7f77126bca99
Code: Unable to access opcode bytes at RIP 0x7f77126bca6f.
RSP: 002b:00007fffd6a19668 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007f7712732330 RCX: 00007f77126bca99
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000001
RBP: 0000000000000001 R08: ffffffffffffffc0 R09: 00007f771272ce40
R10: 00007f771272ce40 R11: 0000000000000246 R12: 00007f7712732330
R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001
 </TASK>
Modules linked in:
---[ end trace 504599ef89a0a0ad ]---
RIP: 0010:ext4_xattr_inode_create fs/ext4/xattr.c:1429 [inline]
RIP: 0010:ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1537 [inline]
RIP: 0010:ext4_xattr_set_entry+0x276a/0x3950 fs/ext4/xattr.c:1665
Code: 8b 1b 48 83 c3 68 48 89 d8 48 c1 e8 03 42 80 3c 38 00 74 08 48 89 df e8 e4 01 b4 ff 48 8b 1b 48 83 c3 30 48 89 d8 48 c1 e8 03 <42> 80 3c 38 00 74 08 48 89 df e8 c7 01 b4 ff 4c 8b 23 48 8b 44 24
RSP: 0018:ffffc9000033efa0 EFLAGS: 00010206
RAX: 0000000000000006 RBX: 0000000000000030 RCX: ffff8881069b3b40
RDX: dffffc0000000000 RSI: 0000000000000000 RDI: ffffffff868f1994
RBP: ffffc9000033f230 R08: ffffffff816d6a71 R09: ffffed1020e77803
R10: ffffed1020e77803 R11: 1ffff11020e77802 R12: ffffc9000033f154
R13: ffffffff868f1940 R14: ffff88811cdd4020 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7712701498 CR3: 000000010d5b3000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	8b 1b                	mov    (%rbx),%ebx
   2:	48 83 c3 68          	add    $0x68,%rbx
   6:	48 89 d8             	mov    %rbx,%rax
   9:	48 c1 e8 03          	shr    $0x3,%rax
   d:	42 80 3c 38 00       	cmpb   $0x0,(%rax,%r15,1)
  12:	74 08                	je     0x1c
  14:	48 89 df             	mov    %rbx,%rdi
  17:	e8 e4 01 b4 ff       	callq  0xffb40200
  1c:	48 8b 1b             	mov    (%rbx),%rbx
  1f:	48 83 c3 30          	add    $0x30,%rbx
  23:	48 89 d8             	mov    %rbx,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 80 3c 38 00       	cmpb   $0x0,(%rax,%r15,1) <-- trapping instruction
  2f:	74 08                	je     0x39
  31:	48 89 df             	mov    %rbx,%rdi
  34:	e8 c7 01 b4 ff       	callq  0xffb40200
  39:	4c 8b 23             	mov    (%rbx),%r12
  3c:	48                   	rex.W
  3d:	8b                   	.byte 0x8b
  3e:	44                   	rex.R
  3f:	24                   	.byte 0x24

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/12/12 19:19 android13-5.15-lts 7048384c9872 67be1ae7 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-5-15 general protection fault in ext4_xattr_set_entry
* Struck through repros no longer work on HEAD.