linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [syzbot] [bpf?] [trace?] possible deadlock in force_sig_info_to_task
@ 2024-04-25  9:05 syzbot
  2024-04-25 17:54 ` Jiri Olsa
  2024-04-27 20:00 ` syzbot
  0 siblings, 2 replies; 3+ messages in thread
From: syzbot @ 2024-04-25  9:05 UTC (permalink / raw)
  To: andrii, ast, bpf, daniel, eddyz87, haoluo, john.fastabend, jolsa,
	kpsingh, linux-kernel, linux-trace-kernel, martin.lau,
	mathieu.desnoyers, mhiramat, rostedt, sdf, song, syzkaller-bugs,
	yonghong.song

Hello,

syzbot found the following issue on:

HEAD commit:    977b1ef51866 Merge tag 'block-6.9-20240420' of git://git.k..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=17080d20980000
kernel config:  https://syzkaller.appspot.com/x/.config?x=f47e5e015c177e57
dashboard link: https://syzkaller.appspot.com/bug?extid=83e7f982ca045ab4405c
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/549d1add1da9/disk-977b1ef5.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/3e8e501c8aa2/vmlinux-977b1ef5.xz
kernel image: https://storage.googleapis.com/syzbot-assets/d02f7cb905b8/bzImage-977b1ef5.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+83e7f982ca045ab4405c@syzkaller.appspotmail.com

======================================================
WARNING: possible circular locking dependency detected
6.9.0-rc4-syzkaller-00266-g977b1ef51866 #0 Not tainted
------------------------------------------------------
syz-executor.0/11241 is trying to acquire lock:
ffff888020a2c0d8 (&sighand->siglock){-.-.}-{2:2}, at: force_sig_info_to_task+0x68/0x580 kernel/signal.c:1334

but task is already holding lock:
ffff8880b943e658 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:559

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&rq->__lock){-.-.}-{2:2}:
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
       _raw_spin_lock_nested+0x31/0x40 kernel/locking/spinlock.c:378
       raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:559
       raw_spin_rq_lock kernel/sched/sched.h:1385 [inline]
       _raw_spin_rq_lock_irqsave kernel/sched/sched.h:1404 [inline]
       rq_lock_irqsave kernel/sched/sched.h:1683 [inline]
       class_rq_lock_irqsave_constructor kernel/sched/sched.h:1737 [inline]
       sched_mm_cid_exit_signals+0x17b/0x4b0 kernel/sched/core.c:12005
       exit_signals+0x2a1/0x5c0 kernel/signal.c:3016
       do_exit+0x6a8/0x27e0 kernel/exit.c:837
       __do_sys_exit kernel/exit.c:994 [inline]
       __se_sys_exit kernel/exit.c:992 [inline]
       __pfx___ia32_sys_exit+0x0/0x10 kernel/exit.c:992
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (&sighand->siglock){-.-.}-{2:2}:
       check_prev_add kernel/locking/lockdep.c:3134 [inline]
       check_prevs_add kernel/locking/lockdep.c:3253 [inline]
       validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869
       __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
       force_sig_info_to_task+0x68/0x580 kernel/signal.c:1334
       force_sig_fault_to_task kernel/signal.c:1733 [inline]
       force_sig_fault+0x12c/0x1d0 kernel/signal.c:1738
       __bad_area_nosemaphore+0x127/0x780 arch/x86/mm/fault.c:814
       handle_page_fault arch/x86/mm/fault.c:1505 [inline]
       exc_page_fault+0x612/0x8e0 arch/x86/mm/fault.c:1563
       asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
       strncpy_from_user+0x2c6/0x2f0 lib/strncpy_from_user.c:138
       strncpy_from_user_nofault+0x71/0x140 mm/maccess.c:186
       bpf_probe_read_user_str_common kernel/trace/bpf_trace.c:216 [inline]
       ____bpf_probe_read_compat_str kernel/trace/bpf_trace.c:311 [inline]
       bpf_probe_read_compat_str+0xe9/0x180 kernel/trace/bpf_trace.c:307
       bpf_prog_e42f6260c1b72fb3+0x3d/0x3f
       bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline]
       __bpf_prog_run include/linux/filter.h:657 [inline]
       bpf_prog_run include/linux/filter.h:664 [inline]
       __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline]
       bpf_trace_run4+0x25a/0x490 kernel/trace/bpf_trace.c:2422
       __traceiter_sched_switch+0x98/0xd0 include/trace/events/sched.h:222
       trace_sched_switch include/trace/events/sched.h:222 [inline]
       __schedule+0x2535/0x4a00 kernel/sched/core.c:6743
       preempt_schedule_irq+0xfb/0x1c0 kernel/sched/core.c:7068
       irqentry_exit+0x5e/0x90 kernel/entry/common.c:354
       asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
       force_sig_fault+0x0/0x1d0
       __bad_area_nosemaphore+0x127/0x780 arch/x86/mm/fault.c:814
       handle_page_fault arch/x86/mm/fault.c:1505 [inline]
       exc_page_fault+0x612/0x8e0 arch/x86/mm/fault.c:1563
       asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
       __put_user_handle_exception+0x0/0x10
       __do_sys_gettimeofday kernel/time/time.c:147 [inline]
       __se_sys_gettimeofday+0xd9/0x240 kernel/time/time.c:140
       emulate_vsyscall+0xe23/0x1290 arch/x86/entry/vsyscall/vsyscall_64.c:247
       do_user_addr_fault arch/x86/mm/fault.c:1346 [inline]
       handle_page_fault arch/x86/mm/fault.c:1505 [inline]
       exc_page_fault+0x160/0x8e0 arch/x86/mm/fault.c:1563
       asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
       _end+0x6a9da000/0x0

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&rq->__lock);
                               lock(&sighand->siglock);
                               lock(&rq->__lock);
  lock(&sighand->siglock);

 *** DEADLOCK ***

