mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Pengfei Xu <pengfei.xu@intel.com>
Cc: peter.zijlstra@intel.com, linux-kernel@vger.kernel.org,
	heng.su@intel.com, Marco Elver <elver@google.com>,
	Mark Rutland <mark.rutland@arm.com>,
	namhyung@kernel.org
Subject: Re: [Syzkaller & bisect] There is "__perf_event_overflow" WARNING in v6.1-rc5 kernel in guest
Date: Wed, 23 Nov 2022 16:06:17 +0100	[thread overview]
Message-ID: <Y3426b4OimE/I5po@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <Y342qkDw7yqA1VOD@hirez.programming.kicks-ass.net>

On Wed, Nov 23, 2022 at 04:05:14PM +0100, Peter Zijlstra wrote:
> @@ -9330,7 +9350,7 @@ static int __perf_event_overflow(struct
>  		}
>  
>  		event->pending_addr = 0;
> -		if (data->sample_flags & PERF_SAMPLE_ADDR)
> +		if (valid_sample && (data->sample_flags & PERF_SAMPLE_ADDR))
>  			event->pending_addr = data->addr;
>  		irq_work_queue(&event->pending_irq);
>  	}

That is the result of this patch; also found in that branch:

---
Subject: perf: Fixup SIGTRAP and sample_flags interaction
From: Peter Zijlstra <peterz@infradead.org>
Date: Mon Nov 21 15:57:44 CET 2022

The perf_event_attr::sigtrap functionality relies on data->addr being
set. However commit 7b0846301531 ("perf: Use sample_flags for addr")
changed this to only initialize data->addr when not 0.

Fixes: 7b0846301531 ("perf: Use sample_flags for addr")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 kernel/events/core.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -9328,7 +9328,10 @@ static int __perf_event_overflow(struct
 			 */
 			WARN_ON_ONCE(event->pending_sigtrap != pending_id);
 		}
-		event->pending_addr = data->addr;
+
+		event->pending_addr = 0;
+		if (data->sample_flags & PERF_SAMPLE_ADDR)
+			event->pending_addr = data->addr;
 		irq_work_queue(&event->pending_irq);
 	}
 

  reply	other threads:[~2022-11-23 15:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16  3:39 Pengfei Xu
2022-11-16  3:45 ` Pengfei Xu
2022-11-16 14:40 ` Peter Zijlstra
2022-11-17  1:37   ` Pengfei Xu
2022-11-17 18:11 ` Peter Zijlstra
2022-11-19  2:45   ` Pengfei Xu
2022-11-23 15:05     ` Peter Zijlstra
2022-11-23 15:06       ` Peter Zijlstra [this message]
2022-11-23 15:26       ` Pengfei Xu
2022-11-24  1:40         ` Pengfei Xu
2022-11-24  8:31       ` Marco Elver
2022-11-24  9:00         ` Peter Zijlstra
2022-11-24 10:34           ` Peter Zijlstra
2022-11-24  9:43     ` [tip: perf/urgent] perf: Consider OS filter fail tip-bot2 for Peter Zijlstra

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=Y3426b4OimE/I5po@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=elver@google.com \
    --cc=heng.su@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=namhyung@kernel.org \
    --cc=pengfei.xu@intel.com \
    --cc=peter.zijlstra@intel.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

all inboxes | Powered by JetHome®