summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRom Lemarchand <romlem@android.com>2015-03-07 09:38:05 -0800
committerRom Lemarchand <romlem@google.com>2015-03-09 19:49:58 -0700
commit1ba6b2f465b0bd71d0c67bf7b0b0a7e7f5989b98 (patch)
tree11914aa634e8abd67f3bb5c05d2178c532c06ed7
parent6f9f6c4d9e9f28f4242ea4b2d9509512f01dcd57 (diff)
downloadcommon-deprecated/experimental/android-3.18.tar.gz
proc: make oom adjustment files user read-onlyexperimental/android-3.18deprecated/experimental/android-3.18
Make oom_adj and oom_score_adj user read-only. Bug: 19636629 Change-Id: I055bb172d5b4d3d856e25918f3c5de8edf31e4a3 Signed-off-by: Rom Lemarchand <romlem@google.com>
-rw-r--r--fs/proc/base.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 772efa45a452..9416defbb16a 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2550,8 +2550,9 @@ static const struct pid_entry tgid_base_stuff[] = {
ONE("cgroup", S_IRUGO, proc_cgroup_show),
#endif
ONE("oom_score", S_IRUGO, proc_oom_score),
- REG("oom_adj", S_IRUGO|S_IWUSR, proc_oom_adj_operations),
- REG("oom_score_adj", S_IRUGO|S_IWUSR, proc_oom_score_adj_operations),
+ INF("oom_score", S_IRUGO, proc_oom_score),
+ REG("oom_adj", S_IRUSR, proc_oom_adj_operations),
+ REG("oom_score_adj", S_IRUSR, proc_oom_score_adj_operations),
#ifdef CONFIG_AUDITSYSCALL
REG("loginuid", S_IWUSR|S_IRUGO, proc_loginuid_operations),
REG("sessionid", S_IRUGO, proc_sessionid_operations),
@@ -2894,8 +2895,8 @@ static const struct pid_entry tid_base_stuff[] = {
ONE("cgroup", S_IRUGO, proc_cgroup_show),
#endif
ONE("oom_score", S_IRUGO, proc_oom_score),
- REG("oom_adj", S_IRUGO|S_IWUSR, proc_oom_adj_operations),
- REG("oom_score_adj", S_IRUGO|S_IWUSR, proc_oom_score_adj_operations),
+ REG("oom_adj", S_IRUSR, proc_oom_adj_operations),
+ REG("oom_score_adj", S_IRUSR, proc_oom_score_adj_operations),
#ifdef CONFIG_AUDITSYSCALL
REG("loginuid", S_IWUSR|S_IRUGO, proc_loginuid_operations),
REG("sessionid", S_IRUGO, proc_sessionid_operations),