Hello,
syzbot found the following issue on:
HEAD commit: f6e38ae624cf Linux 6.1.158
git tree: linux-6.1.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=1025932f980000
kernel config:
https://syzkaller.appspot.com/x/.config?x=7eb38bd5021fec61
dashboard link:
https://syzkaller.appspot.com/bug?extid=4399e870ea0b97221185
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/2b7003e2661d/disk-f6e38ae6.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/0696cea8d016/vmlinux-f6e38ae6.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/6b7a89e636d7/bzImage-f6e38ae6.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+4399e8...@syzkaller.appspotmail.com
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.1.1458/9630 is trying to acquire lock:
ffff88802f984c58 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline]
ffff88802f984c58 (&mm->mmap_lock){++++}-{3:3}, at: upgrade_mmap_lock_carefully+0xbb/0x140 mm/memory.c:5357
but task is already holding lock:
ffff8880782d4800 (&sb->s_type->i_mutex_key#12){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
ffff8880782d4800 (&sb->s_type->i_mutex_key#12){+.+.}-{3:3}, at: generic_file_write_iter+0x7f/0x2e0 mm/filemap.c:4003
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&sb->s_type->i_mutex_key#12){+.+.}-{3:3}:
down_write+0x36/0x60 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:758 [inline]
process_measurement+0x33c/0x1a10 security/integrity/ima/ima_main.c:242
ima_file_mmap+0x104/0x150 security/integrity/ima/ima_main.c:429
__do_sys_remap_file_pages mm/mmap.c:3036 [inline]
__se_sys_remap_file_pages+0x53e/0x770 mm/mmap.c:2968
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
-> #0 (&mm->mmap_lock){++++}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3090 [inline]
check_prevs_add kernel/locking/lockdep.c:3209 [inline]
validate_chain kernel/locking/lockdep.c:3825 [inline]
__lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049
lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
down_write_killable+0x45/0x90 kernel/locking/rwsem.c:1584
mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline]
upgrade_mmap_lock_carefully+0xbb/0x140 mm/memory.c:5357
lock_mm_and_find_vma+0x117/0x2f0 mm/memory.c:5410
do_user_addr_fault+0x2db/0xb10 arch/x86/mm/fault.c:1312
handle_page_fault arch/x86/mm/fault.c:1431 [inline]
exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1487
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:608
fault_in_readable+0x13e/0x1f0 mm/gup.c:1914
fault_in_iov_iter_readable+0xbb/0x2e0 lib/iov_iter.c:356
generic_perform_write+0x1d2/0x560 mm/filemap.c:3836
__generic_file_write_iter+0x172/0x430 mm/filemap.c:3974
generic_file_write_iter+0xab/0x2e0 mm/filemap.c:4006
call_write_iter include/linux/fs.h:2265 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x44c/0x960 fs/read_write.c:584
ksys_pwrite64 fs/read_write.c:699 [inline]
__do_sys_pwrite64 fs/read_write.c:709 [inline]
__se_sys_pwrite64 fs/read_write.c:706 [inline]
__x64_sys_pwrite64+0x191/0x220 fs/read_write.c:706
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&sb->s_type->i_mutex_key#12);
lock(&mm->mmap_lock);
lock(&sb->s_type->i_mutex_key#12);
lock(&mm->mmap_lock);
*** DEADLOCK ***
2 locks held by syz.1.1458/9630:
#0: ffff88807b4a0460 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0x256/0x960 fs/read_write.c:580
#1: ffff8880782d4800 (&sb->s_type->i_mutex_key#12){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
#1: ffff8880782d4800 (&sb->s_type->i_mutex_key#12){+.+.}-{3:3}, at: generic_file_write_iter+0x7f/0x2e0 mm/filemap.c:4003
stack backtrace:
CPU: 0 PID: 9630 Comm: syz.1.1458 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
<TASK>
dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
check_noncircular+0x274/0x310 kernel/locking/lockdep.c:2170
check_prev_add kernel/locking/lockdep.c:3090 [inline]
check_prevs_add kernel/locking/lockdep.c:3209 [inline]
validate_chain kernel/locking/lockdep.c:3825 [inline]
__lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049
lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
down_write_killable+0x45/0x90 kernel/locking/rwsem.c:1584
mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline]
upgrade_mmap_lock_carefully+0xbb/0x140 mm/memory.c:5357
lock_mm_and_find_vma+0x117/0x2f0 mm/memory.c:5410
do_user_addr_fault+0x2db/0xb10 arch/x86/mm/fault.c:1312
handle_page_fault arch/x86/mm/fault.c:1431 [inline]
exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1487
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:608
RIP: 0010:fault_in_readable+0x13e/0x1f0 mm/gup.c:1915
Code: 48 e7 c4 ff 4d 89 f4 49 81 cc ff 0f 00 00 4d 89 f7 49 01 dc 49 81 e4 00 f0 ff ff 4d 39 e6 77 44 e8 27 e7 c4 ff 4d 39 e7 74 47 <41> 8a 07 88 44 24 07 49 81 c7 00 10 00 00 4d 39 e7 74 07 e8 0a e7
RSP: 0018:ffffc90003fa7a90 EFLAGS: 00050287
RAX: ffffffff81bbef39 RBX: 0000000000001000 RCX: 0000000000080000
RDX: ffffc90005789000 RSI: 000000000000054d RDI: 000000000000054e
RBP: 0000000000000000 R08: ffff888028659dc0 R09: 0000000000000002
R10: 0000000000000006 R11: 0000000000000002 R12: 0000200000003000
R13: dffffc0000000000 R14: 00002000000010c0 R15: 0000200000002000
fault_in_iov_iter_readable+0xbb/0x2e0 lib/iov_iter.c:356
generic_perform_write+0x1d2/0x560 mm/filemap.c:3836
__generic_file_write_iter+0x172/0x430 mm/filemap.c:3974
generic_file_write_iter+0xab/0x2e0 mm/filemap.c:4006
call_write_iter include/linux/fs.h:2265 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x44c/0x960 fs/read_write.c:584
ksys_pwrite64 fs/read_write.c:699 [inline]
__do_sys_pwrite64 fs/read_write.c:709 [inline]
__se_sys_pwrite64 fs/read_write.c:706 [inline]
__x64_sys_pwrite64+0x191/0x220 fs/read_write.c:706
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f031938f6c9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f031a2bd038 EFLAGS: 00000246 ORIG_RAX: 0000000000000012
RAX: ffffffffffffffda RBX: 00007f03195e5fa0 RCX: 00007f031938f6c9
RDX: 00000000200000c1 RSI: 00002000000000c0 RDI: 0000000000000003
RBP: 00007f0319411f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000009000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f03195e6038 R14: 00007f03195e5fa0 R15: 00007ffca63dc578
</TASK>
----------------
Code disassembly (best guess):
0: 48 e7 c4 rex.W out %eax,$0xc4
3: ff 4d 89 decl -0x77(%rbp)
6: f4 hlt
7: 49 81 cc ff 0f 00 00 or $0xfff,%r12
e: 4d 89 f7 mov %r14,%r15
11: 49 01 dc add %rbx,%r12
14: 49 81 e4 00 f0 ff ff and $0xfffffffffffff000,%r12
1b: 4d 39 e6 cmp %r12,%r14
1e: 77 44 ja 0x64
20: e8 27 e7 c4 ff call 0xffc4e74c
25: 4d 39 e7 cmp %r12,%r15
28: 74 47 je 0x71
* 2a: 41 8a 07 mov (%r15),%al <-- trapping instruction
2d: 88 44 24 07 mov %al,0x7(%rsp)
31: 49 81 c7 00 10 00 00 add $0x1000,%r15
38: 4d 39 e7 cmp %r12,%r15
3b: 74 07 je 0x44
3d: e8 .byte 0xe8
3e: 0a e7 or %bh,%ah
---
This report is generated by a bot. It may contain errors.
See
https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at
syzk...@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup