syzbot


possible deadlock in do_page_mkwrite

Status: upstream: reported C repro on 2023/06/12 00:09
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+734fef9ab106cbaa9556@syzkaller.appspotmail.com
First crash: 810d, last: 12d
Fix commit to backport (bisect log) :
tree: upstream
commit fb6f20ecb121cef4d7946f834a6ee867c4e21b4a
Author: Jan Kara <jack@suse.cz>
Date: Thu Oct 17 10:28:23 2024 +0000

  reiserfs: The last commit

  
Fix bisection: the issue occurs on the latest tested release (bisect log)
Crash: possible deadlock in do_page_mkwrite (log)
Repro: C syz .config
  
Bug presence (3)
Date Name Commit Repro Result
2024/12/09 linux-5.15.y (ToT) 0a51d2d4527b C [report] possible deadlock in do_page_mkwrite
2023/06/12 upstream (ToT) 858fd168a95c C [report] possible deadlock in do_page_mkwrite
2024/12/09 upstream (ToT) fac04efc5c79 C Didn't crash
Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in do_page_mkwrite (2) dri 4 5 213d 273d 0/29 auto-obsoleted due to no activity on 2025/05/09 03:36
linux-6.1 possible deadlock in do_page_mkwrite origin:upstream missing-backport 4 C done 12 190d 854d 0/3 upstream: reported C repro on 2023/04/29 03:26
upstream possible deadlock in do_page_mkwrite fs 4 C error done 114 577d 992d 0/29 auto-obsoleted due to no activity on 2024/04/09 15:57
upstream possible deadlock in do_page_mkwrite (3) kernfs 4 4 4d05h 76d 0/29 upstream: reported on 2025/06/15 09:03
Last patch testing requests (8)
Created Duration User Patch Repo Result
2025/08/12 20:36 10m retest repro linux-5.15.y report log
2025/07/26 06:15 11m retest repro linux-5.15.y report log
2025/06/17 13:32 15m retest repro linux-5.15.y report log
2025/06/02 00:14 15m retest repro linux-5.15.y report log
2025/04/22 11:48 11m retest repro linux-5.15.y report log
2025/03/23 19:00 10m retest repro linux-5.15.y report log
2025/03/23 19:00 11m retest repro linux-5.15.y report log
2025/02/11 10:15 15m retest repro linux-5.15.y report log
Fix bisection attempts (13)
Created Duration User Patch Repo Result
2025/02/04 02:50 7h00m fix candidate upstream OK (1) job log
2024/12/03 01:14 3h01m bisect fix linux-5.15.y OK (0) job log log
2024/10/08 08:57 2h43m bisect fix linux-5.15.y OK (0) job log log
2024/08/03 18:46 1h09m bisect fix linux-5.15.y OK (0) job log log
2024/06/24 04:43 1h52m bisect fix linux-5.15.y OK (0) job log log
2024/04/16 14:14 1h27m bisect fix linux-5.15.y OK (0) job log log
2024/03/13 14:13 1h18m bisect fix linux-5.15.y OK (0) job log log
2024/02/08 19:55 1h18m bisect fix linux-5.15.y OK (0) job log log
2024/01/04 04:45 1h08m bisect fix linux-5.15.y OK (0) job log log
2023/12/04 07:50 1h17m bisect fix linux-5.15.y OK (0) job log log
2023/11/03 09:00 1h17m bisect fix linux-5.15.y OK (0) job log log
2023/10/03 11:01 1h24m bisect fix linux-5.15.y OK (0) job log log
2023/07/24 12:38 4h06m bisect fix linux-5.15.y OK (0) job log log

Sample crash report:
REISERFS (device loop2): Created .reiserfs_priv - reserved for xattr storage.
======================================================
WARNING: possible circular locking dependency detected
5.15.189-syzkaller #0 Not tainted
------------------------------------------------------
syz.2.19/4417 is trying to acquire lock:
ffff88805d5bd090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x75/0xd0 fs/reiserfs/lock.c:27