2 locks held by syz-executor.0/11241:
 #0: ffff8880b943e658 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:559
 #1: ffffffff8e334d20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
 #1: ffffffff8e334d20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
 #1: ffffffff8e334d20 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2380 [inline]
 #1: ffffffff8e334d20 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run4+0x16e/0x490 kernel/trace/bpf_trace.c:2422

stack backtrace:
CPU: 0 PID: 11241 Comm: syz-executor.0 Not tainted 6.9.0-rc4-syzkaller-00266-g977b1ef51866 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2187
 check_prev_add kernel/locking/lockdep.c:3134 [inline]
 check_prevs_add kernel/locking/lockdep.c:3253 [inline]
 validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869
 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
 force_sig_info_to_task+0x68/0x580 kernel/signal.c:1334
 force_sig_fault_to_task kernel/signal.c:1733 [inline]
 force_sig_fault+0x12c/0x1d0 kernel/signal.c:1738
 __bad_area_nosemaphore+0x127/0x780 arch/x86/mm/fault.c:814
 handle_page_fault arch/x86/mm/fault.c:1505 [inline]
 exc_page_fault+0x612/0x8e0 arch/x86/mm/fault.c:1563
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0010:do_strncpy_from_user lib/strncpy_from_user.c:72 [inline]
RIP: 0010:strncpy_from_user+0x2c6/0x2f0 lib/strncpy_from_user.c:139
Code: cc cc cc cc e8 ab 95 b6 fc 45 31 ed eb e0 e8 a1 95 b6 fc 49 c7 c5 f2 ff ff ff eb d2 e8 93 95 b6 fc 49 c7 c5 f2 ff ff ff eb c4 <f3> 0f 1e fa e8 81 95 b6 fc eb a1 f3 0f 1e fa e8 76 95 b6 fc 4d 29
RSP: 0018:ffffc90009f9f5e0 EFLAGS: 00050046
RAX: 0000000000000002 RBX: ffff8880795c3584 RCX: ffff8880795c1e00
RDX: ffffc90004bf1000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: 0000000000000001 R08: ffffffff84df6a34 R09: ffffffff82056cb7
R10: 0000000000000003 R11: ffff8880795c1e00 R12: 0000000000000000
R13: 0000000000000000 R14: ffffc90009f9f6a8 R15: 0000000000000000
 strncpy_from_user_nofault+0x71/0x140 mm/maccess.c:186
 bpf_probe_read_user_str_common kernel/trace/bpf_trace.c:216 [inline]
 ____bpf_probe_read_compat_str kernel/trace/bpf_trace.c:311 [inline]
 bpf_probe_read_compat_str+0xe9/0x180 kernel/trace/bpf_trace.c:307
 bpf_prog_e42f6260c1b72fb3+0x3d/0x3f
 bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline]
 __bpf_prog_run include/linux/filter.h:657 [inline]
 bpf_prog_run include/linux/filter.h:664 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline]
 bpf_trace_run4+0x25a/0x490 kernel/trace/bpf_trace.c:2422
 __traceiter_sched_switch+0x98/0xd0 include/trace/events/sched.h:222
 trace_sched_switch include/trace/events/sched.h:222 [inline]
 __schedule+0x2535/0x4a00 kernel/sched/core.c:6743
 preempt_schedule_irq+0xfb/0x1c0 kernel/sched/core.c:7068
 irqentry_exit+0x5e/0x90 kernel/entry/common.c:354
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:force_sig_fault+0x0/0x1d0 kernel/signal.c:1737
Code: 9a 00 e9 31 ff ff ff e8 1e 7e 1a 0a 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 <f3> 0f 1e fa 55 48 89 e5 41 57 41 56 41 55 41 54 53 48 83 e4 e0 48
RSP: 0018:ffffc90009f9fb78 EFLAGS: 00000286
RAX: ffffffff8141f9d7 RBX: 0000000000000000 RCX: 0000000000040000
RDX: 0000000000000019 RSI: 0000000000000001 RDI: 000000000000000b
RBP: ffffc90009f9fc78 R08: ffffffff8141f976 R09: ffffffff81423712
R10: 0000000000000014 R11: ffff8880795c1e00 R12: dffffc0000000000
R13: ffffc90009f9fd70 R14: 1ffff920013f3fae R15: 0000000000000002
 __bad_area_nosemaphore+0x127/0x780 arch/x86/mm/fault.c:814
 handle_page_fault arch/x86/mm/fault.c:1505 [inline]
 exc_page_fault+0x612/0x8e0 arch/x86/mm/fault.c:1563
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0010:__put_user_handle_exception+0x0/0x10 arch/x86/lib/putuser.S:125
Code: 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 0f 01 cb 48 89 01 31 c9 0f 01 ca c3 cc cc cc cc 66 2e 0f 1f 84 00 00 00 00 00 66 90 <0f> 01 ca b9 f2 ff ff ff c3 cc cc cc cc 0f 1f 00 90 90 90 90 90 90
RSP: 0018:ffffc90009f9fd98 EFLAGS: 00050202
RAX: 000000006624d6a7 RBX: 0000000000000000 RCX: 0000000000000019
RDX: 0000000000000000 RSI: ffffffff8bcaca20 RDI: ffffffff8c1eb160
RBP: ffffc90009f9fe50 R08: ffffffff8fa7b6af R09: 1ffffffff1f4f6d5
R10: dffffc0000000000 R11: fffffbfff1f4f6d6 R12: ffffc90009f9fde0
R13: dffffc0000000000 R14: 1ffff920013f3fb8 R15: 0000000000000019
 __do_sys_gettimeofday kernel/time/time.c:147 [inline]
 __se_sys_gettimeofday+0xd9/0x240 kernel/time/time.c:140
 emulate_vsyscall+0xe23/0x1290 arch/x86/entry/vsyscall/vsyscall_64.c:247
 do_user_addr_fault arch/x86/mm/fault.c:1346 [inline]
 handle_page_fault arch/x86/mm/fault.c:1505 [inline]
 exc_page_fault+0x160/0x8e0 arch/x86/mm/fault.c:1563
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0033:_end+0x6a9da000/0x0
Code: Unable to access opcode bytes at 0xffffffffff5fffd6.
RSP: 002b:00007f9364a35b38 EFLAGS: 00010246
RAX: ffffffffffffffda RBX: 00007f9363dabf80 RCX: 00007f9363c7dea9
RDX: 00007f9364a35b40 RSI: 00007f9364a35c70 RDI: 0000000000000019
RBP: 00007f9363cca4a4 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000007 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f9363dabf80 R15: 00007ffc4b734e88
 </TASK>
