public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Tightening up rdpmc permissions?
@ 2014-09-29 16:39 Andy Lutomirski
  2014-09-29 16:48 ` Peter Zijlstra
  2014-09-29 17:36 ` Valdis.Kletnieks
  0 siblings, 2 replies; 5+ messages in thread
From: Andy Lutomirski @ 2014-09-29 16:39 UTC (permalink / raw)
  To: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, linux-kernel@vger.kernel.org

I was surprised to notice that, by default, every task has permission
to use rdpmc.  seccomp cannot work around this.  This leaks
information, although the information leaked is of dubious and
variable value to an attacker.  It also renders the PR_TSC_SEGV
mechanism mostly useless.

Would it make sense to restrict rdpmc to tasks that are in mms that
have a perf_event mapping?  After all, unless I misunderstand
something, user code can't reliably use rdpmc unless they've mapped a
perf_event object to check the rdpmc bit and figure out what ecx value
to use.

I think that this could be implemented with very little overhead,
especially if combined with the existing CR4_TSD code and if that code
were taught to avoid reading cr4.

--Andy

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-10-08 23:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-29 16:39 Tightening up rdpmc permissions? Andy Lutomirski
2014-09-29 16:48 ` Peter Zijlstra
2014-09-29 17:36 ` Valdis.Kletnieks
2014-09-29 18:42   ` Andy Lutomirski
2014-10-08 23:47     ` Andy Lutomirski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox