Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1522720lqa; Mon, 29 Apr 2024 10:46:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUUN1xZRLTcuIuzwOvw9aBibEQPjqXwrsvgCu7/tV2+TQvQZsF/g/aKVi9svWBwAH1JNtTp9A8PAuBa2XLbjVaR3pLzr2EbmtvMWkUCsA== X-Google-Smtp-Source: AGHT+IFX6G7ehquNMoDQvhZmTyUw6PJI5VRv3vbTJd40PijJKbbYHajK0Md3YzySbEdkwCaxD+He X-Received: by 2002:a54:4589:0:b0:3c8:6569:9968 with SMTP id z9-20020a544589000000b003c865699968mr5345449oib.48.1714412784747; Mon, 29 Apr 2024 10:46:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714412784; cv=pass; d=google.com; s=arc-20160816; b=P3bUFWWdaHi8EnJlLjZx/SMZGIrQK9nZoQdPHzUr2KPVMnVy+SL3ONYlKBAyrP5DDx PdY7mCjH9Ny0WkJqhKIQ0NZkshFxLygeeVWtMLkpKBspg0fx5tX9jmq7pSqOnKzMkRaD iuiFmcbra9ofEfGDLcJJvfkTc3BpZpzZbjD0SZPdpV6OmIRrEN/m+ftHYLKltfIl2VgN AOcPIXHPMZDuHiRpXdLJC2vFwt3bCxyueb1ug0CrOg1fGzudCaRH3tSytRHzxbAy0xMN x7aFAPKKfOEYxYA9HWxfQ4uCihyjm2dN+TWUbVlX+KtMiJiRy6b4CRMG7BijshUzy6hU Zdyw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature:message-id; bh=r7oFU2BoxCCtC1ccNHcqKzlkmI8ESHX9lPB03PGJn9w=; fh=FP9qHkbaGX5U/+9nFP4M3Wbto3GszgkezAXGnRIZx+E=; b=Fs5rYwgSuGPpFg638IQFo8wPzY4QFQQMw6WQV6b/R5nROAVAXTmcUfF6B4lF/huBbZ G8yfuxb3ndClj0OkVS/1+js+MO/0LB+amsyT7s9UZDkwLgrbCwkfcXTtOZux8ukSdjmN Dqbr5q8RQCSX3z+I0zkUaf65YztljhpnnSdPhT7I8ie9mvQ9mlQVkQgxdWAdnQpd2kg7 h9i8XYADK/Xn3efIRSz6TUl7/TFHv8tUGuW40qs6pwt2KaZ9PCK6/sXSvZCBOaR0Uoh9 Tl2MQ+Qzxy0QnkBbBKXm0kpivrGBpG8wbHvPq42Mgt2G2Qt1JYu05piH0fRA7mWpQ9F0 j/Cw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=JtLSw0kt; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-162777-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162777-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ow31-20020a05620a821f00b0078edc278355si25918014qkn.498.2024.04.29.10.46.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 10:46:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162777-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=JtLSw0kt; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-162777-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162777-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 49C921C2216A for ; Mon, 29 Apr 2024 17:46:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C0B06128832; Mon, 29 Apr 2024 17:45:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="JtLSw0kt" Received: from out-187.mta0.migadu.com (out-187.mta0.migadu.com [91.218.175.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09E6F128399 for ; Mon, 29 Apr 2024 17:45:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714412758; cv=none; b=jFhuViO6PJ6ZE6Jqwj3+kCX2fk+e9Wlbcs/H8ZbOcxUimz0foJG4lwgmIJ1nIb8JTwp2CLtiJgersWNDqc5vj9dGZ8tu0+K4GWNatQdpLlf5n6HbQhcVZp0byHqwKbGtGIAW+ivnJozjqtpJxrvox8gLnpHnP2GT98Lib75n77A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714412758; c=relaxed/simple; bh=lFxLGe1ug8Ra1SKtFkV6OMijDJZuGgOGdi/k0+rQBX0=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=HpxaC1ISBfX/NIcDeEnjrrl88fqc3avGQRoCVxedalGABT5c0E5D1VyMIq5mZFSBY6jj8Fo+QurWQUx47WZapZ3MkH+L5WMUQo4cGJv+TrEBCyfj2I9iz1wA7Iku7IlLGB1UCluZuW4ppQMKWEoL/BXZWr4ClKIgPh2A4OnUtcQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=JtLSw0kt; arc=none smtp.client-ip=91.218.175.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1714412754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r7oFU2BoxCCtC1ccNHcqKzlkmI8ESHX9lPB03PGJn9w=; b=JtLSw0ktJVMmaBbu6NfLE+Nn85jlnfqvxnNX9ctwmRVvOlVQ76zPhEb3KLuYPLINVhDyjC D2VvztNkf47xQd6IvC8FZmJ2Lz8Daux/v/kPMKs8ooAmhCD/foy6zqxoxWiW3HUe10U1IV YKYqsoVsy7jX3zgD+TvcLD7X3Bezbfw= Date: Mon, 29 Apr 2024 10:45:47 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [syzbot] [bpf?] [trace?] WARNING in group_send_sig_info Content-Language: en-GB To: syzbot , andrii@kernel.org, ast@kernel.org, bpf@vger.kernel.org, daniel@iogearbox.net, eddyz87@gmail.com, haoluo@google.com, john.fastabend@gmail.com, jolsa@kernel.org, kpsingh@kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, martin.lau@linux.dev, mathieu.desnoyers@efficios.com, mhiramat@kernel.org, netdev@vger.kernel.org, rostedt@goodmis.org, sdf@google.com, song@kernel.org, syzkaller-bugs@googlegroups.com References: <000000000000bc2d38061716975e@google.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yonghong Song In-Reply-To: <000000000000bc2d38061716975e@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT 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=11ca8fe7180000 > 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+1902c6d326478ce2dfb0@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:ffffc9000399fbb8 EFLAGS: 00010246 > > RAX: 4aede97b00455d00 RBX: 1ffff92000733f7c RCX: ffff88802a129e00 > RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 > RBP: ffffc9000399fc50 R08: ffffffff8157cc12 R09: 1ffff110172a51a2 > R10: dffffc0000000000 R11: ffffed10172a51a3 R12: dffffc0000000000 > R13: 1ffff92000733f78 R14: ffffc9000399fbe0 R15: 0000000000000246 > FS: 000055557ae76480(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: 00007ffc27e190f8 CR3: 000000006cb50000 CR4: 00000000003506f0 > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > 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(&sighand->siglock, *flags); if (likely(sighand == rcu_access_pointer(tsk->sighand))) break; spin_unlock_irqrestore(&sighand->siglock, *flags); } rcu_read_unlock(); return sighand; } static inline struct sighand_struct *lock_task_sighand(struct task_struct *task, unsigned long *flags) { struct sighand_struct *ret; ret = __lock_task_sighand(task, flags); (void)__cond_lock(&task->sighand->siglock, ret); return ret; } static inline void unlock_task_sighand(struct task_struct *task, unsigned long *flags) { spin_unlock_irqrestore(&task->sighand->siglock, *flags); } int do_send_sig_info(int sig, struct kernel_siginfo *info, struct task_struct *p, enum pid_type type) { unsigned long flags; int ret = -ESRCH; if (lock_task_sighand(p, &flags)) { ret = send_signal_locked(sig, info, p, type); unlock_task_sighand(p, &flags); } return ret; } If p->sighand changed between lock_task_sighand() and unlock_task_sighand(), the warning makes sense. But I am not sure whether and how this could happen. > 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:00007ffd999e9950 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 > RAX: fffffffffffffffa RBX: 0000000000000003 RCX: 00007f8e47e7dc0b > RDX: 0000000000000000 RSI: 0000000000004c01 RDI: 0000000000000003 > RBP: 00007ffd999e9a0c R08: 0000000000000000 R09: 00007ffd999e96f7 > R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000032 > R13: 000000000004757a R14: 000000000004754c R15: 000000000000000f > > > > --- > 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 >