----------------
Code disassembly (best guess):
   0:	cc                   	int3
   1:	cc                   	int3
   2:	cc                   	int3
   3:	cc                   	int3
   4:	e8 ab 95 b6 fc       	call   0xfcb695b4
   9:	45 31 ed             	xor    %r13d,%r13d
   c:	eb e0                	jmp    0xffffffee
   e:	e8 a1 95 b6 fc       	call   0xfcb695b4
  13:	49 c7 c5 f2 ff ff ff 	mov    $0xfffffffffffffff2,%r13
  1a:	eb d2                	jmp    0xffffffee
  1c:	e8 93 95 b6 fc       	call   0xfcb695b4
  21:	49 c7 c5 f2 ff ff ff 	mov    $0xfffffffffffffff2,%r13
  28:	eb c4                	jmp    0xffffffee
* 2a:	f3 0f 1e fa          	endbr64 <-- trapping instruction
  2e:	e8 81 95 b6 fc       	call   0xfcb695b4
  33:	eb a1                	jmp    0xffffffd6
  35:	f3 0f 1e fa          	endbr64
  39:	e8 76 95 b6 fc       	call   0xfcb695b4
  3e:	4d                   	rex.WRB
  3f:	29                   	.byte 0x29


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [syzbot] [bpf?] [trace?] possible deadlock in force_sig_info_to_task
  2024-04-25  9:05 [syzbot] [bpf?] [trace?] possible deadlock in force_sig_info_to_task syzbot
@ 2024-04-25 17:54 ` Jiri Olsa
  2024-04-27 20:00 ` syzbot
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Olsa @ 2024-04-25 17:54 UTC (permalink / raw)
  To: syzbot
  Cc: andrii, ast, bpf, daniel, eddyz87, haoluo, john.fastabend,
	kpsingh, linux-kernel, linux-trace-kernel, martin.lau,
	mathieu.desnoyers, mhiramat, rostedt, sdf, song, syzkaller-bugs,
	yonghong.song

