loop6: detected capacity change from 0 to 32768 JBD2: Ignoring recovery information on journal ocfs2: Mounting device (7,6) on (node local, slot 0) with ordered data mode. ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.6.364/6033 is trying to acquire lock: ffff8880546c09c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:793 [inline] ffff8880546c09c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_try_to_free_truncate_log+0xb1/0x370 fs/ocfs2/alloc.c:6122 but task is already holding lock: ffff88805de20660 (&oi->ip_alloc_sem){++++}-{3:3}, at: ocfs2_page_mkwrite+0x2c4/0xaa0 fs/ocfs2/mmap.c:141 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #5 (&oi->ip_alloc_sem){++++}-{3:3}: down_write+0x38/0x60 kernel/locking/rwsem.c:1551 ocfs2_page_mkwrite+0x2c4/0xaa0 fs/ocfs2/mmap.c:141 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+0x1e47/0x4440 mm/memory.c:4883 do_user_addr_fault+0x494/0xc90 arch/x86/mm/fault.c:1355 handle_page_fault arch/x86/mm/fault.c:1443 [inline] exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1496 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606 copy_user_enhanced_fast_string+0xe/0x40 arch/x86/lib/copy_user_64.S:205 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:58 [inline] _copy_to_user+0xf0/0x130 lib/usercopy.c:40 copy_to_user include/linux/uaccess.h:200 [inline] __do_replace+0x852/0x9f0 net/ipv4/netfilter/ip_tables.c:1084 do_replace net/ipv4/netfilter/ip_tables.c:1140 [inline] do_ipt_set_ctl+0xa9b/0xd70 net/ipv4/netfilter/ip_tables.c:1633 nf_setsockopt+0x25f/0x280 net/netfilter/nf_sockopt.c:101 ip_setsockopt+0x29c3/0x31e0 net/ipv4/ip_sockglue.c:1442 tcp_setsockopt+0x229/0x1e60 net/ipv4/tcp.c:3722 __sys_setsockopt+0x2bf/0x3d0 net/socket.c:2213 __do_sys_setsockopt net/socket.c:2224 [inline] __se_sys_setsockopt net/socket.c:2221 [inline] __x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2221 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 -> #4 (sb_pagefaults#3){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1817 [inline] sb_start_pagefault include/linux/fs.h:1916 [inline] ocfs2_page_mkwrite+0x1a7/0xaa0 fs/ocfs2/mmap.c:121 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+0x1e47/0x4440 mm/memory.c:4883 do_user_addr_fault+0x494/0xc90 arch/x86/mm/fault.c:1355 handle_page_fault arch/x86/mm/fault.c:1443 [inline] exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1496 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606 copy_user_enhanced_fast_string+0xe/0x40 arch/x86/lib/copy_user_64.S:205 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:58 [inline] _copy_to_user+0xf0/0x130 lib/usercopy.c:40 copy_to_user include/linux/uaccess.h:200 [inline] __do_replace+0x852/0x9f0 net/ipv4/netfilter/ip_tables.c:1084 do_replace net/ipv4/netfilter/ip_tables.c:1140 [inline] do_ipt_set_ctl+0xa9b/0xd70 net/ipv4/netfilter/ip_tables.c:1633 nf_setsockopt+0x25f/0x280 net/netfilter/nf_sockopt.c:101 ip_setsockopt+0x29c3/0x31e0 net/ipv4/ip_sockglue.c:1442 tcp_setsockopt+0x229/0x1e60 net/ipv4/tcp.c:3722 __sys_setsockopt+0x2bf/0x3d0 net/socket.c:2213 __do_sys_setsockopt net/socket.c:2224 [inline] __se_sys_setsockopt net/socket.c:2221 [inline] __x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2221 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 -> #3 (&mm->mmap_lock){++++}-{3:3}: internal_get_user_pages_fast+0x1f6/0x20b0 mm/gup.c:2895 iov_iter_get_pages+0x228/0x5f0 lib/iov_iter.c:1544 __bio_iov_iter_get_pages block/bio.c:1136 [inline] bio_iov_iter_get_pages+0x46c/0x1890 block/bio.c:1195 iomap_dio_bio_iter+0xb94/0x1470 fs/iomap/direct-io.c:325 iomap_dio_iter fs/iomap/direct-io.c:-1 [inline] __iomap_dio_rw+0xd64/0x1ba0 fs/iomap/direct-io.c:590 iomap_dio_rw+0x38/0x90 fs/iomap/direct-io.c:676 ext4_dio_read_iter fs/ext4/file.c:77 [inline] ext4_file_read_iter+0x565/0x6f0 fs/ext4/file.c:128 call_read_iter include/linux/fs.h:2173 [inline] aio_read+0x33a/0x490 fs/aio.c:1554 __io_submit_one fs/aio.c:-1 [inline] io_submit_one+0x68b/0x1310 fs/aio.c:2013 __do_sys_io_submit fs/aio.c:2072 [inline] __se_sys_io_submit+0x19d/0x310 fs/aio.c:2042 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 -> #2 (&sb->s_type->i_mutex_key#9){++++}-{3:3}: down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498 inode_lock_shared include/linux/fs.h:803 [inline] ext4_bmap+0x4f/0x3f0 fs/ext4/inode.c:3166 bmap+0xa2/0xd0 fs/inode.c:1817 jbd2_journal_bmap fs/jbd2/journal.c:981 [inline] jbd2_fc_get_buf+0x1ab/0x390 fs/jbd2/journal.c:895 ext4_fc_reserve_space+0x4fa/0x890 fs/ext4/fast_commit.c:705 ext4_fc_add_tlv+0xab/0x570 fs/ext4/fast_commit.c:797 ext4_fc_perform_commit fs/ext4/fast_commit.c:1122 [inline] ext4_fc_commit+0xb08/0x1380 fs/ext4/fast_commit.c:1235 ext4_fsync_journal fs/ext4/fsync.c:115 [inline] ext4_sync_file+0x550/0xb10 fs/ext4/fsync.c:174 vfs_fsync_range fs/sync.c:188 [inline] vfs_fsync fs/sync.c:202 [inline] do_fsync fs/sync.c:212 [inline] __do_sys_fsync fs/sync.c:220 [inline] __se_sys_fsync fs/sync.c:218 [inline] __x64_sys_fsync+0x189/0x1c0 fs/sync.c:218 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 -> #1 (&journal->j_barrier){+.+.}-{3:3}: __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 jbd2_journal_lock_updates+0x2ce/0x390 fs/jbd2/transaction.c:905 __ocfs2_flush_truncate_log+0x2b4/0x1110 fs/ocfs2/alloc.c:6027 ocfs2_flush_truncate_log+0x4b/0x60 fs/ocfs2/alloc.c:6074 ocfs2_sync_fs+0x119/0x330 fs/ocfs2/super.c:403 sync_filesystem+0x1be/0x220 fs/sync.c:66 generic_shutdown_super+0x6b/0x300 fs/super.c:448 kill_block_super+0x7c/0xe0 fs/super.c:1438 deactivate_locked_super+0x93/0xf0 fs/super.c:335 cleanup_mnt+0x426/0x4d0 fs/namespace.c:1148 task_work_run+0x125/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:184 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:217 __syscall_exit_to_user_mode_work kernel/entry/common.c:299 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:310 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3} : check_prev_add kernel/locking/lockdep.c:3120 [inline] check_prevs_add kernel/locking/lockdep.c:3239 [inline] validate_chain kernel/locking/lockdep.c:3855 [inline] __lock_acquire+0x38f7/0x7d40 kernel/locking/lockdep.c:5120 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5737 down_write+0x38/0x60 kernel/locking/rwsem.c:1551 inode_lock include/linux/fs.h:793 [inline] ocfs2_try_to_free_truncate_log+0xb1/0x370 fs/ocfs2/alloc.c:6122 ocfs2_reserve_clusters_with_limit+0x48a/0xc10 fs/ocfs2/suballoc.c:1202 ocfs2_convert_inline_data_to_extents+0x1f7/0x1290 fs/ocfs2/alloc.c:7071 ocfs2_try_to_write_inline_data fs/ocfs2/aops.c:1566 [inline] ocfs2_write_begin_nolock+0x17f1/0x44b0 fs/ocfs2/aops.c:1673 __ocfs2_page_mkwrite fs/ocfs2/mmap.c:92 [inline] ocfs2_page_mkwrite+0x58a/0xaa0 fs/ocfs2/mmap.c:143 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+0x1e47/0x4440 mm/memory.c:4883 do_user_addr_fault+0x494/0xc90 arch/x86/mm/fault.c:1355 handle_page_fault arch/x86/mm/fault.c:1443 [inline] exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1496 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606 copy_user_enhanced_fast_string+0xe/0x40 arch/x86/lib/copy_user_64.S:205 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:58 [inline] _copy_to_user+0xf0/0x130 lib/usercopy.c:40 copy_to_user include/linux/uaccess.h:200 [inline] __do_replace+0x852/0x9f0 net/ipv4/netfilter/ip_tables.c:1084 do_replace net/ipv4/netfilter/ip_tables.c:1140 [inline] do_ipt_set_ctl+0xa9b/0xd70 net/ipv4/netfilter/ip_tables.c:1633 nf_setsockopt+0x25f/0x280 net/netfilter/nf_sockopt.c:101 ip_setsockopt+0x29c3/0x31e0 net/ipv4/ip_sockglue.c:1442 tcp_setsockopt+0x229/0x1e60 net/ipv4/tcp.c:3722 __sys_setsockopt+0x2bf/0x3d0 net/socket.c:2213 __do_sys_setsockopt net/socket.c:2224 [inline] __se_sys_setsockopt net/socket.c:2221 [inline] __x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2221 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 other info that might help us debug this: Chain exists of: &ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2 --> sb_pagefaults#3 --> &oi->ip_alloc_sem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&oi->ip_alloc_sem); lock(sb_pagefaults#3); lock(&oi->ip_alloc_sem); lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2); *** DEADLOCK *** 3 locks held by syz.6.364/6033: #0: ffff88807bac96e8 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff88807bac96e8 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault+0x2bb/0xc90 arch/x86/mm/fault.c:1296 #1: ffff888025f8a558 (sb_pagefaults#3){.+.+}-{0:0}, at: do_page_mkwrite+0x168/0x3c0 mm/memory.c:2922 #2: ffff88805de20660 (&oi->ip_alloc_sem){++++}-{3:3}, at: ocfs2_page_mkwrite+0x2c4/0xaa0 fs/ocfs2/mmap.c:141 stack backtrace: CPU: 1 PID: 6033 Comm: syz.6.364 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 check_noncircular+0x2f8/0x400 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3120 [inline] check_prevs_add kernel/locking/lockdep.c:3239 [inline] validate_chain kernel/locking/lockdep.c:3855 [inline] __lock_acquire+0x38f7/0x7d40 kernel/locking/lockdep.c:5120 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5737 down_write+0x38/0x60 kernel/locking/rwsem.c:1551 inode_lock include/linux/fs.h:793 [inline] ocfs2_try_to_free_truncate_log+0xb1/0x370 fs/ocfs2/alloc.c:6122 ocfs2_reserve_clusters_with_limit+0x48a/0xc10 fs/ocfs2/suballoc.c:1202 ocfs2_convert_inline_data_to_extents+0x1f7/0x1290 fs/ocfs2/alloc.c:7071 ocfs2_try_to_write_inline_data fs/ocfs2/aops.c:1566 [inline] ocfs2_write_begin_nolock+0x17f1/0x44b0 fs/ocfs2/aops.c:1673 __ocfs2_page_mkwrite fs/ocfs2/mmap.c:92 [inline] ocfs2_page_mkwrite+0x58a/0xaa0 fs/ocfs2/mmap.c:143 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+0x1e47/0x4440 mm/memory.c:4883 do_user_addr_fault+0x494/0xc90 arch/x86/mm/fault.c:1355 handle_page_fault arch/x86/mm/fault.c:1443 [inline] exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1496 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606 RIP: 0010:copy_user_enhanced_fast_string+0xe/0x40 arch/x86/lib/copy_user_64.S:206 Code: 89 d1 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 31 c0 0f 01 ca c3 90 90 90 90 90 90 90 0f 01 cb 83 fa 40 0f 82 70 ff ff ff 89 d1 a4 31 c0 0f 01 ca c3 90 90 90 90 90 90 90 90 90 90 89 d1 83 f8 RSP: 0018:ffffc9000340f7a0 EFLAGS: 00050202 RAX: ffffffff83e98901 RBX: 0000000000000060 RCX: 0000000000000060 RDX: 0000000000000060 RSI: ffffc90001248000 RDI: 0000000000000000 RBP: 0000000000000000 R08: ffffc9000124805f R09: 1ffff9200024900b R10: dffffc0000000000 R11: fffff5200024900c R12: 00007ffffffff000 R13: 0000000000000060 R14: ffffc90001248000 R15: 0000000000000000 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:58 [inline] _copy_to_user+0xf0/0x130 lib/usercopy.c:40 copy_to_user include/linux/uaccess.h:200 [inline] __do_replace+0x852/0x9f0 net/ipv4/netfilter/ip_tables.c:1084 do_replace net/ipv4/netfilter/ip_tables.c:1140 [inline] do_ipt_set_ctl+0xa9b/0xd70 net/ipv4/netfilter/ip_tables.c:1633 nf_setsockopt+0x25f/0x280 net/netfilter/nf_sockopt.c:101 ip_setsockopt+0x29c3/0x31e0 net/ipv4/ip_sockglue.c:1442 tcp_setsockopt+0x229/0x1e60 net/ipv4/tcp.c:3722 __sys_setsockopt+0x2bf/0x3d0 net/socket.c:2213 __do_sys_setsockopt net/socket.c:2224 [inline] __se_sys_setsockopt net/socket.c:2221 [inline] __x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2221 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 RIP: 0033:0x7fb6cafc44d9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb6c9211028 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007fb6cb240fa0 RCX: 00007fb6cafc44d9 RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000005 RBP: 00007fb6cb05304e R08: 00000000000003f0 R09: 0000000000000000 R10: 000020000000eec0 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fb6cb241038 R14: 00007fb6cb240fa0 R15: 00007ffccb331278 kcov: kcov_task_exit: t = ffff8880213d8000, kcov->t = ffff8880213d8000 ---------------- Code disassembly (best guess): 0: 89 d1 mov %edx,%ecx 2: c1 e9 03 shr $0x3,%ecx 5: 83 e2 07 and $0x7,%edx 8: f3 48 a5 rep movsq %ds:(%rsi),%es:(%rdi) b: 89 d1 mov %edx,%ecx d: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) f: 31 c0 xor %eax,%eax 11: 0f 01 ca clac 14: c3 ret 15: 90 nop 16: 90 nop 17: 90 nop 18: 90 nop 19: 90 nop 1a: 90 nop 1b: 90 nop 1c: 0f 01 cb stac 1f: 83 fa 40 cmp $0x40,%edx 22: 0f 82 70 ff ff ff jb 0xffffff98 28: 89 d1 mov %edx,%ecx * 2a: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) <-- trapping instruction 2c: 31 c0 xor %eax,%eax 2e: 0f 01 ca clac 31: c3 ret 32: 90 nop 33: 90 nop 34: 90 nop 35: 90 nop 36: 90 nop 37: 90 nop 38: 90 nop 39: 90 nop 3a: 90 nop 3b: 90 nop 3c: 89 d1 mov %edx,%ecx 3e: 83 .byte 0x83 3f: f8 clc