All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@infradead.org>
Subject: Re: [PATCH 1/2] perf/x86/intel/ds: Work around BTS leaking kernel addresses
Date: Fri, 28 Aug 2015 07:30:37 +0200	[thread overview]
Message-ID: <20150828053037.GB26741@gmail.com> (raw)
In-Reply-To: <1440688422-27954-2-git-send-email-alexander.shishkin@linux.intel.com>


* 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.

Thanks,

	Ingo

  reply	other threads:[~2015-08-28  5:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-27 15:13 [PATCH 0/2] perf/x86/intel: Work around BTS leaking kernel addresses Alexander Shishkin
2015-08-27 15:13 ` [PATCH 1/2] perf/x86/intel/ds: " Alexander Shishkin
2015-08-28  5:30   ` Ingo Molnar [this message]
2015-08-28  6:06     ` Alexander Shishkin
2015-08-27 15:13 ` [PATCH 2/2] perf/x86/intel/bts: Disallow use by unprivileged users on paranoid systems Alexander Shishkin
2015-08-28  5:31   ` Ingo Molnar
2015-08-28  9:40     ` Alexander Shishkin

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=20150828053037.GB26741@gmail.com \
    --to=mingo@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@infradead.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.