On Thu, Apr 25, 2024 at 02:05:31AM -0700, syzbot wrote:
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    977b1ef51866 Merge tag 'block-6.9-20240420' of git://git.k..
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=17080d20980000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=f47e5e015c177e57
> dashboard link: https://syzkaller.appspot.com/bug?extid=83e7f982ca045ab4405c
> compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
> 
> Unfortunately, I don't have any reproducer for this issue yet.
> 
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/549d1add1da9/disk-977b1ef5.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/3e8e501c8aa2/vmlinux-977b1ef5.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/d02f7cb905b8/bzImage-977b1ef5.xz
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+83e7f982ca045ab4405c@syzkaller.appspotmail.com
> 
> ======================================================
> WARNING: possible circular locking dependency detected
> 6.9.0-rc4-syzkaller-00266-g977b1ef51866 #0 Not tainted
> ------------------------------------------------------
> syz-executor.0/11241 is trying to acquire lock:
> ffff888020a2c0d8 (&sighand->siglock){-.-.}-{2:2}, at: force_sig_info_to_task+0x68/0x580 kernel/signal.c:1334
> 
> but task is already holding lock:
> ffff8880b943e658 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:559
> 
> which lock already depends on the new lock.
> 
> 
> the existing dependency chain (in reverse order) is:
> 
> -> #1 (&rq->__lock){-.-.}-{2:2}:
>        lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
>        _raw_spin_lock_nested+0x31/0x40 kernel/locking/spinlock.c:378
>        raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:559
>        raw_spin_rq_lock kernel/sched/sched.h:1385 [inline]
>        _raw_spin_rq_lock_irqsave kernel/sched/sched.h:1404 [inline]
>        rq_lock_irqsave kernel/sched/sched.h:1683 [inline]
>        class_rq_lock_irqsave_constructor kernel/sched/sched.h:1737 [inline]
>        sched_mm_cid_exit_signals+0x17b/0x4b0 kernel/sched/core.c:12005
>        exit_signals+0x2a1/0x5c0 kernel/signal.c:3016
>        do_exit+0x6a8/0x27e0 kernel/exit.c:837
>        __do_sys_exit kernel/exit.c:994 [inline]
>        __se_sys_exit kernel/exit.c:992 [inline]
>        __pfx___ia32_sys_exit+0x0/0x10 kernel/exit.c:992
>        do_syscall_x64 arch/x86/entry/common.c:52 [inline]
>        do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
>        entry_SYSCALL_64_after_hwframe+0x77/0x7f
> 
> -> #0 (&sighand->siglock){-.-.}-{2:2}:
>        check_prev_add kernel/locking/lockdep.c:3134 [inline]
>        check_prevs_add kernel/locking/lockdep.c:3253 [inline]
>        validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869
>        __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
>        lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
>        __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
>        _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
>        force_sig_info_to_task+0x68/0x580 kernel/signal.c:1334
>        force_sig_fault_to_task kernel/signal.c:1733 [inline]
>        force_sig_fault+0x12c/0x1d0 kernel/signal.c:1738
>        __bad_area_nosemaphore+0x127/0x780 arch/x86/mm/fault.c:814
>        handle_page_fault arch/x86/mm/fault.c:1505 [inline]
>        exc_page_fault+0x612/0x8e0 arch/x86/mm/fault.c:1563
>        asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
>        strncpy_from_user+0x2c6/0x2f0 lib/strncpy_from_user.c:138
>        strncpy_from_user_nofault+0x71/0x140 mm/maccess.c:186
>        bpf_probe_read_user_str_common kernel/trace/bpf_trace.c:216 [inline]
>        ____bpf_probe_read_compat_str kernel/trace/bpf_trace.c:311 [inline]
>        bpf_probe_read_compat_str+0xe9/0x180 kernel/trace/bpf_trace.c:307
>        bpf_prog_e42f6260c1b72fb3+0x3d/0x3f
>        bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline]
>        __bpf_prog_run include/linux/filter.h:657 [inline]
>        bpf_prog_run include/linux/filter.h:664 [inline]
>        __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline]
>        bpf_trace_run4+0x25a/0x490 kernel/trace/bpf_trace.c:2422
>        __traceiter_sched_switch+0x98/0xd0 include/trace/events/sched.h:222
>        trace_sched_switch include/trace/events/sched.h:222 [inline]
>        __schedule+0x2535/0x4a00 kernel/sched/core.c:6743
>        preempt_schedule_irq+0xfb/0x1c0 kernel/sched/core.c:7068
>        irqentry_exit+0x5e/0x90 kernel/entry/common.c:354
>        asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
>        force_sig_fault+0x0/0x1d0
>        __bad_area_nosemaphore+0x127/0x780 arch/x86/mm/fault.c:814
>        handle_page_fault arch/x86/mm/fault.c:1505 [inline]
>        exc_page_fault+0x612/0x8e0 arch/x86/mm/fault.c:1563
>        asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
>        __put_user_handle_exception+0x0/0x10
>        __do_sys_gettimeofday kernel/time/time.c:147 [inline]
>        __se_sys_gettimeofday+0xd9/0x240 kernel/time/time.c:140
>        emulate_vsyscall+0xe23/0x1290 arch/x86/entry/vsyscall/vsyscall_64.c:247
>        do_user_addr_fault arch/x86/mm/fault.c:1346 [inline]
>        handle_page_fault arch/x86/mm/fault.c:1505 [inline]
>        exc_page_fault+0x160/0x8e0 arch/x86/mm/fault.c:1563
>        asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
>        _end+0x6a9da000/0x0
> 

I tried and I can reproduce similar splat below, but no clue yet ;-)
I wonder the current->thread.sig_on_uaccess_err flag might affect the
second bpf fault behaviour

jirka


