REISERFS (device loop1): journal params: device loop1, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
REISERFS (device loop1): checking transaction log (loop1)
REISERFS (device loop1): Using r5 hash to sort names
======================================================
WARNING: possible circular locking dependency detected
4.14.305-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.1/9656 is trying to acquire lock:
 (sb_writers#13){.+.+}, at: [<ffffffff818e209d>] sb_start_write include/linux/fs.h:1551 [inline]
 (sb_writers#13){.+.+}, at: [<ffffffff818e209d>] mnt_want_write_file+0xfd/0x3b0 fs/namespace.c:497

but task is already holding lock:
 (&sbi->lock){+.+.}, at: [<ffffffff81b3fbe5>] reiserfs_write_lock+0x75/0xf0 fs/reiserfs/lock.c:27

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&sbi->lock){+.+.}:
       __mutex_lock_common kernel/locking/mutex.c:756 [inline]
       __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893
       reiserfs_write_lock+0x75/0xf0 fs/reiserfs/lock.c:27
       reiserfs_lookup+0x130/0x400 fs/reiserfs/namei.c:363
       lookup_real fs/namei.c:1555 [inline]
       __lookup_hash fs/namei.c:1575 [inline]
       __lookup_hash+0x1bb/0x270 fs/namei.c:1563
       lookup_one_len+0x279/0x3a0 fs/namei.c:2539
       reiserfs_lookup_privroot+0x92/0x270 fs/reiserfs/xattr.c:970
       reiserfs_fill_super+0x1d12/0x2990 fs/reiserfs/super.c:2181
       mount_bdev+0x2b3/0x360 fs/super.c:1134
       mount_fs+0x92/0x2a0 fs/super.c:1237
       vfs_kern_mount.part.0+0x5b/0x470 fs/namespace.c:1046
       vfs_kern_mount fs/namespace.c:1036 [inline]
       do_new_mount fs/namespace.c:2572 [inline]
       do_mount+0xe65/0x2a30 fs/namespace.c:2905
       SYSC_mount fs/namespace.c:3121 [inline]
       SyS_mount+0xa8/0x120 fs/namespace.c:3098
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x5e/0xd3

-> #1 (&type->i_mutex_dir_key#8){+.+.}:
       down_write+0x34/0x90 kernel/locking/rwsem.c:54
       inode_lock include/linux/fs.h:719 [inline]
       do_last fs/namei.c:3331 [inline]
       path_openat+0xde2/0x2970 fs/namei.c:3571
       do_filp_open+0x179/0x3c0 fs/namei.c:3605
       do_sys_open+0x296/0x410 fs/open.c:1081
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x5e/0xd3

-> #0 (sb_writers#13){.+.+}:
       lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998
       percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline]
       percpu_down_read include/linux/percpu-rwsem.h:59 [inline]
       __sb_start_write+0x64/0x260 fs/super.c:1342
       sb_start_write include/linux/fs.h:1551 [inline]
       mnt_want_write_file+0xfd/0x3b0 fs/namespace.c:497
       reiserfs_ioctl+0x18e/0x8b0 fs/reiserfs/ioctl.c:110
       vfs_ioctl fs/ioctl.c:46 [inline]
       file_ioctl fs/ioctl.c:500 [inline]
       do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684
       SYSC_ioctl fs/ioctl.c:701 [inline]
       SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x5e/0xd3

other info that might help us debug this:

