bridge0: port 3(team0) entered disabled state
device team0 entered promiscuous mode
device team_slave_0 entered promiscuous mode
======================================================
device team_slave_1 entered promiscuous mode
WARNING: possible circular locking dependency detected
4.14.290-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.0/12106 is trying to acquire lock:
 ((&strp->work)){+.+.}, at: [<ffffffff81367998>] flush_work+0x88/0x770 kernel/workqueue.c:2887

but task is already holding lock:
 (sk_lock-AF_INET){+.+.}, at: [<ffffffff86815ca8>] lock_sock include/net/sock.h:1473 [inline]
 (sk_lock-AF_INET){+.+.}, at: [<ffffffff86815ca8>] kcm_attach net/kcm/kcmsock.c:1390 [inline]
 (sk_lock-AF_INET){+.+.}, at: [<ffffffff86815ca8>] kcm_attach_ioctl net/kcm/kcmsock.c:1490 [inline]
 (sk_lock-AF_INET){+.+.}, at: [<ffffffff86815ca8>] kcm_ioctl+0x328/0xfb0 net/kcm/kcmsock.c:1701

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (sk_lock-AF_INET){+.+.}:
       lock_sock_nested+0xb7/0x100 net/core/sock.c:2813
       do_strp_work net/strparser/strparser.c:415 [inline]
       strp_work+0x3e/0x100 net/strparser/strparser.c:434
       process_one_work+0x793/0x14a0 kernel/workqueue.c:2117
       worker_thread+0x5cc/0xff0 kernel/workqueue.c:2251
       kthread+0x30d/0x420 kernel/kthread.c:232
       ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

-> #0 ((&strp->work)){+.+.}:
       lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998
       flush_work+0xad/0x770 kernel/workqueue.c:2890
       __cancel_work_timer+0x321/0x460 kernel/workqueue.c:2965
       strp_done+0x53/0xd0 net/strparser/strparser.c:519
       kcm_attach net/kcm/kcmsock.c:1429 [inline]
       kcm_attach_ioctl net/kcm/kcmsock.c:1490 [inline]
       kcm_ioctl+0x828/0xfb0 net/kcm/kcmsock.c:1701
       sock_do_ioctl net/socket.c:974 [inline]
       sock_ioctl+0x2cc/0x4c0 net/socket.c:1071
       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+0x46/0xbb

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(sk_lock-AF_INET);
                               lock((&strp->work));
                               lock(sk_lock-AF_INET);
  lock((&strp->work));

 *** DEADLOCK ***

1 lock held by syz-executor.0/12106:
 #0:  (sk_lock-AF_INET){+.+.}, at: [<ffffffff86815ca8>] lock_sock include/net/sock.h:1473 [inline]
 #0:  (sk_lock-AF_INET){+.+.}, at: [<ffffffff86815ca8>] kcm_attach net/kcm/kcmsock.c:1390 [inline]
 #0:  (sk_lock-AF_INET){+.+.}, at: [<ffffffff86815ca8>] kcm_attach_ioctl net/kcm/kcmsock.c:1490 [inline]
 #0:  (sk_lock-AF_INET){+.+.}, at: [<ffffffff86815ca8>] kcm_ioctl+0x328/0xfb0 net/kcm/kcmsock.c:1701

stack backtrace:
CPU: 0 PID: 12106 Comm: syz-executor.0 Not tainted 4.14.290-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
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
 flush_work+0xad/0x770 kernel/workqueue.c:2890
 __cancel_work_timer+0x321/0x460 kernel/workqueue.c:2965
 strp_done+0x53/0xd0 net/strparser/strparser.c:519
 kcm_attach net/kcm/kcmsock.c:1429 [inline]
 kcm_attach_ioctl net/kcm/kcmsock.c:1490 [inline]
 kcm_ioctl+0x828/0xfb0 net/kcm/kcmsock.c:1701
 sock_do_ioctl net/socket.c:974 [inline]
 sock_ioctl+0x2cc/0x4c0 net/socket.c:1071
 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+0x46/0xbb