---
[  315.747916] [ BUG: Invalid wait context ]
[  315.748511] 6.9.0-rc1+ #60 Tainted: G           OE
[  315.749227] -----------------------------
[  315.749820] test_progs/1263 is trying to lock:
[  315.750463][ T1263] ffff888109f06f58 (&sighand->siglock){....}-{3:3}, at: force_sig_info_to_task+0x25/0x140
[  315.751630][ T1263] other info that might help us debug this:
[  315.752337][ T1263] context-{5:5}
[  315.752796][ T1263] 2 locks held by test_progs/1263:
[  315.753426][ T1263]  #0: ffff88846d808918 (&rq->__lock){-.-.}-{2:2}, at: __schedule+0x11b/0x1040
[  315.754531][ T1263]  #1: ffffffff839a3700 (rcu_read_lock){....}-{1:3}, at: trace_call_bpf+0x6d/0x4a0
[  315.755630][ T1263] stack backtrace: 
[  315.756133][ T1263] CPU: 2 PID: 1263 Comm: test_progs Tainted: G           OE      6.9.0-rc1+ #60 e3139236695c37204e0f43029c0efe69ab334496
[  315.757607][ T1263] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-1.fc38 04/01/2014
[  315.758741][ T1263] Call Trace:
[  315.759208][ T1263]  <TASK>
[  315.759631][ T1263]  dump_stack_lvl+0x133/0x150
[  315.760252][ T1263]  __lock_acquire+0x98a/0x2420
[  315.760876][ T1263]  ? ring_buffer_lock_reserve+0x126/0x410
[  315.761623][ T1263]  lock_acquire+0x105/0x380
[  315.762216][ T1263]  ? force_sig_info_to_task+0x25/0x140
[  315.762892][ T1263]  ? kernelmode_fixup_or_oops+0x42/0x170
[  315.763577][ T1263]  ? trace_vbprintk+0x173/0x260
[  315.764191][ T1263]  _raw_spin_lock_irqsave+0x69/0xc0
[  315.764842][ T1263]  ? force_sig_info_to_task+0x25/0x140
[  315.765519][ T1263]  force_sig_info_to_task+0x25/0x140
[  315.766182][ T1263]  force_sig_fault+0x5a/0x80
[  315.766767][ T1263]  exc_page_fault+0x82/0x2a0
[  315.767382][ T1263]  asm_exc_page_fault+0x22/0x30
[  315.768018][ T1263] RIP: 0010:strncpy_from_user+0xe5/0x140 
[  315.768713][ T1263] Code: d8 48 89 44 15 00 48 b8 08 06 05 04 03 02 01 00 48 0f af d8 48 c1 eb 38 48 8d 04 13 0f 01 ca 5b 5d 41 5c 41 5d c3 cc cc cc cc <48> 85 db 74 20 48 01 d3 eb 09 48 83 c2 01 48 39 da 74 15 41 8a 44
[  315.770996][ T1263] RSP: 0000:ffffc90001947a40 EFLAGS: 00050002 
[  315.771780][ T1263] RAX: 0000000000000001 RBX: 0000000000000008 RCX: 0000000000000004
[  315.772834][ T1263] RDX: 0000000000000000 RSI: 8080808080808080 RDI: ffffc90001947aa8
[  315.773880][ T1263] RBP: ffffc90001947aa8 R08: fefefefefefefeff R09: 0000000000008a47
[  315.774965][ T1263] R10: 0000000000000011 R11: 000000000001600b R12: 0000000000000008
[  315.775830][ T1263] R13: 0000000000000001 R14: 0000000000000001 R15: ffffc90001633000
[  315.776698][ T1263]  strncpy_from_user_nofault+0x28/0x70
[  315.778139][ T1263]  bpf_probe_read_compat_str+0x51/0x90
[  315.778707][ T1263]  bpf_prog_9199568cec6305d9_krava+0x3c/0x40
[  315.779314][ T1263]  trace_call_bpf+0x127/0x4a0
[  315.779801][ T1263]  perf_trace_run_bpf_submit+0x4f/0xd0
[  315.786332][ T1263]  perf_trace_sched_switch+0x163/0x1a0
[  315.786885][ T1263]  __traceiter_sched_switch+0x3e/0x60
[  315.787427][ T1263]  __schedule+0x5eb/0x1040
[  315.787891][ T1263]  ? asm_sysvec_call_function_single+0x16/0x20
[  315.788503][ T1263]  ? preempt_schedule_thunk+0x16/0x30
[  315.789041][ T1263]  preempt_schedule_common+0x2c/0x70
[  315.789568][ T1263]  preempt_schedule_thunk+0x16/0x30
[  315.790096][ T1263]  _raw_spin_unlock_irqrestore+0x8e/0xa0
[  315.790654][ T1263]  force_sig_info_to_task+0xf3/0x140
[  315.791174][ T1263]  force_sig_fault+0x5a/0x80
[  315.791642][ T1263]  exc_page_fault+0x82/0x2a0
[  315.792108][ T1263]  asm_exc_page_fault+0x22/0x30
[  315.792589][ T1263] RIP: 0010:_copy_to_user+0x45/0x60
[  315.793116][ T1263] Code: 1b 9a ff 48 89 d8 48 01 e8 0f 92 c2 48 85 c0 78 28 0f b6 d2 48 85 d2 75 20 0f 01 cb 48 89 d9 48 89 ef 4c 89 e6 f3 a4 0f 1f 00 <0f> 01 ca 5b 48 89 c8 5d 41 5c c3 cc cc cc cc 48 89 d8 5b 5d 41 5c
[  315.794884][ T1263] RSP: 0000:ffffc90001947e50 EFLAGS: 00050246 
[  315.795476][ T1263] RAX: 0000000000000009 RBX: 0000000000000008 RCX: 0000000000000008
[  315.796256][ T1263] RDX: 0000000000000000 RSI: ffffffff85577050 RDI: 0000000000000001
[  315.797012][ T1263] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000001
[  315.797753][ T1263] R10: 0000000000000001 R11: 0000000000000000 R12: ffffffff85577050
[  315.798518][ T1263] R13: ffffc90001947f58 R14: ffff88817d51b6c0 R15: 0000000000000060
[  315.799287][ T1263]  __x64_sys_gettimeofday+0xc9/0xe0
[  315.799801][ T1263]  ? 0xffffffffff600000
[  315.800241][ T1263]  emulate_vsyscall+0x1be/0x420
[  315.800732][ T1263]  ? 0xffffffffff600000
[  315.801168][ T1263]  do_user_addr_fault+0x4d3/0x8b0
[  315.801651][ T1263]  ? 0xffffffffff600000
[  315.802067][ T1263]  ? 0xffffffffff600000
[  315.802460][ T1263]  exc_page_fault+0x82/0x2a0
[  315.802908][ T1263]  asm_exc_page_fault+0x22/0x30
[  315.803389][ T1263] RIP: 0033:__init_scratch_end+0x79200000/0xffffffffffa26000
[  315.804112][ T1263] Code: Unable to access opcode bytes at 0xffffffffff5fffd6.
[  315.804802][ T1263] RSP: 002b:00007ffc2bdaee98 EFLAGS: 00010246 
[  315.805352][ T1263] RAX: ffffffffffffffda RBX: 00007ffc2bdaf138 RCX: 0000000000000000
[  315.806099][ T1263] RDX: 0000000000000002 RSI: 0000000000000001 RDI: 0000000000000000
[  315.806863][ T1263] RBP: 00007ffc2bdaeef0 R08: 0000000000000064 R09: 0000000000000000
[  315.808206][ T1263] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000004
[  315.808929][ T1263] R13: 0000000000000000 R14: 00007f7ef5921000 R15: 0000000001402db0
[  315.809628][ T1263]  </TASK>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [syzbot] [bpf?] [trace?] possible deadlock in force_sig_info_to_task
  2024-04-25  9:05 [syzbot] [bpf?] [trace?] possible deadlock in force_sig_info_to_task syzbot
  2024-04-25 17:54 ` Jiri Olsa
@ 2024-04-27 20:00 ` syzbot
  1 sibling, 0 replies; 3+ messages in thread
