Re: [syzbot] [bpf?] [trace?] WARNING in group_send_sig_info

2024-04-29 Thread Yonghong Song



On 4/27/24 9:34 AM, syzbot wrote:

Hello,

syzbot found the following issue on:

HEAD commit:443574b03387 riscv, bpf: Fix kfunc parameters incompatibil..
git tree:   bpf
console output: https://syzkaller.appspot.com/x/log.txt?x=11ca8fe718
kernel config:  https://syzkaller.appspot.com/x/.config?x=6fb1be60a193d440
dashboard link: https://syzkaller.appspot.com/bug?extid=1902c6d326478ce2dfb0
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/3f355021a085/disk-443574b0.raw.xz
vmlinux: 
https://storage.googleapis.com/syzbot-assets/44cf4de7472a/vmlinux-443574b0.xz
kernel image: 
https://storage.googleapis.com/syzbot-assets/a99a36c7ad65/bzImage-443574b0.xz

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

[ cut here ]
raw_local_irq_restore() called with IRQs enabled
WARNING: CPU: 1 PID: 7785 at kernel/locking/irqflag-debug.c:10 
warn_bogus_irq_restore+0x29/0x40 kernel/locking/irqflag-debug.c:10
Modules linked in:
CPU: 1 PID: 7785 Comm: syz-executor.3 Not tainted 
6.8.0-syzkaller-05236-g443574b03387 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 
03/27/2024
RIP: 0010:warn_bogus_irq_restore+0x29/0x40 kernel/locking/irqflag-debug.c:10
Code: 90 f3 0f 1e fa 90 80 3d de 59 01 04 00 74 06 90 c3 cc cc cc cc c6 05 cf 59 01 
04 01 90 48 c7 c7 20 ba aa 8b e8 f8 d5 e7 f5 90 <0f> 0b 90 90 90 c3 cc cc cc cc 
66 2e 0f 1f 84 00 00 00 00 00 0f 1f
RSP: 0018:c9000399fbb8 EFLAGS: 00010246

RAX: 4aede97b00455d00 RBX: 192000733f7c RCX: 88802a129e00
RDX:  RSI:  RDI: 
RBP: c9000399fc50 R08: 8157cc12 R09: 1110172a51a2
R10: dc00 R11: ed10172a51a3 R12: dc00
R13: 192000733f78 R14: c9000399fbe0 R15: 0246
FS:  7ae76480() GS:8880b950() knlGS:
CS:  0010 DS:  ES:  CR0: 80050033
CR2: 7ffc27e190f8 CR3: 6cb5 CR4: 003506f0
DR0:  DR1:  DR2: 
DR3:  DR6: fffe0ff0 DR7: 0400
Call Trace:
  
  __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline]
  _raw_spin_unlock_irqrestore+0x120/0x140 kernel/locking/spinlock.c:194
  spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
  unlock_task_sighand include/linux/sched/signal.h:754 [inline]
  do_send_sig_info kernel/signal.c:1302 [inline]
  group_send_sig_info+0x2e0/0x310 kernel/signal.c:1453
  bpf_send_signal_common+0x2dd/0x430 kernel/trace/bpf_trace.c:881
  bpf_send_signal kernel/trace/bpf_trace.c:886 [inline]
  bpf_send_signal+0x19/0x30 kernel/trace/bpf_trace.c:884
  bpf_prog_8cc4ff36b5985b6a+0x1d/0x1f
  bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline]
  __bpf_prog_run include/linux/filter.h:650 [inline]
  bpf_prog_run include/linux/filter.h:664 [inline]
  __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline]
  bpf_trace_run2+0x375/0x420 kernel/trace/bpf_trace.c:2420
  trace_sys_exit include/trace/events/syscalls.h:44 [inline]
  syscall_exit_work+0x153/0x170 kernel/entry/common.c:163
  syscall_exit_to_user_mode_prepare kernel/entry/common.c:194 [inline]
  __syscall_exit_to_user_mode_work kernel/entry/common.c:199 [inline]
  syscall_exit_to_user_mode+0x273/0x360 kernel/entry/common.c:212
  do_syscall_64+0x10a/0x240 arch/x86/entry/common.c:89
  entry_SYSCALL_64_after_hwframe+0x6d/0x75


The following are related functions.

struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
   unsigned long *flags)
{
struct sighand_struct *sighand;

rcu_read_lock();
for (;;) {
sighand = rcu_dereference(tsk->sighand);
if (unlikely(sighand == NULL))
break;

/*
 * This sighand can be already freed and even reused, but
 * we rely on SLAB_TYPESAFE_BY_RCU and sighand_ctor() which
 * initializes ->siglock: this slab can't go away, it has
 * the same object type, ->siglock can't be reinitialized.
 *
 * We need to ensure that tsk->sighand is still the same
 * after we take the lock, we can race with de_thread() or
 * __exit_signal(). In the latter case the next iteration
 * must see ->sighand == NULL.
 */
spin_lock_irqsave(>siglock, *flags);
if (likely(sighand == rcu_access_pointer(tsk->sighand)))
break;
spin_unlock_irqrestore(>siglock, *flags);
}
rcu_read_unlock();


[syzbot] [bpf?] [trace?] WARNING in group_send_sig_info

2024-04-27 Thread syzbot
Hello,

syzbot found the following issue on:

HEAD commit:443574b03387 riscv, bpf: Fix kfunc parameters incompatibil..
git tree:   bpf
console output: https://syzkaller.appspot.com/x/log.txt?x=11ca8fe718
kernel config:  https://syzkaller.appspot.com/x/.config?x=6fb1be60a193d440
dashboard link: https://syzkaller.appspot.com/bug?extid=1902c6d326478ce2dfb0
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/3f355021a085/disk-443574b0.raw.xz
vmlinux: 
https://storage.googleapis.com/syzbot-assets/44cf4de7472a/vmlinux-443574b0.xz
kernel image: 
https://storage.googleapis.com/syzbot-assets/a99a36c7ad65/bzImage-443574b0.xz

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

[ cut here ]
raw_local_irq_restore() called with IRQs enabled
WARNING: CPU: 1 PID: 7785 at kernel/locking/irqflag-debug.c:10 
warn_bogus_irq_restore+0x29/0x40 kernel/locking/irqflag-debug.c:10
Modules linked in:
CPU: 1 PID: 7785 Comm: syz-executor.3 Not tainted 
6.8.0-syzkaller-05236-g443574b03387 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 
03/27/2024
RIP: 0010:warn_bogus_irq_restore+0x29/0x40 kernel/locking/irqflag-debug.c:10
Code: 90 f3 0f 1e fa 90 80 3d de 59 01 04 00 74 06 90 c3 cc cc cc cc c6 05 cf 
59 01 04 01 90 48 c7 c7 20 ba aa 8b e8 f8 d5 e7 f5 90 <0f> 0b 90 90 90 c3 cc cc 
cc cc 66 2e 0f 1f 84 00 00 00 00 00 0f 1f
RSP: 0018:c9000399fbb8 EFLAGS: 00010246

RAX: 4aede97b00455d00 RBX: 192000733f7c RCX: 88802a129e00
RDX:  RSI:  RDI: 
RBP: c9000399fc50 R08: 8157cc12 R09: 1110172a51a2
R10: dc00 R11: ed10172a51a3 R12: dc00
R13: 192000733f78 R14: c9000399fbe0 R15: 0246
FS:  7ae76480() GS:8880b950() knlGS:
CS:  0010 DS:  ES:  CR0: 80050033
CR2: 7ffc27e190f8 CR3: 6cb5 CR4: 003506f0
DR0:  DR1:  DR2: 
DR3:  DR6: fffe0ff0 DR7: 0400
Call Trace:
 
 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline]
 _raw_spin_unlock_irqrestore+0x120/0x140 kernel/locking/spinlock.c:194
 spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
 unlock_task_sighand include/linux/sched/signal.h:754 [inline]
 do_send_sig_info kernel/signal.c:1302 [inline]
 group_send_sig_info+0x2e0/0x310 kernel/signal.c:1453
 bpf_send_signal_common+0x2dd/0x430 kernel/trace/bpf_trace.c:881
 bpf_send_signal kernel/trace/bpf_trace.c:886 [inline]
 bpf_send_signal+0x19/0x30 kernel/trace/bpf_trace.c:884
 bpf_prog_8cc4ff36b5985b6a+0x1d/0x1f
 bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline]
 __bpf_prog_run include/linux/filter.h:650 [inline]
 bpf_prog_run include/linux/filter.h:664 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline]
 bpf_trace_run2+0x375/0x420 kernel/trace/bpf_trace.c:2420
 trace_sys_exit include/trace/events/syscalls.h:44 [inline]
 syscall_exit_work+0x153/0x170 kernel/entry/common.c:163
 syscall_exit_to_user_mode_prepare kernel/entry/common.c:194 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:199 [inline]
 syscall_exit_to_user_mode+0x273/0x360 kernel/entry/common.c:212
 do_syscall_64+0x10a/0x240 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x6d/0x75
RIP: 0033:0x7f8e47e7dc0b
Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 
08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 
1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00
RSP: 002b:7ffd999e9950 EFLAGS: 0246 ORIG_RAX: 0010
RAX: fffa RBX: 0003 RCX: 7f8e47e7dc0b
RDX:  RSI: 4c01 RDI: 0003
RBP: 7ffd999e9a0c R08:  R09: 7ffd999e96f7
R10:  R11: 0246 R12: 0032
R13: 0004757a R14: 0004754c R15: 000f
 


---
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 syzkal...@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