Skip to content

Commit

Permalink
timer/debug: Change /proc/timer_stats from 0644 to 0600
Browse files Browse the repository at this point in the history
The timer_stats facility should filter and translate PIDs if opened
from a non-initial PID namespace, to avoid leaking information about
the wider system.  It should also not show kernel virtual addresses.
Unfortunately it has now been removed upstream (as redundant)
instead of being fixed.

For stable, fix the leak by restricting access to root only.  A
similar change was already made for the /proc/timer_list file.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
  • Loading branch information
Ben Hutchings committed May 11, 2019
1 parent 9710819 commit 07efa22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/time/timer_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ static int __init init_tstats_procfs(void)
{
struct proc_dir_entry *pe;

pe = proc_create("timer_stats", 0644, NULL, &tstats_fops);
pe = proc_create("timer_stats", 0600, NULL, &tstats_fops);
if (!pe)
return -ENOMEM;
return 0;
Expand Down

0 comments on commit 07efa22

Please sign in to comment.