From: syzbot @ 2024-04-27 20:00 UTC (permalink / raw)
  To: andrii, ast, bpf, daniel, eddyz87, haoluo, john.fastabend, jolsa,
	kpsingh, linux-kernel, linux-trace-kernel, martin.lau,
	mathieu.desnoyers, mhiramat, olsajiri, rostedt, sdf, song,
	syzkaller-bugs, yonghong.song

syzbot has found a reproducer for the following issue on:

HEAD commit:    5eb4573ea63d Merge tag 'soc-fixes-6.9-2' of git://git.kern..
git tree:       upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=17b2b240980000
kernel config:  https://syzkaller.appspot.com/x/.config?x=3d46aa9d7a44f40d
dashboard link: https://syzkaller.appspot.com/bug?extid=83e7f982ca045ab4405c
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=120f79ef180000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=13a1cd27180000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/d647177a878d/disk-5eb4573e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/977f32ca169c/vmlinux-5eb4573e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/67f3b92c1012/bzImage-5eb4573e.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+83e7f982ca045ab4405c@syzkaller.appspotmail.com

======================================================
WARNING: possible circular locking dependency detected
6.9.0-rc5-syzkaller-00296-g5eb4573ea63d #0 Not tainted
------------------------------------------------------
syz-executor324/5151 is trying to acquire lock:
ffff88802a6c8018 (&sighand->siglock){....}-{2:2}, at: force_sig_info_to_task+0x68/0x580 kernel/signal.c:1334

but task is already holding lock:
ffff8880b943e658 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:559

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&rq->__lock){-.-.}-{2:2}:
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
       _raw_spin_lock_nested+0x31/0x40 kernel/locking/spinlock.c:378
       raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:559
       raw_spin_rq_lock kernel/sched/sched.h:1387 [inline]
       rq_lock kernel/sched/sched.h:1701 [inline]
       task_fork_fair+0x61/0x1e0 kernel/sched/fair.c:12635
       sched_cgroup_fork+0x37c/0x410 kernel/sched/core.c:4845
       copy_process+0x2217/0x3df0 kernel/fork.c:2499
       kernel_clone+0x223/0x870 kernel/fork.c:2797
       user_mode_thread+0x132/0x1a0 kernel/fork.c:2875
       rest_init+0x23/0x300 init/main.c:704
       start_kernel+0x47a/0x500 init/main.c:1081
       x86_64_start_reservations+0x2a/0x30 arch/x86/kernel/head64.c:507
       x86_64_start_kernel+0x99/0xa0 arch/x86/kernel/head64.c:488
       common_startup_64+0x13e/0x147

