syzbot


BUG: soft lockup in __perf_sw_event

Status: upstream: reported C repro on 2021/05/04 21:59
Reported-by: syzbot+273e8da41acf6c1d7956@syzkaller.appspotmail.com
First crash: 1297d, last: 756d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-54 BUG: soft lockup in __perf_sw_event (2) C 4 229d 1218d 0/2 auto-obsoleted due to no activity on 2024/07/15 16:35
linux-4.19 INFO: rcu detected stall in __perf_sw_event (2) C error 133 630d 1767d 0/1 upstream: reported C repro on 2020/01/20 09:59
android-54 BUG: soft lockup in __perf_sw_event 2 1424d 1437d 0/2 auto-closed as invalid on 2021/04/27 17:47
upstream INFO: rcu detected stall in __perf_sw_event perf syz done error 99 1295d 2114d 0/28 auto-obsoleted due to no activity on 2023/01/16 15:10

Sample crash report:
watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [syz-executor700:23334]
Modules linked in:
irq event stamp: 22194
hardirqs last  enabled at (22193): [<ffffffff87400976>] restore_regs_and_return_to_kernel+0x0/0x2a
hardirqs last disabled at (22194): [<ffffffff874018ae>] apic_timer_interrupt+0x8e/0xa0 arch/x86/entry/entry_64.S:793 arch/x86/entry/entry_64.S:793
softirqs last  enabled at (18012): [<ffffffff8760068b>] __do_softirq+0x68b/0x9ff kernel/softirq.c:314 kernel/softirq.c:314
softirqs last disabled at (17971): [<ffffffff81321d13>] invoke_softirq kernel/softirq.c:368 [inline]
softirqs last disabled at (17971): [<ffffffff81321d13>] invoke_softirq kernel/softirq.c:368 [inline] kernel/softirq.c:409
softirqs last disabled at (17971): [<ffffffff81321d13>] irq_exit+0x193/0x240 kernel/softirq.c:409 kernel/softirq.c:409
CPU: 0 PID: 23334 Comm: syz-executor700 Not tainted 4.14.258-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
task: ffff888097bb6340 task.stack: ffff88809bbd8000
RIP: 0010:memcpy+0xc/0x50 mm/kasan/kasan.c:301 mm/kasan/kasan.c:301
RSP: 0018:ffff88809bbdf278 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff10
RAX: ffffed101377bea8 RBX: 0000000000000000 RCX: 0000000000000001
RDX: 0000000000000000 RSI: ffff88809bbdf360 RDI: ffff8880a1eafcf8
RBP: ffff88809bbdf360 R08: ffff88823fff7018 R09: ffff88823fff700f
R10: ffff88823fff7017 R11: 0000010163cfb707 R12: 0000000000000008
R13: ffff88809bbdf360 R14: ffff88809bbdf528 R15: 0000000000000008
FS:  00007f56fb176700(0000) GS:ffff8880ba400000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020e37000 CR3: 00000000ab0bd000 CR4: 00000000003406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 memcpy include/linux/string.h:376 [inline]
 memcpy_common kernel/events/internal.h:172 [inline]
 __output_copy kernel/events/internal.h:176 [inline]
 perf_output_read_group kernel/events/core.c:5899 [inline]
 memcpy include/linux/string.h:376 [inline] kernel/events/core.c:5932
 memcpy_common kernel/events/internal.h:172 [inline] kernel/events/core.c:5932
 __output_copy kernel/events/internal.h:176 [inline] kernel/events/core.c:5932
 perf_output_read_group kernel/events/core.c:5899 [inline] kernel/events/core.c:5932
 perf_output_read+0x6c9/0x1090 kernel/events/core.c:5932 kernel/events/core.c:5932
 perf_output_sample+0xa28/0x16f0 kernel/events/core.c:5974 kernel/events/core.c:5974
 __perf_event_output kernel/events/core.c:6287 [inline]
 __perf_event_output kernel/events/core.c:6287 [inline] kernel/events/core.c:6300
 perf_event_output_forward+0xf8/0x1f0 kernel/events/core.c:6300 kernel/events/core.c:6300
 __perf_event_overflow+0x113/0x310 kernel/events/core.c:7549 kernel/events/core.c:7549
 perf_swevent_overflow kernel/events/core.c:7625 [inline]
 perf_swevent_overflow kernel/events/core.c:7625 [inline] kernel/events/core.c:7653
 perf_swevent_event+0x299/0x460 kernel/events/core.c:7653 kernel/events/core.c:7653
 do_perf_sw_event kernel/events/core.c:7766 [inline]
 do_perf_sw_event kernel/events/core.c:7766 [inline] kernel/events/core.c:7797
 ___perf_sw_event+0x2a1/0x480 kernel/events/core.c:7797 kernel/events/core.c:7797
 __perf_sw_event+0x4f/0x100 kernel/events/core.c:7809 kernel/events/core.c:7809
 perf_sw_event include/linux/perf_event.h:1046 [inline]
 perf_sw_event include/linux/perf_event.h:1046 [inline] arch/x86/mm/fault.c:1483
 __do_page_fault+0x692/0xad0 arch/x86/mm/fault.c:1483 arch/x86/mm/fault.c:1483
 page_fault+0x25/0x50 arch/x86/entry/entry_64.S:1123 arch/x86/entry/entry_64.S:1123
