syzbot


possible deadlock in exc_page_fault

Status: auto-obsoleted due to no activity on 2023/09/08 13:51
Subsystems: exfat
[Documentation on labels]
Reported-by: syzbot+6d274a5dc4fa0974d4ad@syzkaller.appspotmail.com
First crash: 657d, last: 511d
Cause bisection: failed (error log, bisect log)
  
Discussions (6)
Title Replies (including bot) Last reply
[syzbot] Monthly fat report (Jul 2023) 3 (4) 2023/07/14 23:29
Re: [syzbot] [fat?] possible deadlock in exc_page_fault 1 (2) 2023/07/14 21:10
[syzbot] Monthly fat report (May 2023) 0 (1) 2023/05/31 12:40
[syzbot] Monthly fat report (Apr 2023) 0 (1) 2023/05/01 09:05
[syzbot] Monthly fat report 0 (1) 2023/03/30 10:28
[syzbot] possible deadlock in exc_page_fault 0 (2) 2023/03/20 11:46
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in exc_page_fault 1 606d 606d 0/3 auto-obsoleted due to no activity on 2023/07/25 22:52
Last patch testing requests (3)
Created Duration User Patch Repo Result
2023/08/23 00:35 53m retest repro upstream OK log
2023/07/14 17:29 33m nogikh@google.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master OK log
2023/03/21 07:02 30m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git e8d018dd0257 OK log

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.3.0-rc3-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor377/6548 is trying to acquire lock:
ffff8880766bc998 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_lock include/linux/mmap_lock.h:117 [inline]
ffff8880766bc998 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1358 [inline]
ffff8880766bc998 (&mm->mmap_lock){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1498 [inline]
ffff8880766bc998 (&mm->mmap_lock){++++}-{3:3}, at: exc_page_fault+0x486/0x7c0 arch/x86/mm/fault.c:1554

but task is already holding lock:
ffff88807c2640e0 (&sbi->s_lock){+.+.}-{3:3}, at: exfat_iterate+0x171/0x3370 fs/exfat/dir.c:232

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&sbi->s_lock){+.+.}-{3:3}:
       lock_acquire+0x1e1/0x520 kernel/locking/lockdep.c:5669
       __mutex_lock_common+0x1d8/0x2530 kernel/locking/mutex.c:603
       __mutex_lock kernel/locking/mutex.c:747 [inline]
       mutex_lock_nested+0x1b/0x20 kernel/locking/mutex.c:799
       exfat_get_block+0x1e5/0x2050 fs/exfat/inode.c:280
       do_mpage_readpage+0x911/0x1fa0 fs/mpage.c:208
       mpage_readahead+0x454/0x930 fs/mpage.c:356
       read_pages+0x183/0x830 mm/readahead.c:161
       page_cache_ra_unbounded+0x697/0x7c0 mm/readahead.c:270
       page_cache_sync_readahead include/linux/pagemap.h:1214 [inline]
       filemap_get_pages+0x49c/0x20c0 mm/filemap.c:2598
       filemap_read+0x45a/0x1170 mm/filemap.c:2693
       __kernel_read+0x422/0x8a0 fs/read_write.c:428
       integrity_kernel_read+0xb0/0xf0 security/integrity/iint.c:199
       ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:485 [inline]
       ima_calc_file_shash security/integrity/ima/ima_crypto.c:516 [inline]
       ima_calc_file_hash+0xa5b/0x1c00 security/integrity/ima/ima_crypto.c:573
       ima_collect_measurement+0x3a7/0x880 security/integrity/ima/ima_api.c:293
       process_measurement+0xfdb/0x1ce0 security/integrity/ima/ima_main.c:341
       ima_file_check+0xf1/0x170 security/integrity/ima/ima_main.c:539
       do_open fs/namei.c:3562 [inline]
       path_openat+0x280a/0x3170 fs/namei.c:3715
       do_filp_open+0x234/0x490 fs/namei.c:3742
       do_sys_openat2+0x13f/0x500 fs/open.c:1348
       do_sys_open fs/open.c:1364 [inline]
       __do_sys_openat fs/open.c:1380 [inline]
       __se_sys_openat fs/open.c:1375 [inline]
       __x64_sys_openat+0x247/0x290 fs/open.c:1375
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #1 (mapping.invalidate_lock#3){.+.+}-{3:3}:
       lock_acquire+0x1e1/0x520 kernel/locking/lockdep.c:5669
       down_read+0x3d/0x50 kernel/locking/rwsem.c:1520
       filemap_invalidate_lock_shared include/linux/fs.h:813 [inline]
       filemap_fault+0x644/0x1800 mm/filemap.c:3274
       __do_fault+0x136/0x500 mm/memory.c:4141
       do_read_fault mm/memory.c:4492 [inline]
       do_fault mm/memory.c:4621 [inline]
       handle_pte_fault mm/memory.c:4909 [inline]
       __handle_mm_fault mm/memory.c:5051 [inline]
       handle_mm_fault+0x3357/0x51c0 mm/memory.c:5197
       faultin_page mm/gup.c:925 [inline]
       __get_user_pages+0x512/0x1180 mm/gup.c:1147
       __get_user_pages_locked mm/gup.c:1381 [inline]
       __gup_longterm_locked+0x208c/0x2aa0 mm/gup.c:2079
       pin_user_pages_remote+0x136/0x200 mm/gup.c:3122
       process_vm_rw_single_vec mm/process_vm_access.c:105 [inline]
       process_vm_rw_core mm/process_vm_access.c:215 [inline]
       process_vm_rw+0x72b/0xcd0 mm/process_vm_access.c:283
       __do_sys_process_vm_readv mm/process_vm_access.c:295 [inline]
       __se_sys_process_vm_readv mm/process_vm_access.c:291 [inline]
       __x64_sys_process_vm_readv+0xe0/0xf0 mm/process_vm_access.c:291
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #0 (&mm->mmap_lock){++++}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3098 [inline]
       check_prevs_add kernel/locking/lockdep.c:3217 [inline]
       validate_chain+0x166b/0x58e0 kernel/locking/lockdep.c:3832
       __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056
       lock_acquire+0x1e1/0x520 kernel/locking/lockdep.c:5669
       down_read+0x3d/0x50 kernel/locking/rwsem.c:1520
       mmap_read_lock include/linux/mmap_lock.h:117 [inline]
       do_user_addr_fault arch/x86/mm/fault.c:1358 [inline]
       handle_page_fault arch/x86/mm/fault.c:1498 [inline]
       exc_page_fault+0x486/0x7c0 arch/x86/mm/fault.c:1554
       asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570
       filldir64+0x30b/0x720 fs/readdir.c:331
       dir_emit_dot include/linux/fs.h:3144 [inline]
       dir_emit_dots include/linux/fs.h:3155 [inline]
       exfat_iterate+0x2b8/0x3370 fs/exfat/dir.c:235
       iterate_dir+0x228/0x570
       __do_sys_getdents64 fs/readdir.c:369 [inline]
       __se_sys_getdents64+0x20d/0x4f0 fs/readdir.c:354
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