-> #1 (&p->pi_lock){-.-.}-{2:2}:
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
       class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:553 [inline]
       try_to_wake_up+0xb0/0x1470 kernel/sched/core.c:4262
       signal_wake_up_state+0xb4/0x120 kernel/signal.c:773
       signal_wake_up include/linux/sched/signal.h:448 [inline]
       complete_signal+0x94a/0xcf0 kernel/signal.c:1065
       __send_signal_locked+0xb1b/0xdc0 kernel/signal.c:1185
       do_notify_parent+0xd96/0x10a0 kernel/signal.c:2143
       exit_notify kernel/exit.c:757 [inline]
       do_exit+0x1811/0x27e0 kernel/exit.c:898
       do_group_exit+0x207/0x2c0 kernel/exit.c:1027
       __do_sys_exit_group kernel/exit.c:1038 [inline]
       __se_sys_exit_group kernel/exit.c:1036 [inline]
       __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1036
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (&sighand->siglock){....}-{2:2}:
       check_prev_add kernel/locking/lockdep.c:3134 [inline]
       check_prevs_add kernel/locking/lockdep.c:3253 [inline]
       validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869
       __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
       force_sig_info_to_task+0x68/0x580 kernel/signal.c:1334
       force_sig_fault_to_task kernel/signal.c:1733 [inline]
       force_sig_fault+0x12c/0x1d0 kernel/signal.c:1738
       __bad_area_nosemaphore+0x127/0x780 arch/x86/mm/fault.c:814
       handle_page_fault arch/x86/mm/fault.c:1505 [inline]
       exc_page_fault+0x612/0x8e0 arch/x86/mm/fault.c:1563
       asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
       rep_movs_alternative+0x22/0x70 arch/x86/lib/copy_user_64.S:48
       copy_user_generic arch/x86/include/asm/uaccess_64.h:110 [inline]
       raw_copy_from_user arch/x86/include/asm/uaccess_64.h:125 [inline]
       __copy_from_user_inatomic include/linux/uaccess.h:87 [inline]
       copy_from_user_nofault+0xbc/0x150 mm/maccess.c:125
       bpf_probe_read_user_common kernel/trace/bpf_trace.c:179 [inline]
       ____bpf_probe_read_compat kernel/trace/bpf_trace.c:292 [inline]
       bpf_probe_read_compat+0xe9/0x180 kernel/trace/bpf_trace.c:288
       bpf_prog_1878750df62aa1fb+0x48/0x4a
       bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline]
       __bpf_prog_run include/linux/filter.h:657 [inline]
       bpf_prog_run include/linux/filter.h:664 [inline]
       __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline]
       bpf_trace_run4+0x25a/0x490 kernel/trace/bpf_trace.c:2422
       __traceiter_sched_switch+0x98/0xd0 include/trace/events/sched.h:222
       trace_sched_switch include/trace/events/sched.h:222 [inline]
       __schedule+0x2535/0x4a00 kernel/sched/core.c:6743
       preempt_schedule_common+0x84/0xd0 kernel/sched/core.c:6925
       preempt_schedule+0xe1/0xf0 kernel/sched/core.c:6949
       preempt_schedule_thunk+0x1a/0x30 arch/x86/entry/thunk_64.S:12
       __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
       _raw_spin_unlock_irqrestore+0x130/0x140 kernel/locking/spinlock.c:194
       spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
       force_sig_info_to_task+0x41c/0x580 kernel/signal.c:1356
       force_sig_fault_to_task kernel/signal.c:1733 [inline]
       force_sig_fault+0x12c/0x1d0 kernel/signal.c:1738
       __bad_area_nosemaphore+0x127/0x780 arch/x86/mm/fault.c:814
       handle_page_fault arch/x86/mm/fault.c:1505 [inline]
       exc_page_fault+0x612/0x8e0 arch/x86/mm/fault.c:1563
       asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
       __put_user_handle_exception+0x0/0x10
       __do_sys_gettimeofday kernel/time/time.c:147 [inline]
       __se_sys_gettimeofday+0xd9/0x240 kernel/time/time.c:140
       emulate_vsyscall+0xe23/0x1290 arch/x86/entry/vsyscall/vsyscall_64.c:247
       do_user_addr_fault arch/x86/mm/fault.c:1346 [inline]
       handle_page_fault arch/x86/mm/fault.c:1505 [inline]
       exc_page_fault+0x160/0x8e0 arch/x86/mm/fault.c:1563
       asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
       _end+0x6a9da000/0x0

other info that might help us debug this:

Chain exists of:
  &sighand->siglock --> &p->pi_lock --> &rq->__lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&rq->__lock);
                               lock(&p->pi_lock);
                               lock(&rq->__lock);
  lock(&sighand->siglock);

 *** DEADLOCK ***

2 locks held by syz-executor324/5151:
 #0: ffff8880b943e658 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:559
 #1: ffffffff8e334d20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
 #1: ffffffff8e334d20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
 #1: ffffffff8e334d20 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2380 [inline]
 #1: ffffffff8e334d20 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run4+0x16e/0x490 kernel/trace/bpf_trace.c:2422

