public inbox for linux-perf-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Qing Wang <wangqing7171@gmail.com>
Cc: syzbot+72a43cdb78469f7fbad1@syzkaller.appspotmail.com,
	acme@kernel.org, adrian.hunter@intel.com,
	alexander.shishkin@linux.intel.com, irogers@google.com,
	jolsa@kernel.org, linux-kernel@vger.kernel.org,
	linux-perf-users@vger.kernel.org, mark.rutland@arm.com,
	mingo@redhat.com, namhyung@kernel.org,
	syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [perf?] WARNING: suspicious RCU usage in get_callchain_entry
Date: Wed, 28 Jan 2026 09:52:00 +0100	[thread overview]
Message-ID: <20260128085200.GE3372621@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20260128035508.1840613-1-wangqing7171@gmail.com>

On Wed, Jan 28, 2026 at 11:55:08AM +0800, Qing Wang wrote:
> #syz test
> 
> diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c
> index da3d328f5c15..f97d4aa9d038 100644
> --- a/kernel/bpf/stackmap.c
> +++ b/kernel/bpf/stackmap.c
> @@ -460,7 +460,7 @@ static long __bpf_get_stack(struct pt_regs *regs, struct task_struct *task,
>  
>  	max_depth = stack_map_calculate_max_depth(size, elem_size, flags);
>  
> -	if (may_fault)
> +	if (!trace_in)
>  		rcu_read_lock(); /* need RCU for perf's callchain below */
>  
>  	if (trace_in) {
> @@ -474,7 +474,7 @@ static long __bpf_get_stack(struct pt_regs *regs, struct task_struct *task,
>  	}
>  
>  	if (unlikely(!trace) || trace->nr < skip) {
> -		if (may_fault)
> +		if (!trace_in)
>  			rcu_read_unlock();
>  		goto err_fault;
>  	}
> @@ -494,7 +494,7 @@ static long __bpf_get_stack(struct pt_regs *regs, struct task_struct *task,
>  	}
>  
>  	/* trace/ips should not be dereferenced after this point */
> -	if (may_fault)
> +	if (!trace_in)
>  		rcu_read_unlock();
>  
>  	if (user_build_id)
> 

This is just papering over more bugs. There was a series out there
somewhere trying to fix up this code, let me see if I can find it in
this shitshow called an inbox :/

  parent reply	other threads:[~2026-01-28  8:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-30 10:49 [syzbot] [perf?] WARNING: suspicious RCU usage in get_callchain_entry syzbot
2026-01-28  3:52 ` Qing Wang
2026-01-28  4:26   ` syzbot
2026-01-28  3:55 ` Qing Wang
2026-01-28  4:50   ` syzbot
2026-01-28  8:52   ` Peter Zijlstra [this message]
2026-01-28  9:15     ` Qing Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260128085200.GE3372621@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=syzbot+72a43cdb78469f7fbad1@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=wangqing7171@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox