lkml.org 
[lkml]   [2015]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/2] perf/x86/intel/ds: Work around BTS leaking kernel addresses
Date
Ingo Molnar <mingo@kernel.org> writes:

> * Alexander Shishkin <alexander.shishkin@linux.intel.com> wrote:
>
>> + for (at = base; at < top; at++) {
>> + /*
>> + * Note that right now *this* BTS code only works if
>> + * attr::exclude_kernel is set, but let's keep this extra
>> + * check here in case that changes.
>> + */
>> + if (event->attr.exclude_kernel &&
>> + (at->from >= PAGE_OFFSET || at->to >= PAGE_OFFSET))
>> + skip++;
>
> Yeah, so that only works on 32-bit kernels, on 64-bit kernels the check for kernel
> addresses is to see whether it's a negative address. PAGE_OFFSET points to above
> any hypervisor's address, so even with your fix we could still leak hypervisor
> addresses.
>
> I.e. use the kernel_ip() primitive instead.

That's what I've been looking for, thanks!

Regards,
--
Alex


\
 
 \ /
  Last update: 2015-08-28 08:21    [W:0.179 / U:0.816 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site