ptp ptp0: delete virtual clock ptp3 ============================================ WARNING: possible recursive locking detected 6.15.0-syzkaller-09113-g8477ab143069 #0 Tainted: G U -------------------------------------------- syz.0.5428/22450 is trying to acquire lock: ffff88802563c868 (&ptp->n_vclocks_mux){+.+.}-{4:4}, at: ptp_vclock_in_use drivers/ptp/ptp_private.h:103 [inline] ffff88802563c868 (&ptp->n_vclocks_mux){+.+.}-{4:4}, at: ptp_clock_unregister+0x21/0x250 drivers/ptp/ptp_clock.c:415 but task is already holding lock: ffff88814bc96868 (&ptp->n_vclocks_mux){+.+.}-{4:4}, at: n_vclocks_store+0xf1/0x6d0 drivers/ptp/ptp_sysfs.c:215 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&ptp->n_vclocks_mux); lock(&ptp->n_vclocks_mux); *** DEADLOCK *** May be due to missing lock nesting notation 4 locks held by syz.0.5428/22450: #0: ffff888036126428 (sb_writers#7){.+.+}-{0:0}, at: ksys_write+0x12a/0x250 fs/read_write.c:738 #1: ffff88807f609488 (&of->mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x28f/0x510 fs/kernfs/file.c:325 #2: ffff88814c03f788 (kn->active#242){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x2b2/0x510 fs/kernfs/file.c:326 #3: ffff88814bc96868 (&ptp->n_vclocks_mux){+.+.}-{4:4}, at: n_vclocks_store+0xf1/0x6d0 drivers/ptp/ptp_sysfs.c:215 stack backtrace: CPU: 1 UID: 0 PID: 22450 Comm: syz.0.5428 Tainted: G U 6.15.0-syzkaller-09113-g8477ab143069 #0 PREEMPT(full) Tainted: [U]=USER Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_deadlock_bug+0x1e9/0x240 kernel/locking/lockdep.c:3044 check_deadlock kernel/locking/lockdep.c:3096 [inline] validate_chain kernel/locking/lockdep.c:3898 [inline] __lock_acquire+0x1106/0x1c90 kernel/locking/lockdep.c:5240 lock_acquire kernel/locking/lockdep.c:5871 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5828 __mutex_lock_common kernel/locking/mutex.c:601 [inline] __mutex_lock+0x199/0xb90 kernel/locking/mutex.c:746 ptp_vclock_in_use drivers/ptp/ptp_private.h:103 [inline] ptp_clock_unregister+0x21/0x250 drivers/ptp/ptp_clock.c:415 ptp_vclock_unregister+0x11a/0x160 drivers/ptp/ptp_vclock.c:228 unregister_vclock+0x108/0x1a0 drivers/ptp/ptp_sysfs.c:177 device_for_each_child_reverse+0x133/0x1a0 drivers/base/core.c:4051 n_vclocks_store+0x4b6/0x6d0 drivers/ptp/ptp_sysfs.c:241 dev_attr_store+0x58/0x80 drivers/base/core.c:2440 sysfs_kf_write+0xef/0x150 fs/sysfs/file.c:145 kernfs_fop_write_iter+0x351/0x510 fs/kernfs/file.c:334 new_sync_write fs/read_write.c:593 [inline] vfs_write+0x6c4/0x1150 fs/read_write.c:686 ksys_write+0x12a/0x250 fs/read_write.c:738 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x490 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f303698e969 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:00007f3037841038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f3036bb5fa0 RCX: 00007f303698e969 RDX: 0000000000080001 RSI: 00002000000003c0 RDI: 0000000000000006 RBP: 00007f3036a10ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f3036bb5fa0 R15: 00007fff04599b48 ptp ptp0: delete virtual clock ptp2 ptp ptp0: delete virtual clock ptp1 ptp ptp0: only physical clock in use now EXT4-fs error (device sda1): ext4_discard_preallocations:5601: comm syz.0.5428: Error -117 reading block bitmap for 2 EXT4-fs error (device sda1) in ext4_free_inode:361: Corrupt filesystem EXT4-fs error (device sda1) in ext4_free_inode:361: Corrupt filesystem