RIP: 0033:0x7fd8ea84b279
RSP: 002b:00007fd8e917e168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fd8ea95e120 RCX: 00007fd8ea84b279
RDX: 0000000020000040 RSI: 00000000000089e0 RDI: 0000000000000003
RBP: 00007fd8ea8a5189 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fffed75f79f R14: 00007fd8e917e300 R15: 0000000000022000
device team0 left promiscuous mode
device team_slave_0 left promiscuous mode
device team_slave_1 left promiscuous mode
bridge0: port 3(team0) entered disabled state
8021q: adding VLAN 0 to HW filter on device team0
bond0: Enslaving team0 as an active interface with an up link
bond0: Releasing backup interface team0
bridge0: port 3(team0) entered blocking state
bridge0: port 3(team0) entered disabled state
device team0 entered promiscuous mode
device team_slave_0 entered promiscuous mode
device team_slave_1 entered promiscuous mode
syz-executor.5 (12141) used greatest stack depth: 24520 bytes left
XFS (loop5): Invalid superblock magic number
9pnet: Insufficient options for proto=fd
caif:caif_disconnect_client(): nothing to disconnect
XFS (loop5): Invalid superblock magic number
9pnet: Insufficient options for proto=fd
caif:caif_disconnect_client(): nothing to disconnect
XFS (loop5): Invalid superblock magic number
caif:caif_disconnect_client(): nothing to disconnect
XFS (loop5): Invalid superblock magic number
9pnet: Insufficient options for proto=fd
caif:caif_disconnect_client(): nothing to disconnect
IPVS: Unknown mcast interface: wg1
IPVS: Unknown mcast interface: wg1
audit: type=1800 audit(1661177027.712:6): pid=12447 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.3" name="file0" dev="sda1" ino=14142 res=0
audit: type=1804 audit(1661177027.712:7): pid=12447 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.3" name="/root/syzkaller-testdir2607182192/syzkaller.LIOZyd/127/file0" dev="sda1" ino=14142 res=1
IPVS: Unknown mcast interface: wg1
XFS (loop2): Invalid superblock magic number
audit: type=1800 audit(1661177028.652:8): pid=12531 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.3" name="file0" dev="sda1" ino=14163 res=0
XFS (loop2): Invalid superblock magic number
XFS (loop0): Invalid superblock magic number
print_req_error: I/O error, dev loop2, sector 0
netlink: 44 bytes leftover after parsing attributes in process `syz-executor.5'.
XFS (loop2): Invalid superblock magic number
netlink: 44 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 44 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 44 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 44 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 44 bytes leftover after parsing attributes in process `syz-executor.5'.
audit: type=1800 audit(1661177029.962:9): pid=12654 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.3" name="file0" dev="sda1" ino=14119 res=0
print_req_error: I/O error, dev loop1, sector 0
audit: type=1804 audit(1661177029.972:10): pid=12654 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.3" name="/root/syzkaller-testdir2607182192/syzkaller.LIOZyd/129/file0" dev="sda1" ino=14119 res=1
netlink: 44 bytes leftover after parsing attributes in process `syz-executor.3'.
sd 0:0:1:0: [sg0] tag#7225 FAILED Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK
sd 0:0:1:0: [sg0] tag#7225 CDB: Mode Select(10)
sd 0:0:1:0: [sg0] tag#7225 CDB[00]: 55 7b 05 b2 84 97 90 31 8d 57 78 01 9a 59 5b d6
BTRFS: device fsid e76ed352-74d7-4461-bdaa-670e3acfe92b 
sd 0:0:1:0: [sg0] tag#7225 CDB[10]: 84 5e ed 70 4d 4d 6c e9 f2 09 8c 9f 9a c6 27 58
sd 0:0:1:0: [sg0] tag#7225 CDB[20]: b0 4f 40 63 a1 e6 88 37 5f 89 8b 76 e4 bb ce 66
sd 0:0:1:0: [sg0] tag#7225 CDB[30]: 9c a7 59 a5 08 c4 73 91 46 d4 64 41 68 57 78 ca
sd 0:0:1:0: [sg0] tag#7225 CDB[40]: 55 6d c5 48 4d 09 b7 f8 5a f5 f0 54 d1 19 96 2d
sd 0:0:1:0: [sg0] tag#7225 CDB[50]: 91 ce f6 cf 0b e8 b0 57 31 70 b9 32 7c 12 14 4c
sd 0:0:1:0: [sg0] tag#7225 CDB[60]: c7 d3 6d 8b 56 53 88 97 d4 70
devid 1 transid 7 /dev/loop0
netlink: 44 bytes leftover after parsing attributes in process `syz-executor.3'.
BTRFS error (device loop0): unsupported checksum algorithm 3
BTRFS error (device loop0): superblock checksum mismatch
BTRFS error (device loop0): open_ctree failed
sd 0:0:1:0: [sg0] tag#7220 FAILED Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK
sd 0:0:1:0: [sg0] tag#7220 CDB: Mode Select(10)
sd 0:0:1:0: [sg0] tag#7220 CDB[00]: 55 7b 05 b2 84 97 90 31 8d 57 78 01 9a 59 5b d6
sd 0:0:1:0: [sg0] tag#7220 CDB[10]: 84 5e ed 70 4d 4d 6c e9 f2 09 8c 9f 9a c6 27 58
sd 0:0:1:0: [sg0] tag#7220 CDB[20]: b0 4f 40 63 a1 e6 88 37 5f 89 8b 76 e4 bb ce 66
sd 0:0:1:0: [sg0] tag#7220 CDB[30]: 9c a7 59 a5 08 c4 73 91 46 d4 64 41 68 57 78 ca
sd 0:0:1:0: [sg0] tag#7220 CDB[40]: 55 6d c5 48 4d 09 b7 f8 5a f5 f0 54 d1 19 96 2d
sd 0:0:1:0: [sg0] tag#7220 CDB[50]: 91 ce f6 cf 0b e8 b0 57 31 70 b9 32 7c 12 14 4c
sd 0:0:1:0: [sg0] tag#7220 CDB[60]: c7 d3 6d 8b 56 53 88 97 d4 70
sd 0:0:1:0: [sg0] tag#7220 FAILED Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK
sd 0:0:1:0: [sg0] tag#7220 CDB: Mode Select(10)
sd 0:0:1:0: [sg0] tag#7220 CDB[00]: 55 7b 05 b2 84 97 90 31 8d 57 78 01 9a 59 5b d6
sd 0:0:1:0: [sg0] tag#7220 CDB[10]: 84 5e ed 70 4d 4d 6c e9 f2 09 8c 9f 9a c6 27 58
BTRFS error (device loop0): unsupported checksum algorithm 3
sd 0:0:1:0: [sg0] tag#7220 CDB[20]: b0 4f 40 63 a1 e6 88 37 5f 89 8b 76 e4 bb ce 66
sd 0:0:1:0: [sg0] tag#7220 CDB[30]: 9c a7 59 a5 08 c4 73 91 46 d4 64 41 68 57 78 ca
sd 0:0:1:0: [sg0] tag#7220 CDB[40]: 55 6d c5 48 4d 09 b7 f8 5a f5 f0 54 d1 19 96 2d
sd 0:0:1:0: [sg0] tag#7220 CDB[50]: 91 ce f6 cf 0b e8 b0 57 31 70 b9 32 7c 12 14 4c
sd 0:0:1:0: [sg0] tag#7220 CDB[60]: c7 d3 6d 8b 56 53 88 97 d4 70
BTRFS error (device loop0): superblock checksum mismatch
BTRFS error (device loop0): open_ctree failed
Scheduler tracepoints stat_sleep, stat_iowait, stat_blocked and stat_runtime require the kernel parameter schedstats=enable or kernel.sched_schedstats=1
==================================================================
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 ffff8880b3be8a50 by task syz-executor.1/13372