Chain exists of:
  sb_writers#13 --> &type->i_mutex_dir_key#8 --> &sbi->lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&sbi->lock);
                               lock(&type->i_mutex_dir_key#8);
                               lock(&sbi->lock);
  lock(sb_writers#13);

 *** DEADLOCK ***

1 lock held by syz-executor.1/9656:
 #0:  (&sbi->lock){+.+.}, at: [<ffffffff81b3fbe5>] reiserfs_write_lock+0x75/0xf0 fs/reiserfs/lock.c:27

stack backtrace:
CPU: 1 PID: 9656 Comm: syz-executor.1 Not tainted 4.14.305-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1258
 check_prev_add kernel/locking/lockdep.c:1905 [inline]
 check_prevs_add kernel/locking/lockdep.c:2022 [inline]
 validate_chain kernel/locking/lockdep.c:2464 [inline]
 __lock_acquire+0x2e0e/0x3f20 kernel/locking/lockdep.c:3491
 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998
 percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline]
 percpu_down_read include/linux/percpu-rwsem.h:59 [inline]
 __sb_start_write+0x64/0x260 fs/super.c:1342
 sb_start_write include/linux/fs.h:1551 [inline]
 mnt_want_write_file+0xfd/0x3b0 fs/namespace.c:497
 reiserfs_ioctl+0x18e/0x8b0 fs/reiserfs/ioctl.c:110
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:500 [inline]
 do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684
 SYSC_ioctl fs/ioctl.c:701 [inline]
 SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x5e/0xd3
RIP: 0033:0x7f999d85c0f9
RSP: 002b:00007f999bdce168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f999d97bf80 RCX: 00007f999d85c0f9
RDX: 0000000000000000 RSI: 0000000040087602 RDI: 0000000000000003
RBP: 00007f999d8b7ae9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fffffc6c18f R14: 00007f999bdce300 R15: 0000000000022000
EXT4-fs warning (device sda1): ext4_ioctl:716: Setting inode version is not supported with metadata_csum enabled.
ISO 9660 Extensions: Microsoft Joliet Level 3
ISOFS: changing to secondary root
kauditd_printk_skb: 17 callbacks suppressed
audit: type=1800 audit(1676324498.797:29): pid=9793 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.1" name=".pending_reads" dev="sda1" ino=13944 res=0
audit: type=1800 audit(1676324498.797:30): pid=9798 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.3" name=".pending_reads" dev="sda1" ino=13967 res=0
ISO 9660 Extensions: Microsoft Joliet Level 3
audit: type=1800 audit(1676324498.827:31): pid=9794 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.0" name=".pending_reads" dev="sda1" ino=13969 res=0
ISOFS: changing to secondary root
audit: type=1800 audit(1676324498.837:32): pid=9801 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.2" name=".pending_reads" dev="sda1" ino=13891 res=0
audit: type=1800 audit(1676324498.857:33): pid=9806 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.0" name=".pending_reads" dev="sda1" ino=13956 res=0
audit: type=1800 audit(1676324498.857:34): pid=9807 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.1" name=".pending_reads" dev="sda1" ino=13957 res=0
audit: type=1800 audit(1676324498.927:35): pid=9820 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.1" name=".pending_reads" dev="sda1" ino=13965 res=0
audit: type=1800 audit(1676324499.067:36): pid=9847 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.0" name=".pending_reads" dev="sda1" ino=13941 res=0
EXT4-fs warning (device sda1): ext4_ioctl:716: Setting inode version is not supported with metadata_csum enabled.
audit: type=1800 audit(1676324499.107:37): pid=9852 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.5" name=".pending_reads" dev="sda1" ino=13962 res=0
audit: type=1800 audit(1676324499.157:38): pid=9859 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.3" name=".pending_reads" dev="sda1" ino=13972 res=0
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.4'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.4'.
XFS (loop3): Mounting V4 Filesystem
XFS (loop3): Ending clean mount
XFS (loop3): Unmounting Filesystem
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.4'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.4'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.4'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.4'.
XFS (loop3): Mounting V4 Filesystem
XFS (loop3): Ending clean mount
XFS (loop0): Mounting V4 Filesystem
XFS (loop3): Unmounting Filesystem
XFS (loop0): Ending clean mount
XFS (loop0): Unmounting Filesystem
ISO 9660 Extensions: Microsoft Joliet Level 3
ISOFS: changing to secondary root
XFS (loop3): Mounting V4 Filesystem
XFS (loop3): Ending clean mount
XFS (loop0): Mounting V4 Filesystem
XFS (loop0): Ending clean mount
XFS (loop3): Unmounting Filesystem
XFS (loop0): Unmounting Filesystem
ISO 9660 Extensions: Microsoft Joliet Level 3
ISO 9660 Extensions: Microsoft Joliet Level 3
ISOFS: changing to secondary root
ISOFS: changing to secondary root
ISO 9660 Extensions: Microsoft Joliet Level 3
ISOFS: changing to secondary root
ISO 9660 Extensions: Microsoft Joliet Level 3
ISOFS: changing to secondary root
XFS (loop0): Mounting V4 Filesystem
XFS (loop0): Ending clean mount
XFS (loop0): Unmounting Filesystem
XFS (loop3): Mounting V4 Filesystem
XFS (loop3): Ending clean mount
XFS (loop3): Unmounting Filesystem
ISO 9660 Extensions: Microsoft Joliet Level 3
ISO 9660 Extensions: Microsoft Joliet Level 3
ISOFS: changing to secondary root
ISOFS: changing to secondary root
bridge0: port 2(bridge_slave_1) entered disabled state
: renamed from bridge_slave_1
REISERFS (device loop0): found reiserfs format "3.5" with non-standard journal
REISERFS (device loop0): using ordered data mode
reiserfs: using flush barriers
REISERFS (device loop0): journal params: device loop0, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
REISERFS (device loop0): checking transaction log (loop0)
REISERFS (device loop0): Using r5 hash to sort names
==================================================================
BUG: KASAN: slab-out-of-bounds in tipc_nametbl_lookup_dst_nodes+0x44c/0x4c0 net/tipc/name_table.c:670
Read of size 4 at addr ffff8880a9d2fb50 by task syz-executor.0/10528

CPU: 0 PID: 10528 Comm: syz-executor.0 Not tainted 4.14.305-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:251
 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:350
 kasan_report mm/kasan/report.c:408 [inline]
 __asan_report_load4_noabort+0x68/0x70 mm/kasan/report.c:428
 tipc_nametbl_lookup_dst_nodes+0x44c/0x4c0 net/tipc/name_table.c:670
 tipc_sendmcast+0x51a/0xac0 net/tipc/socket.c:768
 __tipc_sendmsg+0xbab/0xf90 net/tipc/socket.c:975
 tipc_sendmsg+0x4c/0x70 net/tipc/socket.c:923
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 ___sys_sendmsg+0x6c8/0x800 net/socket.c:2062
 __sys_sendmsg+0xa3/0x120 net/socket.c:2096
 SYSC_sendmsg net/socket.c:2107 [inline]
 SyS_sendmsg+0x27/0x40 net/socket.c:2103
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x5e/0xd3
RIP: 0033:0x7f5d321610f9
RSP: 002b:00007f5d306d3168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f5d32280f80 RCX: 00007f5d321610f9
RDX: 0000000000000000 RSI: 0000000020000280 RDI: 0000000000000004
RBP: 00007f5d321bcae9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fffa31e054f R14: 00007f5d306d3300 R15: 0000000000022000

Allocated by task 7998:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
 __do_kmalloc mm/slab.c:3720 [inline]
 __kmalloc+0x15a/0x400 mm/slab.c:3729
 tipc_nameseq_create+0x53/0x290 net/tipc/name_table.c:152
 tipc_nametbl_insert_publ+0xb37/0x14e0 net/tipc/name_table.c:476
 tipc_nametbl_publish+0x211/0x3f0 net/tipc/name_table.c:701
 tipc_sk_publish net/tipc/socket.c:2206 [inline]
 tipc_bind+0x2c4/0x600 net/tipc/socket.c:630
 tipc_create_listen_sock net/tipc/server.c:338 [inline]
 tipc_open_listening_sock net/tipc/server.c:396 [inline]
 tipc_server_start+0x31f/0x880 net/tipc/server.c:611
 tipc_topsrv_start net/tipc/subscr.c:382 [inline]
 tipc_topsrv_init_net+0x53b/0x730 net/tipc/subscr.c:397
 ops_init+0xaa/0x3e0 net/core/net_namespace.c:118
 setup_net+0x22f/0x530 net/core/net_namespace.c:298
 copy_net_ns+0x19b/0x440 net/core/net_namespace.c:422
 create_new_namespaces+0x375/0x720 kernel/nsproxy.c:107
 unshare_nsproxy_namespaces+0xa1/0x1d0 kernel/nsproxy.c:206
 SYSC_unshare kernel/fork.c:2413 [inline]
 SyS_unshare+0x308/0x7f0 kernel/fork.c:2363
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x5e/0xd3

Freed by task 1:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xc9/0x250 mm/slab.c:3815
 rh_call_control drivers/usb/core/hcd.c:739 [inline]
 rh_urb_enqueue drivers/usb/core/hcd.c:854 [inline]
 usb_hcd_submit_urb+0x8c0/0x20d0 drivers/usb/core/hcd.c:1667
 usb_submit_urb+0x4de/0x10a0 drivers/usb/core/urb.c:565
 usb_start_wait_urb+0xf3/0x440 drivers/usb/core/message.c:56
 usb_internal_control_msg drivers/usb/core/message.c:100 [inline]
 usb_control_msg+0x302/0x450 drivers/usb/core/message.c:151
 usb_get_descriptor+0xc0/0x160 drivers/usb/core/message.c:652
 usb_get_configuration+0x33a/0x47f0 drivers/usb/core/config.c:935
 usb_enumerate_device drivers/usb/core/hub.c:2341 [inline]
 usb_new_device+0xd8a/0x1940 drivers/usb/core/hub.c:2477
 register_root_hub drivers/usb/core/hcd.c:1121 [inline]
 usb_add_hcd+0xd2a/0x1de0 drivers/usb/core/hcd.c:2926
 vhci_hcd_probe+0x134/0x360 drivers/usb/usbip/vhci_hcd.c:1404
 platform_drv_probe+0xc1/0x1b0 drivers/base/platform.c:583
 really_probe drivers/base/dd.c:409 [inline]
 driver_probe_device+0x753/0xc80 drivers/base/dd.c:552
 __device_attach_driver+0x22a/0x360 drivers/base/dd.c:653
 bus_for_each_drv+0x13b/0x1a0 drivers/base/bus.c:466
 __device_attach+0x259/0x390 drivers/base/dd.c:710
 bus_probe_device+0x1db/0x290 drivers/base/bus.c:526
 device_add+0xa4f/0x15c0 drivers/base/core.c:1933
 platform_device_add+0x28f/0x7a0 drivers/base/platform.c:421
 vhci_hcd_init+0x2c3/0x3d4 drivers/usb/usbip/vhci_hcd.c:1588
 do_one_initcall+0x88/0x210 init/main.c:830
 do_initcall_level init/main.c:896 [inline]
 do_initcalls init/main.c:904 [inline]
 do_basic_setup init/main.c:922 [inline]
 kernel_init_freeable+0x565/0x626 init/main.c:1081
 kernel_init+0xd/0x165 init/main.c:1006
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:406

The buggy address belongs to the object at ffff8880a9d2fb40
 which belongs to the cache kmalloc-32 of size 32
The buggy address is located 16 bytes inside of
 32-byte region [ffff8880a9d2fb40, ffff8880a9d2fb60)
The buggy address belongs to the page:
page:ffffea0002a74bc0 count:1 mapcount:0 mapping:ffff8880a9d2f000 index:0xffff8880a9d2ffc1
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff8880a9d2f000 ffff8880a9d2ffc1 000000010000003f
raw: ffffea0002a78560 ffffea0002a86aa0 ffff88813fe741c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880a9d2fa00: fb fb fb fb fc fc fc fc 06 fc fc fc fc fc fc fc
 ffff8880a9d2fa80: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc
>ffff8880a9d2fb00: 00 00 00 fc fc fc fc fc 00 00 fc fc fc fc fc fc
                                                 ^
 ffff8880a9d2fb80: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc
 ffff8880a9d2fc00: fb fb fb fb fc fc fc fc 00 fc fc fc fc fc fc fc
==================================================================