RIP: 0010:copy_user_enhanced_fast_string+0xe/0x20 arch/x86/lib/copy_user_64.S:181 arch/x86/lib/copy_user_64.S:181
RSP: 0018:ffff88809bbdfa60 EFLAGS: 00050206
RAX: ffffed1011eea000 RBX: 0000000000008000 RCX: 0000000000006acb
RDX: 0000000000008000 RSI: 0000000020e37000 RDI: ffff88808f749535
RBP: 0000000020e35acb R08: 0000000000000001 R09: ffffed1011ee9fff
R10: ffff88808f74ffff R11: 0000000000000000 R12: ffff88808f748000
R13: 00007ffffffff000 R14: 0000000020e3dacb R15: ffff8880b17b4540
 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline]
 raw_copy_from_user arch/x86/include/asm/uaccess_64.h:55 [inline]
 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] lib/iov_iter.c:146
 raw_copy_from_user arch/x86/include/asm/uaccess_64.h:55 [inline] lib/iov_iter.c:146
 copyin+0x99/0xc0 lib/iov_iter.c:146 lib/iov_iter.c:146
 _copy_from_iter_full+0x19c/0x760 lib/iov_iter.c:608 lib/iov_iter.c:608
 copy_from_iter_full include/linux/uio.h:126 [inline]
 skb_do_copy_data_nocache include/net/sock.h:1892 [inline]
 skb_copy_to_page_nocache include/net/sock.h:1918 [inline]
 copy_from_iter_full include/linux/uio.h:126 [inline] net/ipv4/tcp.c:1360
 skb_do_copy_data_nocache include/net/sock.h:1892 [inline] net/ipv4/tcp.c:1360
 skb_copy_to_page_nocache include/net/sock.h:1918 [inline] net/ipv4/tcp.c:1360
 tcp_sendmsg_locked+0x23fc/0x2ef0 net/ipv4/tcp.c:1360 net/ipv4/tcp.c:1360
 tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1457 net/ipv4/tcp.c:1457
 inet_sendmsg+0x11a/0x4e0 net/ipv4/af_inet.c:762 net/ipv4/af_inet.c:762
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg_nosec net/socket.c:646 [inline] net/socket.c:656
 sock_sendmsg+0xb5/0x100 net/socket.c:656 net/socket.c:656
 SYSC_sendto net/socket.c:1763 [inline]
 SYSC_sendto net/socket.c:1763 [inline] net/socket.c:1731
 SyS_sendto+0x1c7/0x2c0 net/socket.c:1731 net/socket.c:1731
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x7f56fb1c9529
RSP: 002b:00007f56fb176308 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 00007f56fb2534e8 RCX: 00007f56fb1c9529
RDX: ffffffffffffffef RSI: 0000000020d7cfcb RDI: 0000000000000006
RBP: 00007f56fb2534e0 R08: 0000000000000000 R09: 0000000000000053
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f56fb21f664
R13: 00007ffd92bd4eff R14: 00007f56fb176400 R15: 0000000000022000
Code: 1b fa ff ff 4c 89 e2 4c 89 ee 48 89 ef 5d 41 5c 41 5d e9 28 c2 81 05 0f 1f 84 00 00 00 00 00 41 55 49 89 f5 41 54 49 89 d4 31 d2 <55> 48 8b 4c 24 18 48 89 fd 4c 89 e6 4c 89 ef e8 e0 f9 ff ff 48 
----------------
Code disassembly (best guess), 3 bytes skipped:
   0:	ff 4c 89 e2          	decl   -0x1e(%rcx,%rcx,4)
   4:	4c 89 ee             	mov    %r13,%rsi
   7:	48 89 ef             	mov    %rbp,%rdi
   a:	5d                   	pop    %rbp
   b:	41 5c                	pop    %r12
   d:	41 5d                	pop    %r13
   f:	e9 28 c2 81 05       	jmpq   0x581c23c
  14:	0f 1f 84 00 00 00 00 	nopl   0x0(%rax,%rax,1)
  1b:	00
  1c:	41 55                	push   %r13
  1e:	49 89 f5             	mov    %rsi,%r13
  21:	41 54                	push   %r12
  23:	49 89 d4             	mov    %rdx,%r12
  26:	31 d2                	xor    %edx,%edx