but task is already holding lock:
ffff888025482558 (sb_pagefaults#2){.+.+}-{0:0}, at: do_page_mkwrite+0x168/0x3c0 mm/memory.c:2922

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (sb_pagefaults#2){.+.+}-{0:0}:
       percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
       __sb_start_write include/linux/fs.h:1811 [inline]
       sb_start_pagefault include/linux/fs.h:1910 [inline]
       filemap_page_mkwrite+0x120/0x660 mm/filemap.c:3367
       do_page_mkwrite+0x168/0x3c0 mm/memory.c:2922
       do_shared_fault mm/memory.c:4328 [inline]
       do_fault mm/memory.c:4396 [inline]
       handle_pte_fault mm/memory.c:4650 [inline]
       __handle_mm_fault mm/memory.c:4785 [inline]
       handle_mm_fault+0x1d4b/0x43c0 mm/memory.c:4883
       do_user_addr_fault+0x489/0xc80 arch/x86/mm/fault.c:1357
       handle_page_fault arch/x86/mm/fault.c:1445 [inline]
       exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1501
       asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606

-> #1 (&mm->mmap_lock){++++}-{3:3}:
       __might_fault+0xb3/0x110 mm/memory.c:5357
       reiserfs_ioctl+0x13b/0x330 fs/reiserfs/ioctl.c:96
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:874 [inline]
       __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #0 (&sbi->lock){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3053 [inline]
       check_prevs_add kernel/locking/lockdep.c:3172 [inline]
       validate_chain kernel/locking/lockdep.c:3788 [inline]
       __lock_acquire+0x2c33/0x7c60 kernel/locking/lockdep.c:5012
       lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
       __mutex_lock_common+0x1eb/0x2390 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       reiserfs_write_lock+0x75/0xd0 fs/reiserfs/lock.c:27
       reiserfs_dirty_inode+0xf0/0x240 fs/reiserfs/super.c:704
       __mark_inode_dirty+0x2b0/0xc60 fs/fs-writeback.c:2464
       generic_update_time+0x1cd/0x1f0 fs/inode.c:1881
       inode_update_time fs/inode.c:1894 [inline]
       file_update_time+0x38b/0x400 fs/inode.c:2083
       filemap_page_mkwrite+0x242/0x660 mm/filemap.c:3368
       do_page_mkwrite+0x168/0x3c0 mm/memory.c:2922
       do_shared_fault mm/memory.c:4328 [inline]
       do_fault mm/memory.c:4396 [inline]
       handle_pte_fault mm/memory.c:4650 [inline]
       __handle_mm_fault mm/memory.c:4785 [inline]
       handle_mm_fault+0x1d4b/0x43c0 mm/memory.c:4883
       do_user_addr_fault+0x489/0xc80 arch/x86/mm/fault.c:1357
       handle_page_fault arch/x86/mm/fault.c:1445 [inline]
       exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1501
       asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606

other info that might help us debug this:

Chain exists of:
  &sbi->lock --> &mm->mmap_lock --> sb_pagefaults#2

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(sb_pagefaults#2);
                               lock(&mm->mmap_lock);
                               lock(sb_pagefaults#2);
  lock(&sbi->lock);

 *** DEADLOCK ***

2 locks held by syz.2.19/4417:
 #0: ffff88807b712428
 (&mm->mmap_lock
){++++}-{3:3}, at: mmap_read_lock+0x1c/0x50 include/linux/mmap_lock.h:117
 #1: ffff888025482558 (sb_pagefaults#2){.+.+}-{0:0}
, at: do_page_mkwrite+0x168/0x3c0 mm/memory.c:2922

stack backtrace:
CPU: 1 PID: 4417 Comm: syz.2.19 Not tainted 5.15.189-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
 check_noncircular+0x274/0x310 kernel/locking/lockdep.c:2133
 check_prev_add kernel/locking/lockdep.c:3053 [inline]
 check_prevs_add kernel/locking/lockdep.c:3172 [inline]
 validate_chain kernel/locking/lockdep.c:3788 [inline]
 __lock_acquire+0x2c33/0x7c60 kernel/locking/lockdep.c:5012
 lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
 __mutex_lock_common+0x1eb/0x2390 kernel/locking/mutex.c:596
 __mutex_lock kernel/locking/mutex.c:729 [inline]
 mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
 reiserfs_write_lock+0x75/0xd0 fs/reiserfs/lock.c:27
 reiserfs_dirty_inode+0xf0/0x240 fs/reiserfs/super.c:704
 __mark_inode_dirty+0x2b0/0xc60 fs/fs-writeback.c:2464
 generic_update_time+0x1cd/0x1f0 fs/inode.c:1881
 inode_update_time fs/inode.c:1894 [inline]
 file_update_time+0x38b/0x400 fs/inode.c:2083
 filemap_page_mkwrite+0x242/0x660 mm/filemap.c:3368
 do_page_mkwrite+0x168/0x3c0 mm/memory.c:2922
 do_shared_fault mm/memory.c:4328 [inline]
 do_fault mm/memory.c:4396 [inline]
 handle_pte_fault mm/memory.c:4650 [inline]
 __handle_mm_fault mm/memory.c:4785 [inline]
 handle_mm_fault+0x1d4b/0x43c0 mm/memory.c:4883
 do_user_addr_fault+0x489/0xc80 arch/x86/mm/fault.c:1357
 handle_page_fault arch/x86/mm/fault.c:1445 [inline]
 exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1501
 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606
RIP: 0033:0x7fb6e42b292b
Code: fa 10 73 2d 83 fa 08 73 46 83 fa 04 73 16 83 fa 01 7c 10 8a 0e 74 0a 0f b7 74 16 fe 66 89 74 17 fe 88 0f c3 8b 4c 16 fc 8b 36 <89> 4c 17 fc 89 37 c3 c5 fa 6f 06 c5 fa 6f 4c 16 f0 c5 fa 7f 07 c5
RSP: 002b:00007ffc5b6cbe58 EFLAGS: 00010202
RAX: 0000200000000400 RBX: 0000000000000004 RCX: 0000000000737562
RDX: 0000000000000006 RSI: 0000000075622f2e RDI: 0000200000000400
RBP: 0000000000000000 R08: 0000001b31720000 R09: 0000000000000001
R10: 0000000000000001 R11: 0000000000000009 R12: 00007fb6e4511fac
R13: 00007fb6e4511fa0 R14: fffffffffffffffe R15: 0000000000000006
 </TASK>

Crashes (15):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/08/17 17:22 linux-5.15.y c79648372d02 1804e95e .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-5-15-kasan possible deadlock in do_page_mkwrite
2023/08/06 15:13 linux-5.15.y 38d4ca22a528 4ffcc9ef .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan possible deadlock in do_page_mkwrite
2023/06/12 00:08 linux-5.15.y 7349e40704a0 49519f06 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan possible deadlock in do_page_mkwrite
2025/02/25 05:12 linux-5.15.y c16c81c81336 d34966d1 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-5-15-kasan-arm64 possible deadlock in do_page_mkwrite
2025/07/26 18:50 linux-5.15.y c79648372d02 fb8f743d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in do_page_mkwrite
2025/07/07 08:05 linux-5.15.y 3dea0e7f549e 4f67c4ae .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in do_page_mkwrite
2024/05/14 03:48 linux-5.15.y 284087d4f7d5 fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in do_page_mkwrite
2025/06/28 15:35 linux-5.15.y 3dea0e7f549e fc9d8ee5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in do_page_mkwrite
2025/05/17 12:40 linux-5.15.y 3b8db0e4f263 f41472b0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in do_page_mkwrite
2025/03/08 17:55 linux-5.15.y c16c81c81336 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in do_page_mkwrite
2025/01/09 05:35 linux-5.15.y 91786f140358 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in do_page_mkwrite
2024/08/25 11:31 linux-5.15.y fa93fa65db6e d7d32352 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in do_page_mkwrite
2024/05/16 21:01 linux-5.15.y 284087d4f7d5 c2e07261 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in do_page_mkwrite
2024/05/14 11:18 linux-5.15.y 284087d4f7d5 fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in do_page_mkwrite
2024/05/02 19:17 linux-5.15.y 284087d4f7d5 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in do_page_mkwrite
* Struck through repros no longer work on HEAD.