[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y3426b4OimE/I5po@hirez.programming.kicks-ass.net>
Date: Wed, 23 Nov 2022 16:06:17 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Pengfei Xu <pengfei.xu@...el.com>
Cc: peter.zijlstra@...el.com, linux-kernel@...r.kernel.org,
heng.su@...el.com, Marco Elver <elver@...gle.com>,
Mark Rutland <mark.rutland@....com>, namhyung@...nel.org
Subject: Re: [Syzkaller & bisect] There is "__perf_event_overflow" WARNING in
v6.1-rc5 kernel in guest
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@...radead.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@...radead.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);
}
Powered by blists - more mailing lists