audit: type=1400 audit(1663678231.125:8): avc: denied { kernel } for pid=3810 comm="syz-executor.4" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=perf_event permissive=1
------------[ cut here ]------------
======================================================
WARNING: possible circular locking dependency detected
6.0.0-rc6-next-20220920 #1 Not tainted
------------------------------------------------------
syz-executor.4/3812 is trying to acquire lock:
ffffffff853faab8 ((console_sem).lock){-...}-{2:2}, at: down_trylock+0xe/0x70
but task is already holding lock:
ffff88803f33a020 (&ctx->lock){-...}-{2:2}, at: event_function+0x182/0x3d0
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #3 (&ctx->lock){-...}-{2:2}:
_raw_spin_lock+0x2a/0x40
__perf_event_task_sched_out+0x53b/0x18d0
__schedule+0xedd/0x2470
schedule+0xda/0x1b0
futex_wait_queue+0xf5/0x1e0
futex_wait+0x28e/0x690
do_futex+0x2ff/0x380
__x64_sys_futex+0x1c6/0x4d0
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x63/0xcd
-> #2 (&rq->__lock){-.-.}-{2:2}:
_raw_spin_lock_nested+0x30/0x40
raw_spin_rq_lock_nested+0x1e/0x30
task_fork_fair+0x63/0x4d0
sched_cgroup_fork+0x3d0/0x540
copy_process+0x4183/0x6e20
kernel_clone+0xe7/0x890
user_mode_thread+0xad/0xf0
rest_init+0x24/0x250
arch_call_rest_init+0xf/0x14
start_kernel+0x4c1/0x4e6
secondary_startup_64_no_verify+0xe0/0xeb
-> #1 (&p->pi_lock){-.-.}-{2:2}:
_raw_spin_lock_irqsave+0x39/0x60
try_to_wake_up+0xab/0x1930
up+0x75/0xb0
__up_console_sem+0x6e/0x80
console_unlock+0x46a/0x590
do_con_write+0xc05/0x1d50
con_write+0x21/0x40
n_tty_write+0x4d4/0xfe0
file_tty_write.constprop.0+0x49c/0x8f0
vfs_write+0x9c3/0xd90
ksys_write+0x127/0x250
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x63/0xcd
-> #0 ((console_sem).lock){-...}-{2:2}:
__lock_acquire+0x2a02/0x5e70
lock_acquire+0x1a2/0x530
_raw_spin_lock_irqsave+0x39/0x60
down_trylock+0xe/0x70
__down_trylock_console_sem+0x3b/0xd0
vprintk_emit+0x16b/0x560
vprintk+0x84/0xa0
_printk+0xba/0xf1
report_bug.cold+0x72/0xab
handle_bug+0x3c/0x70
exc_invalid_op+0x14/0x50
asm_exc_invalid_op+0x16/0x20
perf_group_detach+0x99e/0x12f0
__perf_remove_from_context+0x71e/0xb20
event_function+0x297/0x3d0
remote_function+0x125/0x1b0
__flush_smp_call_function_queue+0x1df/0x5a0
__sysvec_call_function_single+0x92/0x3a0
sysvec_call_function_single+0x89/0xc0
asm_sysvec_call_function_single+0x16/0x20
filter_irq_stacks+0x26/0x90
__stack_depot_save+0x3a/0x4a0
kasan_save_stack+0x31/0x40
kasan_set_track+0x21/0x30
__kasan_slab_alloc+0x58/0x70
kmem_cache_alloc_node+0x1be/0x3e0
alloc_vmap_area+0x170/0x1c90
__get_vm_area_node+0x13c/0x350
__vmalloc_node_range+0x247/0x1400
__vmalloc_node+0xa8/0xf0
n_tty_open+0x16/0x170
tty_ldisc_open+0xa2/0x120
tty_ldisc_setup+0x43/0x100
tty_init_dev.part.0+0x1fa/0x610
tty_open+0xbc0/0x1370
chrdev_open+0x268/0x6e0
do_dentry_open+0x6ca/0x12b0
path_openat+0x19e1/0x2800
do_filp_open+0x1b6/0x410
do_sys_openat2+0x171/0x4c0
__x64_sys_openat+0x13f/0x1f0
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x63/0xcd
other info that might help us debug this:
Chain exists of:
(console_sem).lock --> &rq->__lock --> &ctx->lock
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&ctx->lock);
lock(&rq->__lock);
lock(&ctx->lock);
lock((console_sem).lock);
*** DEADLOCK ***
5 locks held by syz-executor.4/3812:
#0: ffffffff8567c208 (tty_mutex){+.+.}-{3:3}, at: tty_open+0x550/0x1370
#1: ffff888018b841c0 (&tty->legacy_mutex){+.+.}-{3:3}, at: tty_lock+0xbd/0x120
#2: ffff888018b84098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_lock+0x61/0xb0
#3: ffff88806cf3d160 (&cpuctx_lock){-...}-{2:2}, at: event_function+0x16f/0x3d0
#4: ffff88803f33a020 (&ctx->lock){-...}-{2:2}, at: event_function+0x182/0x3d0
stack backtrace:
CPU: 1 PID: 3812 Comm: syz-executor.4 Not tainted 6.0.0-rc6-next-20220920 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014
Call Trace:
dump_stack_lvl+0x8b/0xb3
check_noncircular+0x263/0x2e0
__lock_acquire+0x2a02/0x5e70
lock_acquire+0x1a2/0x530
_raw_spin_lock_irqsave+0x39/0x60
down_trylock+0xe/0x70
__down_trylock_console_sem+0x3b/0xd0
vprintk_emit+0x16b/0x560
vprintk+0x84/0xa0
_printk+0xba/0xf1
report_bug.cold+0x72/0xab
handle_bug+0x3c/0x70
exc_invalid_op+0x14/0x50
asm_exc_invalid_op+0x16/0x20
RIP: 0010:perf_group_detach+0x99e/0x12f0
Code: 85 d5 f8 ff ff e8 a2 59 ee ff 65 44 8b 25 16 b3 aa 7e 31 ff 44 89 e6 e8 40 56 ee ff 45 85 e4 0f 84 0a 05 00 00 e8 82 59 ee ff <0f> 0b e9 a9 f8 ff ff e8 76 59 ee ff 65 8b 1d eb b2 aa 7e 31 ff 89
RSP: 0018:ffff88806cf09e60 EFLAGS: 00010046
RAX: 0000000080010002 RBX: ffff8880187885c8 RCX: 0000000000000000
RDX: ffff88800d160000 RSI: ffffffff8157c2be RDI: 0000000000000005
RBP: ffff8880187885c8 R08: 0000000000000005 R09: 0000000000000001
R10: 0000000000000000 R11: ffffffff865ae05b R12: 0000000000000000
R13: ffff888018788658 R14: ffff88803f33a000 R15: ffff8880187885c8
__perf_remove_from_context+0x71e/0xb20
event_function+0x297/0x3d0
remote_function+0x125/0x1b0
__flush_smp_call_function_queue+0x1df/0x5a0
__sysvec_call_function_single+0x92/0x3a0
sysvec_call_function_single+0x89/0xc0
asm_sysvec_call_function_single+0x16/0x20
RIP: 0010:filter_irq_stacks+0x26/0x90
Code: 51 ff ff ff 41 54 41 89 f4 55 53 48 83 ec 08 85 f6 74 30 48 bd 00 00 00 00 00 fc ff df 31 db 48 89 f8 48 c1 e8 03 80 3c 28 00 <75> 53 48 8b 07 48 3d f0 01 40 84 72 1c 48 3d d0 0e 40 84 73 14 44
RSP: 0018:ffff88801d91f1e8 EFLAGS: 00000246
RAX: 1ffff11003b23e61 RBX: 0000000000000013 RCX: 0000000000000cc0
RDX: 0000000000000000 RSI: 0000000000000015 RDI: ffff88801d91f308
RBP: dffffc0000000000 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000015
R13: 0000000000000001 R14: 0000000000000cc0 R15: ffff88801d91f270
__stack_depot_save+0x3a/0x4a0
kasan_save_stack+0x31/0x40
kasan_set_track+0x21/0x30
__kasan_slab_alloc+0x58/0x70
kmem_cache_alloc_node+0x1be/0x3e0
alloc_vmap_area+0x170/0x1c90
__get_vm_area_node+0x13c/0x350
__vmalloc_node_range+0x247/0x1400
__vmalloc_node+0xa8/0xf0
n_tty_open+0x16/0x170
tty_ldisc_open+0xa2/0x120
tty_ldisc_setup+0x43/0x100
tty_init_dev.part.0+0x1fa/0x610
tty_open+0xbc0/0x1370
chrdev_open+0x268/0x6e0
do_dentry_open+0x6ca/0x12b0
path_openat+0x19e1/0x2800
do_filp_open+0x1b6/0x410
do_sys_openat2+0x171/0x4c0
__x64_sys_openat+0x13f/0x1f0
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fcb5541ca04
Code: 84 00 00 00 00 00 44 89 54 24 0c e8 96 f9 ff ff 44 8b 54 24 0c 44 89 e2 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 34 44 89 c7 89 44 24 0c e8 c8 f9 ff ff 8b 44
RSP: 002b:00007fcb529decc0 EFLAGS: 00000293 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007fcb5557cf60 RCX: 00007fcb5541ca04
RDX: 0000000000000002 RSI: 00007fcb529ded60 RDI: 00000000ffffff9c
RBP: 00007fcb529ded60 R08: 0000000000000000 R09: 000000000000000e
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000002
R13: 00007ffd3bf45e2f R14: 00007fcb529df300 R15: 0000000000022000
WARNING: CPU: 1 PID: 3812 at kernel/events/core.c:2047 perf_group_detach+0x99e/0x12f0
Modules linked in:
CPU: 1 PID: 3812 Comm: syz-executor.4 Not tainted 6.0.0-rc6-next-20220920 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014
RIP: 0010:perf_group_detach+0x99e/0x12f0
Code: 85 d5 f8 ff ff e8 a2 59 ee ff 65 44 8b 25 16 b3 aa 7e 31 ff 44 89 e6 e8 40 56 ee ff 45 85 e4 0f 84 0a 05 00 00 e8 82 59 ee ff <0f> 0b e9 a9 f8 ff ff e8 76 59 ee ff 65 8b 1d eb b2 aa 7e 31 ff 89
RSP: 0018:ffff88806cf09e60 EFLAGS: 00010046
RAX: 0000000080010002 RBX: ffff8880187885c8 RCX: 0000000000000000
RDX: ffff88800d160000 RSI: ffffffff8157c2be RDI: 0000000000000005
RBP: ffff8880187885c8 R08: 0000000000000005 R09: 0000000000000001
R10: 0000000000000000 R11: ffffffff865ae05b R12: 0000000000000000
R13: ffff888018788658 R14: ffff88803f33a000 R15: ffff8880187885c8
FS: 00007fcb529df700(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc825782260 CR3: 000000001ec4e000 CR4: 0000000000350ee0
Call Trace:
__perf_remove_from_context+0x71e/0xb20
event_function+0x297/0x3d0
remote_function+0x125/0x1b0
__flush_smp_call_function_queue+0x1df/0x5a0
__sysvec_call_function_single+0x92/0x3a0
sysvec_call_function_single+0x89/0xc0
asm_sysvec_call_function_single+0x16/0x20
RIP: 0010:filter_irq_stacks+0x26/0x90
Code: 51 ff ff ff 41 54 41 89 f4 55 53 48 83 ec 08 85 f6 74 30 48 bd 00 00 00 00 00 fc ff df 31 db 48 89 f8 48 c1 e8 03 80 3c 28 00 <75> 53 48 8b 07 48 3d f0 01 40 84 72 1c 48 3d d0 0e 40 84 73 14 44
RSP: 0018:ffff88801d91f1e8 EFLAGS: 00000246
RAX: 1ffff11003b23e61 RBX: 0000000000000013 RCX: 0000000000000cc0
RDX: 0000000000000000 RSI: 0000000000000015 RDI: ffff88801d91f308
RBP: dffffc0000000000 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000015
R13: 0000000000000001 R14: 0000000000000cc0 R15: ffff88801d91f270
__stack_depot_save+0x3a/0x4a0
kasan_save_stack+0x31/0x40
kasan_set_track+0x21/0x30
__kasan_slab_alloc+0x58/0x70
kmem_cache_alloc_node+0x1be/0x3e0
alloc_vmap_area+0x170/0x1c90
__get_vm_area_node+0x13c/0x350
__vmalloc_node_range+0x247/0x1400
__vmalloc_node+0xa8/0xf0
n_tty_open+0x16/0x170
tty_ldisc_open+0xa2/0x120
tty_ldisc_setup+0x43/0x100
tty_init_dev.part.0+0x1fa/0x610
tty_open+0xbc0/0x1370
chrdev_open+0x268/0x6e0
do_dentry_open+0x6ca/0x12b0
path_openat+0x19e1/0x2800
do_filp_open+0x1b6/0x410
do_sys_openat2+0x171/0x4c0
__x64_sys_openat+0x13f/0x1f0
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fcb5541ca04
Code: 84 00 00 00 00 00 44 89 54 24 0c e8 96 f9 ff ff 44 8b 54 24 0c 44 89 e2 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 34 44 89 c7 89 44 24 0c e8 c8 f9 ff ff 8b 44
RSP: 002b:00007fcb529decc0 EFLAGS: 00000293 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007fcb5557cf60 RCX: 00007fcb5541ca04
RDX: 0000000000000002 RSI: 00007fcb529ded60 RDI: 00000000ffffff9c
RBP: 00007fcb529ded60 R08: 0000000000000000 R09: 000000000000000e
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000002
R13: 00007ffd3bf45e2f R14: 00007fcb529df300 R15: 0000000000022000
irq event stamp: 2366
hardirqs last enabled at (2365): [] _raw_spin_unlock_irqrestore+0x28/0x60
hardirqs last disabled at (2366): [] sysvec_call_function_single+0xb/0xc0
softirqs last enabled at (2024): [] __irq_exit_rcu+0x11b/0x180
softirqs last disabled at (1913): [] __irq_exit_rcu+0x11b/0x180
---[ end trace 0000000000000000 ]---
sr 1:0:0:0: [sr0] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=0s
sr 1:0:0:0: [sr0] tag#0 Sense Key : Not Ready [current]
sr 1:0:0:0: [sr0] tag#0 Add. Sense: Medium not present
sr 1:0:0:0: [sr0] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
I/O error, dev sr0, sector 0 op 0x0:(READ) flags 0x80700 phys_seg 4 prio class 2
sr 1:0:0:0: [sr0] tag#0 unaligned transfer
I/O error, dev sr0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
Buffer I/O error on dev sr0, logical block 0, async page read
sr 1:0:0:0: [sr0] tag#0 unaligned transfer
I/O error, dev sr0, sector 1 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
Buffer I/O error on dev sr0, logical block 1, async page read
sr 1:0:0:0: [sr0] tag#0 unaligned transfer
I/O error, dev sr0, sector 2 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
Buffer I/O error on dev sr0, logical block 2, async page read
sr 1:0:0:0: [sr0] tag#0 unaligned transfer
I/O error, dev sr0, sector 3 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
Buffer I/O error on dev sr0, logical block 3, async page read
sr 1:0:0:0: [sr0] tag#0 unaligned transfer
I/O error, dev sr0, sector 4 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
Buffer I/O error on dev sr0, logical block 4, async page read
sr 1:0:0:0: [sr0] tag#0 unaligned transfer
I/O error, dev sr0, sector 5 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
Buffer I/O error on dev sr0, logical block 5, async page read
sr 1:0:0:0: [sr0] tag#0 unaligned transfer
I/O error, dev sr0, sector 6 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
Buffer I/O error on dev sr0, logical block 6, async page read
sr 1:0:0:0: [sr0] tag#0 unaligned transfer
I/O error, dev sr0, sector 7 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
Buffer I/O error on dev sr0, logical block 7, async page read
Bluetooth: hci2: unexpected cc 0x0c03 length: 249 > 1
Bluetooth: hci2: unexpected cc 0x1003 length: 249 > 9
Bluetooth: hci2: unexpected cc 0x1001 length: 249 > 9
Bluetooth: hci2: unexpected cc 0x0c23 length: 249 > 4
Bluetooth: hci2: unexpected cc 0x0c25 length: 249 > 3
Bluetooth: hci2: unexpected cc 0x0c38 length: 249 > 2
Bluetooth: hci2: HCI_REQ-0x0c1a
Bluetooth: hci2: command 0x0409 tx timeout
Bluetooth: hci0: Opcode 0x c03 failed: -110
Bluetooth: hci4: Opcode 0x c03 failed: -110
Bluetooth: hci6: Opcode 0x c03 failed: -110
Bluetooth: hci2: command 0x041b tx timeout
----------------
Code disassembly (best guess), 3 bytes skipped:
0: ff 41 54 incl 0x54(%rcx)
3: 41 89 f4 mov %esi,%r12d
6: 55 push %rbp
7: 53 push %rbx
8: 48 83 ec 08 sub $0x8,%rsp
c: 85 f6 test %esi,%esi
e: 74 30 je 0x40
10: 48 bd 00 00 00 00 00 movabs $0xdffffc0000000000,%rbp
17: fc ff df
1a: 31 db xor %ebx,%ebx
1c: 48 89 f8 mov %rdi,%rax
1f: 48 c1 e8 03 shr $0x3,%rax
23: 80 3c 28 00 cmpb $0x0,(%rax,%rbp,1)
* 27: 75 53 jne 0x7c <-- trapping instruction
29: 48 8b 07 mov (%rdi),%rax
2c: 48 3d f0 01 40 84 cmp $0xffffffff844001f0,%rax
32: 72 1c jb 0x50
34: 48 3d d0 0e 40 84 cmp $0xffffffff84400ed0,%rax
3a: 73 14 jae 0x50
3c: 44 rex.R