posix-cpu-timers: Fallout fixes and permission tightening
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest6 patches 15 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | posix-cpu-timers: Always clear head pointer on dequeueinclude/ | +3 | 1 reply | |
| 2/6 | posix-cpu-timers: Fix permission check regressionkernel/ | +31 | 4 replies | |
| 3/6 | posix-cpu-timers: Restrict timer_create() permissionskernel/ | +17 | 1 reply | |
| 4/6 | posix-cpu-timers: Restrict clock_gettime() permissionskernel/ | +12 | 1 reply | |
| 5/6 | posix-cpu-timers: Sanitize thread clock permissionskernel/ | +29 | 3 replies | |
| 6/6 | posix-cpu-timers: Make PID=0 and PID=self handling consistentkernel/ | +8 | 2 replies |
Reviews trailers per patch
All 6 patches have a Reviewed-by or Acked-by.
| Patch | Frederic Weisbecker |
|---|---|
| 1/6 | R-b |
| 2/6 | R-b |
| 3/6 | R-b |
| 4/6 | R-b |
| 5/6 | R-b |
| 6/6 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [patch 0/6] posix-cpu-timers: Fallout fixes and permission tightening
Sysbot triggered an issue in the posix timer rework which was trivial to fix, but after running another test case I discovered that the rework broke the permission checks subtly. That's also a straightforward fix.
Though when staring at it 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.
The last 4 patches deal with that and introduce ptrace based permission checks and also make the behaviour consistent between thread and process timers/clocks.
Thanks,
tglx
--- include/linux/posix-timers.h | 9 +--- kernel/time/posix-cpu-timers.c | 78 ++++++++++++++++++++++++++++++++++------- 2 files changed, 69 insertions(+), 18 deletions(-)