stack backtrace:
CPU: 0 PID: 5151 Comm: syz-executor324 Not tainted 6.9.0-rc5-syzkaller-00296-g5eb4573ea63d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2187
 check_prev_add kernel/locking/lockdep.c:3134 [inline]
 check_prevs_add kernel/locking/lockdep.c:3253 [inline]
 validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869
 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
 force_sig_info_to_task+0x68/0x580 kernel/signal.c:1334
 force_sig_fault_to_task kernel/signal.c:1733 [inline]
 force_sig_fault+0x12c/0x1d0 kernel/signal.c:1738
 __bad_area_nosemaphore+0x127/0x780 arch/x86/mm/fault.c:814
 handle_page_fault arch/x86/mm/fault.c:1505 [inline]
 exc_page_fault+0x612/0x8e0 arch/x86/mm/fault.c:1563
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0010:rep_movs_alternative+0x22/0x70 arch/x86/lib/copy_user_64.S:50
Code: 90 90 90 90 90 90 90 90 f3 0f 1e fa 48 83 f9 40 73 40 83 f9 08 73 21 85 c9 74 0f 8a 06 88 07 48 ff c7 48 ff c6 48 ff c9 75 f1 <c3> cc cc cc cc 66 0f 1f 84 00 00 00 00 00 48 8b 06 48 89 07 48 83
RSP: 0000:ffffc90004137468 EFLAGS: 00050002
RAX: ffffffff8205ce4e RBX: dffffc0000000000 RCX: 0000000000000002
RDX: 0000000000000000 RSI: 0000000000000900 RDI: ffffc900041374e8
RBP: ffff88802d039784 R08: 0000000000000005 R09: ffffffff8205ce37
R10: 0000000000000003 R11: ffff88802d038000 R12: 1ffff11005a072f0
R13: 0000000000000900 R14: 0000000000000002 R15: ffffc900041374e8
 copy_user_generic arch/x86/include/asm/uaccess_64.h:110 [inline]
 raw_copy_from_user arch/x86/include/asm/uaccess_64.h:125 [inline]
 __copy_from_user_inatomic include/linux/uaccess.h:87 [inline]
 copy_from_user_nofault+0xbc/0x150 mm/maccess.c:125
 bpf_probe_read_user_common kernel/trace/bpf_trace.c:179 [inline]
 ____bpf_probe_read_compat kernel/trace/bpf_trace.c:292 [inline]
 bpf_probe_read_compat+0xe9/0x180 kernel/trace/bpf_trace.c:288
 bpf_prog_1878750df62aa1fb+0x48/0x4a
 bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline]
 __bpf_prog_run include/linux/filter.h:657 [inline]
 bpf_prog_run include/linux/filter.h:664 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline]
 bpf_trace_run4+0x25a/0x490 kernel/trace/bpf_trace.c:2422
 __traceiter_sched_switch+0x98/0xd0 include/trace/events/sched.h:222
 trace_sched_switch include/trace/events/sched.h:222 [inline]
 __schedule+0x2535/0x4a00 kernel/sched/core.c:6743
 preempt_schedule_common+0x84/0xd0 kernel/sched/core.c:6925
 preempt_schedule+0xe1/0xf0 kernel/sched/core.c:6949
 preempt_schedule_thunk+0x1a/0x30 arch/x86/entry/thunk_64.S:12
 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
 _raw_spin_unlock_irqrestore+0x130/0x140 kernel/locking/spinlock.c:194
 spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
 force_sig_info_to_task+0x41c/0x580 kernel/signal.c:1356
 force_sig_fault_to_task kernel/signal.c:1733 [inline]
 force_sig_fault+0x12c/0x1d0 kernel/signal.c:1738
 __bad_area_nosemaphore+0x127/0x780 arch/x86/mm/fault.c:814
 handle_page_fault arch/x86/mm/fault.c:1505 [inline]
 exc_page_fault+0x612/0x8e0 arch/x86/mm/fault.c:1563
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0010:__put_user_handle_exception+0x0/0x10 arch/x86/lib/putuser.S:125
Code: 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 0f 01 cb 48 89 01 31 c9 0f 01 ca c3 cc cc cc cc 66 2e 0f 1f 84 00 00 00 00 00 66 90 <0f> 01 ca b9 f2 ff ff ff c3 cc cc cc cc 0f 1f 00 90 90 90 90 90 90
RSP: 0000:ffffc90004137d98 EFLAGS: 00050202
RAX: 00000000662d5943 RBX: 0000000000000000 RCX: 0000000000000019
RDX: 0000000000000000 RSI: ffffffff8bcaca20 RDI: ffffffff8c1eaba0
RBP: ffffc90004137e50 R08: ffffffff8fa7cd6f R09: 1ffffffff1f4f9ad
R10: dffffc0000000000 R11: fffffbfff1f4f9ae R12: ffffc90004137de0
R13: dffffc0000000000 R14: 1ffff92000826fb8 R15: 0000000000000019
 __do_sys_gettimeofday kernel/time/time.c:147 [inline]
 __se_sys_gettimeofday+0xd9/0x240 kernel/time/time.c:140
 emulate_vsyscall+0xe23/0x1290 arch/x86/entry/vsyscall/vsyscall_64.c:247
 do_user_addr_fault arch/x86/mm/fault.c:1346 [inline]
 handle_page_fault arch/x86/mm/fault.c:1505 [inline]
 exc_page_fault+0x160/0x8e0 arch/x86/mm/fault.c:1563
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0033:_end+0x6a9da000/0x0
Code: Unable to access opcode bytes at 0xffffffffff5fffd6.
RSP: 002b:00007fbb40c81c78 EFLAGS: 00010246
RAX: ffffffffffffffda RBX: 00007fbb40d73418 RCX: 00007fbb40ce97d9
RDX: 00007fbb40c81c80 RSI: 00007fbb40c81db0 RDI: 0000000000000019
RBP: 00007fbb40d73410 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000007 R11: 0000000000000246 R12: 00007fbb40d402b0
R13: 77735f6465686373 R14: 66aa589070d556b8 R15: 0400000000000004
 </TASK>
syz-executor324[5151] vsyscall fault (exploit attempt?) ip:ffffffffff600000 cs:33 sp:7fbb40c81c78 ax:ffffffffffffffda si:7fbb40c81db0 di:19
----------------
Code disassembly (best guess):
   0:	90                   	nop
   1:	90                   	nop
   2:	90                   	nop
   3:	90                   	nop
   4:	90                   	nop
   5:	90                   	nop
   6:	90                   	nop
   7:	90                   	nop
   8:	f3 0f 1e fa          	endbr64
   c:	48 83 f9 40          	cmp    $0x40,%rcx
  10:	73 40                	jae    0x52
  12:	83 f9 08             	cmp    $0x8,%ecx
  15:	73 21                	jae    0x38
  17:	85 c9                	test   %ecx,%ecx
  19:	74 0f                	je     0x2a
  1b:	8a 06                	mov    (%rsi),%al
  1d:	88 07                	mov    %al,(%rdi)
  1f:	48 ff c7             	inc    %rdi
  22:	48 ff c6             	inc    %rsi
  25:	48 ff c9             	dec    %rcx
  28:	75 f1                	jne    0x1b
* 2a:	c3                   	ret <-- trapping instruction
  2b:	cc                   	int3
  2c:	cc                   	int3
  2d:	cc                   	int3
  2e:	cc                   	int3
  2f:	66 0f 1f 84 00 00 00 	nopw   0x0(%rax,%rax,1)
  36:	00 00
  38:	48 8b 06             	mov    (%rsi),%rax
  3b:	48 89 07             	mov    %rax,(%rdi)
  3e:	48                   	rex.W
  3f:	83                   	.byte 0x83


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-27 20:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-25  9:05 [syzbot] [bpf?] [trace?] possible deadlock in force_sig_info_to_task syzbot
2024-04-25 17:54 ` Jiri Olsa
2024-04-27 20:00 ` syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).