* 28:	55                   	push   %rbp <-- trapping instruction
  29:	48 8b 4c 24 18       	mov    0x18(%rsp),%rcx
  2e:	48 89 fd             	mov    %rdi,%rbp
  31:	4c 89 e6             	mov    %r12,%rsi
  34:	4c 89 ef             	mov    %r13,%rdi
  37:	e8 e0 f9 ff ff       	callq  0xfffffa1c
  3c:	48                   	rex.W
----------------
Code disassembly (best guess), 3 bytes skipped:
   0:	ff 4c 89 e2          	decl   -0x1e(%rcx,%rcx,4)
   4:	4c 89 ee             	mov    %r13,%rsi
   7:	48 89 ef             	mov    %rbp,%rdi
   a:	5d                   	pop    %rbp
   b:	41 5c                	pop    %r12
   d:	41 5d                	pop    %r13
   f:	e9 28 c2 81 05       	jmpq   0x581c23c
  14:	0f 1f 84 00 00 00 00 	nopl   0x0(%rax,%rax,1)
  1b:	00
  1c:	41 55                	push   %r13
  1e:	49 89 f5             	mov    %rsi,%r13
  21:	41 54                	push   %r12
  23:	49 89 d4             	mov    %rdx,%r12
  26:	31 d2                	xor    %edx,%edx
* 28:	55                   	push   %rbp <-- trapping instruction
  29:	48 8b 4c 24 18       	mov    0x18(%rsp),%rcx
  2e:	48 89 fd             	mov    %rdi,%rbp
  31:	4c 89 e6             	mov    %r12,%rsi
  34:	4c 89 ef             	mov    %r13,%rdi
  37:	e8 e0 f9 ff ff       	callq  0xfffffa1c
  3c:	48                   	rex.W

Crashes (9):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/12/21 06:12 linux-4.14.y 9dfbac0e6b86 62bd192b .config console log report syz C ci2-linux-4-14 BUG: soft lockup in __perf_sw_event
2021/05/04 21:59 linux-4.14.y 7d7d1c0ab3eb 06c27ff5 .config console log report syz ci2-linux-4-14 BUG: soft lockup in __perf_sw_event
2022/10/28 01:37 linux-4.14.y 41f36d7859a7 5c716ff6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 BUG: soft lockup in __perf_sw_event
2022/10/08 10:09 linux-4.14.y 9d5c0b3a8e1a aea5da89 .config console log report info [disk image] [vmlinux] ci2-linux-4-14 BUG: soft lockup in __perf_sw_event
2022/07/22 13:51 linux-4.14.y 9c3bf9cf362f 22343af4 .config console log report info ci2-linux-4-14 BUG: soft lockup in __perf_sw_event
2022/06/15 15:18 linux-4.14.y 1ccc597f801c 1719ee24 .config console log report info ci2-linux-4-14 BUG: soft lockup in __perf_sw_event
2022/05/30 18:07 linux-4.14.y 501eec4f9e13 af70c3a9 .config console log report info ci2-linux-4-14 BUG: soft lockup in __perf_sw_event
2022/04/30 10:30 linux-4.14.y e3a56aaade89 2df221f6 .config console log report info ci2-linux-4-14 BUG: soft lockup in __perf_sw_event
2021/12/20 20:22 linux-4.14.y 9dfbac0e6b86 62bd192b .config console log report info ci2-linux-4-14 BUG: soft lockup in __perf_sw_event
* Struck through repros no longer work on HEAD.