other info that might help us debug this:

Chain exists of:
  &mm->mmap_lock --> mapping.invalidate_lock#3 --> &sbi->s_lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&sbi->s_lock);
                               lock(mapping.invalidate_lock#3);
                               lock(&sbi->s_lock);
  lock(&mm->mmap_lock);

 *** DEADLOCK ***

3 locks held by syz-executor377/6548:
 #0: ffff88802778c368 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x254/0x2f0 fs/file.c:1047
 #1: ffff8880747e1cb0 (&sb->s_type->i_mutex_key#14){++++}-{3:3}, at: iterate_dir+0x135/0x570 fs/readdir.c:57
 #2: ffff88807c2640e0 (&sbi->s_lock){+.+.}-{3:3}, at: exfat_iterate+0x171/0x3370 fs/exfat/dir.c:232

stack backtrace:
CPU: 0 PID: 6548 Comm: syz-executor377 Not tainted 6.3.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
 check_noncircular+0x2fe/0x3b0 kernel/locking/lockdep.c:2178
 check_prev_add kernel/locking/lockdep.c:3098 [inline]
 check_prevs_add kernel/locking/lockdep.c:3217 [inline]
 validate_chain+0x166b/0x58e0 kernel/locking/lockdep.c:3832
 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056
 lock_acquire+0x1e1/0x520 kernel/locking/lockdep.c:5669
 down_read+0x3d/0x50 kernel/locking/rwsem.c:1520
 mmap_read_lock include/linux/mmap_lock.h:117 [inline]
 do_user_addr_fault arch/x86/mm/fault.c:1358 [inline]
 handle_page_fault arch/x86/mm/fault.c:1498 [inline]
 exc_page_fault+0x486/0x7c0 arch/x86/mm/fault.c:1554
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570
RIP: 0010:filldir64+0x30b/0x720 fs/readdir.c:335
Code: 48 29 eb 48 89 df 4c 89 e6 e8 11 86 95 ff 85 ed 0f 88 48 02 00 00 4c 39 e3 0f 82 3f 02 00 00 0f 01 cb 0f ae e8 48 8b 44 24 58 <49> 89 44 24 08 48 8b 4c 24 10 48 8b 44 24 50 48 89 01 48 8b 44 24
RSP: 0018:ffffc9000543f6c8 EFLAGS: 00050206
RAX: 0000000000000000 RBX: 00007fffffffefe8 RCX: ffff8880275dba80
RDX: ffff8880275dba80 RSI: 0000000000000000 RDI: 00007fffffffefe8
RBP: 0000000000000018 R08: ffffffff81f4e91f R09: 0000000000000004
R10: 0000000000000003 R11: ffff8880275dba80 R12: 0000000000000000
R13: ffffc9000543fe70 R14: 0000000000000001 R15: ffffffff8afed560
 dir_emit_dot include/linux/fs.h:3144 [inline]
 dir_emit_dots include/linux/fs.h:3155 [inline]
 exfat_iterate+0x2b8/0x3370 fs/exfat/dir.c:235
 iterate_dir+0x228/0x570
 __do_sys_getdents64 fs/readdir.c:369 [inline]
 __se_sys_getdents64+0x20d/0x4f0 fs/readdir.c:354
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f265ea7dab9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 71 15 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f2656628208 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9
RAX: ffffffffffffffda RBX: 00007f265eb037b8 RCX: 00007f265ea7dab9
RDX: 0000000000008008 RSI: 0000000000000000 RDI: 0000000000000006
RBP: 00007f265eb037b0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f265eb037bc
R13: 00007ffc20585adf R14: 00007f2656628300 R15: 0000000000022000
 </TASK>
----------------
Code disassembly (best guess):
   0:	48 29 eb             	sub    %rbp,%rbx
   3:	48 89 df             	mov    %rbx,%rdi
   6:	4c 89 e6             	mov    %r12,%rsi
   9:	e8 11 86 95 ff       	callq  0xff95861f
   e:	85 ed                	test   %ebp,%ebp
  10:	0f 88 48 02 00 00    	js     0x25e
  16:	4c 39 e3             	cmp    %r12,%rbx
  19:	0f 82 3f 02 00 00    	jb     0x25e
  1f:	0f 01 cb             	stac
  22:	0f ae e8             	lfence
  25:	48 8b 44 24 58       	mov    0x58(%rsp),%rax
* 2a:	49 89 44 24 08       	mov    %rax,0x8(%r12) <-- trapping instruction
  2f:	48 8b 4c 24 10       	mov    0x10(%rsp),%rcx
  34:	48 8b 44 24 50       	mov    0x50(%rsp),%rax
  39:	48 89 01             	mov    %rax,(%rcx)
  3c:	48                   	rex.W
  3d:	8b                   	.byte 0x8b
  3e:	44                   	rex.R
  3f:	24                   	.byte 0x24

Crashes (100):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/03/20 11:46 upstream e8d018dd0257 7939252e .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs possible deadlock in exc_page_fault
2023/06/30 13:50 upstream b19edac5992d 01298212 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/06/27 23:38 upstream b19edac5992d 4cd5bb25 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/06/27 07:30 upstream 1ef6663a587b 4cd5bb25 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/06/24 02:51 upstream 61dabacdad4e 79782afc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/06/23 00:34 upstream dad9774deaf1 79782afc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/06/22 18:04 upstream dad9774deaf1 79782afc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/06/22 12:50 upstream dad9774deaf1 79782afc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/06/19 00:48 upstream 8c1f0c38b310 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/06/18 20:20 upstream 8c1f0c38b310 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/06/15 05:28 upstream b6dad5178cea 76decb82 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/06/14 19:15 upstream b6dad5178cea d2ee9228 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/06/14 06:27 upstream 15adb51c04cc d2ee9228 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/06/11 13:55 upstream 022ce8862dff 49519f06 .config console log report info ci2-upstream-fs possible deadlock in exc_page_fault
2023/06/11 09:58 upstream 022ce8862dff 49519f06 .config console log report info ci2-upstream-fs possible deadlock in exc_page_fault
2023/06/10 23:55 upstream 64569520920a 49519f06 .config console log report info ci2-upstream-fs possible deadlock in exc_page_fault
2023/06/05 11:51 upstream 9561de3a55be a4ae4f42 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/05/27 00:22 upstream 0d85b27b0cc6 cf184559 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/05/24 11:45 upstream 27e462c8fad4 4bce1a3e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/05/19 06:15 upstream 2d1bcbc6cd70 3bb7af1d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/05/17 05:36 upstream f1fcbaa18b28 11c89444 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/05/15 23:45 upstream f1fcbaa18b28 c4d362e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/05/11 21:50 upstream 105131df9c3b adb9a3cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/05/05 02:58 upstream 1a5304fecee5 518a39a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/05/04 17:18 upstream 1a5304fecee5 518a39a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/04/27 21:57 upstream 6e98b09da931 6f3d6fa7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/04/25 19:08 upstream 173ea743bf7a 65320f8e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/04/24 04:06 upstream 457391b03803 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/04/23 05:33 upstream 2caeeb9d4a1b 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/04/22 15:02 upstream 8e41e0a57566 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/04/19 08:26 upstream af67688dca57 94b4184e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/04/18 14:59 upstream 6a8f57ae2eb0 d931e9f0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/04/18 04:53 upstream 6a8f57ae2eb0 436577a9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/04/18 02:38 upstream 6a8f57ae2eb0 436577a9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/04/16 21:57 upstream 3e7bb4f24617 ec410564 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/04/16 19:17 upstream 3e7bb4f24617 ec410564 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/04/16 11:51 upstream 3e7bb4f24617 ec410564 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/04/15 05:18 upstream 95abc817ab3a ec410564 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/04/14 07:27 upstream 44149752e998 3cfcaa1b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/04/13 22:04 upstream de4664485abb 3cfcaa1b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/04/09 20:15 upstream cdc9718d5e59 71147e29 .config console log report info ci2-upstream-fs possible deadlock in exc_page_fault
2023/04/08 18:46 upstream aa318c48808c 71147e29 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/04/03 17:10 upstream 7e364e56293b 41147e3e .config console log report info ci2-upstream-fs possible deadlock in exc_page_fault
2023/03/30 17:00 upstream ffe78bbd5121 f325deb0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/03/29 10:12 upstream fcd476ea6a88 f325deb0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/03/28 22:04 upstream fcd476ea6a88 fc067f05 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/03/28 09:58 upstream 3a93e40326c8 47f3aaf1 .config console log report info ci2-upstream-fs possible deadlock in exc_page_fault
2023/03/28 00:15 upstream 3a93e40326c8 47f3aaf1 .config console log report info ci2-upstream-fs possible deadlock in exc_page_fault
2023/03/27 09:30 upstream 197b6b60ae7b f8f96aa9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/03/26 19:13 upstream 18940c888c85 fbf0499a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/03/26 16:04 upstream da8e7da11e4b fbf0499a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in exc_page_fault
2023/03/24 00:53 upstream 9fd6ba5420ba f94b4a29 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in exc_page_fault
2023/02/04 12:14 upstream 0136d86b7852 1b2f701a .config console log report info ci2-upstream-fs possible deadlock in exc_page_fault
* Struck through repros no longer work on HEAD.