4.9-stable review patch. If anyone has any objections, please let me know.
--
From: Peter Zijlstra
commit 451d24d1e5f40bad000fa9abe36ddb16fc9928cb upstream.
Alexei had his box explode because doing read() on a package
(rapl/uncore) event that isn't
4.9-stable review patch. If anyone has any objections, please let me know.
--
From: Peter Zijlstra
commit 451d24d1e5f40bad000fa9abe36ddb16fc9928cb upstream.
Alexei had his box explode because doing read() on a package
(rapl/uncore) event that isn't currently scheduled in ends
10 Feb 2017 09:04:50 +0100
perf/core: Fix crash in perf_event_read()
Alexei had his box explode because doing read() on a package
(rapl/uncore) event that isn't currently scheduled in ends up doing an
out-of-bounds load.
Rework the code to more explicitly deal with event->oncpu being -1.
Repo
Commit-ID: 451d24d1e5f40bad000fa9abe36ddb16fc9928cb
Gitweb: http://git.kernel.org/tip/451d24d1e5f40bad000fa9abe36ddb16fc9928cb
Author: Peter Zijlstra
AuthorDate: Tue, 31 Jan 2017 11:27:10 +0100
Committer: Ingo Molnar
CommitDate: Fri, 10 Feb 2017 09:04:50 +0100
perf/core: Fix crash
t;
>> which is this C code:
>> perf_event_read():
>> local_cpu = get_cpu();
>> cpu_to_read = find_cpu_to_read(event, local_cpu);
>> put_cpu();
>>
>> find_cpu_to_read():
>> event_pkg = topology_physical_package_id(event_cpu);
>> local_pkg
):
>> local_cpu = get_cpu();
>> cpu_to_read = find_cpu_to_read(event, local_cpu);
>> put_cpu();
>>
>> find_cpu_to_read():
>> event_pkg = topology_physical_package_id(event_cpu);
>> local_pkg = topology_physical_package_id(local_cpu);
>> if
On Tue, Jan 31, 2017 at 11:27:10AM +0100, Peter Zijlstra wrote:
> Subject: perf: Fix crash in perf_event_read()
>
> Alexei had his box explode because doing read() on a package
> (rapl/uncore) event that isn't currently scheduled in ends up doing an
> out-of-bounds load.
>
On Tue, Jan 31, 2017 at 11:27:10AM +0100, Peter Zijlstra wrote:
> Subject: perf: Fix crash in perf_event_read()
>
> Alexei had his box explode because doing read() on a package
> (rapl/uncore) event that isn't currently scheduled in ends up doing an
> out-of-bounds load.
>
== RDI == ffff
> or in other words event->oncpu == -1
> which I think is technically possible here.
>
> Any suggestions how to fix this?
> Happy to test any patches, though I don't know how to reproduce reliably.
Right you are, that's buggered.
Something like the be
pu();
>
> find_cpu_to_read():
> event_pkg = topology_physical_package_id(event_cpu);
> local_pkg = topology_physical_package_id(local_cpu);
> if (event_pkg == local_pkg)
>
> If I read the asm correctly at the time of the crash
> event_cpu == RDI == 00
Hi Peter,
rarely I'm seeing the following crash:
[40196.164255] BUG: unable to handle kernel paging request at a11a
[40196.179636] IP: perf_event_read+0xd3/0x1a0
[40196.188669] PGD 82e93a067
[40196.188670] PUD 7e1ddf067
[40196.194629] PMD 0
[40196.200589]
[40196.208284] Oops:
Hi Peter,
rarely I'm seeing the following crash:
[40196.164255] BUG: unable to handle kernel paging request at a11a
[40196.179636] IP: perf_event_read+0xd3/0x1a0
[40196.188669] PGD 82e93a067
[40196.188670] PUD 7e1ddf067
[40196.194629] PMD 0
[40196.200589]
[40196.208284] Oops:
12 matches
Mail list logo