CPU: 0 PID: 13372 Comm: syz-executor.1 Not tainted 4.14.290-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
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:252
 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load4_noabort+0x68/0x70 mm/kasan/report.c:429
 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+0x46/0xbb
RIP: 0033:0x7f4af9e88279
RSP: 002b:00007f4af87fd168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f4af9f9af80 RCX: 00007f4af9e88279
RDX: 0000000000000040 RSI: 0000000020000280 RDI: 0000000000000004
RBP: 00007f4af9ee2189 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff82bb9aef R14: 00007f4af87fd300 R15: 0000000000022000

Allocated by task 8000:
 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+0x46/0xbb

Freed by task 6183:
 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
 aa_free_task_context+0xda/0x130 security/apparmor/context.c:54
 apparmor_cred_free+0x34/0x70 security/apparmor/lsm.c:58
 security_cred_free+0x71/0xb0 security/security.c:1003
 put_cred_rcu+0xe3/0x300 kernel/cred.c:117
 __put_cred+0x1a1/0x210 kernel/cred.c:151
 put_cred include/linux/cred.h:274 [inline]
 SYSC_faccessat fs/open.c:444 [inline]
 SyS_faccessat+0x52a/0x680 fs/open.c:353
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

The buggy address belongs to the object at ffff8880b3be8a40
 which belongs to the cache kmalloc-32 of size 32
The buggy address is located 16 bytes inside of
 32-byte region [ffff8880b3be8a40, ffff8880b3be8a60)
The buggy address belongs to the page:
page:ffffea0002cefa00 count:1 mapcount:0 mapping:ffff8880b3be8000 index:0xffff8880b3be8fc1
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff8880b3be8000 ffff8880b3be8fc1 000000010000002e
raw: ffffea0002cb6820 ffffea0002a59ee0 ffff88813fe741c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880b3be8900: 00 00 fc fc fc fc fc fc 00 01 fc fc fc fc fc fc
 ffff8880b3be8980: fb fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
>ffff8880b3be8a00: fb fb fb fb fc fc fc fc 00 00 fc fc fc fc fc fc
                                                 ^
 ffff8880b3be8a80: fb fb fb fb fc fc fc fc 07 fc fc fc fc fc fc fc
 ffff8880b3be8b00: 00 00 fc fc fc fc fc fc 00 fc fc fc fc fc fc fc
==================================================================