linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch V2 0/6] posix-cpu-timers: Fix bogus permission checks
@ 2019-09-23 14:54 Thomas Gleixner
  2019-09-23 14:54 ` [patch V2 1/6] posix-cpu-timers: Restrict timer_create() permissions Thomas Gleixner
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Thomas Gleixner @ 2019-09-23 14:54 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Peter Zijlstra, Ingo Molnar, Oleg Nesterov,
	Michael Kerrisk, Kees Cook

When cleaning up posix-cpu-timers I discovered that the permission checks
for process clocks and process timers are completely bonkers. The only
requirement is that the target PID is a group leader. Which means that any
process can read the clocks and attach timers to any other process without
priviledge restrictions.

That's just wrong because the clocks and timers can be used to observe
behaviour and both reading the clocks and arming timers adds overhead and
influences runtime performance of the target process.

Changes vs. V1:

  - Address the review comments from Frederic

  - Actually return -EPERM when the permission check fails.
    See patch 6/6 for rationale

V1 can be found here:

  https://lore.kernel.org/r/20190905120339.561100423@linutronix.de

I still did not come around to write self tests and won't do so in the next
weeks as I'm traveling as of tomorrow and then going on vacation (finally) :)

Thanks,

	tglx

---
 posix-cpu-timers.c |   71 ++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 49 insertions(+), 22 deletions(-)




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

end of thread, other threads:[~2019-09-23 15:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-23 14:54 [patch V2 0/6] posix-cpu-timers: Fix bogus permission checks Thomas Gleixner
2019-09-23 14:54 ` [patch V2 1/6] posix-cpu-timers: Restrict timer_create() permissions Thomas Gleixner
2019-09-23 14:54 ` [patch V2 2/6] posix-cpu-timers: Restrict clock_gettime() permissions Thomas Gleixner
2019-09-23 14:54 ` [patch V2 3/6] posix-cpu-timers: Sanitize thread clock permissions Thomas Gleixner
2019-09-23 14:54 ` [patch V2 4/6] posix-cpu-timers: Make PID=0 and PID=self handling consistent Thomas Gleixner
2019-09-23 14:54 ` [patch V2 5/6] posix-cpu-timers: Return PTR_ERR() from lookup_task() Thomas Gleixner
2019-09-23 15:43   ` Frederic Weisbecker
2019-09-23 14:54 ` [patch V2 6/6] posix-cpu-timers: Return -EPERM if ptrace permission check fails Thomas Gleixner
2019-09-23 15:46   ` Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).