diff options
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r-- | fs/proc/base.c | 241 |
1 files changed, 200 insertions, 41 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index acb7ef80ea4f..f3d02ca461ec 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -63,6 +63,7 @@ | |||
63 | #include <linux/namei.h> | 63 | #include <linux/namei.h> |
64 | #include <linux/mnt_namespace.h> | 64 | #include <linux/mnt_namespace.h> |
65 | #include <linux/mm.h> | 65 | #include <linux/mm.h> |
66 | #include <linux/swap.h> | ||
66 | #include <linux/rcupdate.h> | 67 | #include <linux/rcupdate.h> |
67 | #include <linux/kallsyms.h> | 68 | #include <linux/kallsyms.h> |
68 | #include <linux/stacktrace.h> | 69 | #include <linux/stacktrace.h> |
@@ -148,18 +149,13 @@ static unsigned int pid_entry_count_dirs(const struct pid_entry *entries, | |||
148 | return count; | 149 | return count; |
149 | } | 150 | } |
150 | 151 | ||
151 | static int get_fs_path(struct task_struct *task, struct path *path, bool root) | 152 | static int get_task_root(struct task_struct *task, struct path *root) |
152 | { | 153 | { |
153 | struct fs_struct *fs; | ||
154 | int result = -ENOENT; | 154 | int result = -ENOENT; |
155 | 155 | ||
156 | task_lock(task); | 156 | task_lock(task); |
157 | fs = task->fs; | 157 | if (task->fs) { |
158 | if (fs) { | 158 | get_fs_root(task->fs, root); |
159 | read_lock(&fs->lock); | ||
160 | *path = root ? fs->root : fs->pwd; | ||
161 | path_get(path); | ||
162 | read_unlock(&fs->lock); | ||
163 | result = 0; | 159 | result = 0; |
164 | } | 160 | } |
165 | task_unlock(task); | 161 | task_unlock(task); |
@@ -172,7 +168,12 @@ static int proc_cwd_link(struct inode *inode, struct path *path) | |||
172 | int result = -ENOENT; | 168 | int result = -ENOENT; |
173 | 169 | ||
174 | if (task) { | 170 | if (task) { |
175 | result = get_fs_path(task, path, 0); | 171 | task_lock(task); |
172 | if (task->fs) { | ||
173 | get_fs_pwd(task->fs, path); | ||
174 | result = 0; | ||
175 | } | ||
176 | task_unlock(task); | ||
176 | put_task_struct(task); | 177 | put_task_struct(task); |
177 | } | 178 | } |
178 | return result; | 179 | return result; |
@@ -184,7 +185,7 @@ static int proc_root_link(struct inode *inode, struct path *path) | |||
184 | int result = -ENOENT; | 185 | int result = -ENOENT; |
185 | 186 | ||
186 | if (task) { | 187 | if (task) { |
187 | result = get_fs_path(task, path, 1); | 188 | result = get_task_root(task, path); |
188 | put_task_struct(task); | 189 | put_task_struct(task); |
189 | } | 190 | } |
190 | return result; | 191 | return result; |
@@ -225,7 +226,7 @@ struct mm_struct *mm_for_maps(struct task_struct *task) | |||
225 | { | 226 | { |
226 | struct mm_struct *mm; | 227 | struct mm_struct *mm; |
227 | 228 | ||
228 | if (mutex_lock_killable(&task->cred_guard_mutex)) | 229 | if (mutex_lock_killable(&task->signal->cred_guard_mutex)) |
229 | return NULL; | 230 | return NULL; |
230 | 231 | ||
231 | mm = get_task_mm(task); | 232 | mm = get_task_mm(task); |
@@ -234,7 +235,7 @@ struct mm_struct *mm_for_maps(struct task_struct *task) | |||
234 | mmput(mm); | 235 | mmput(mm); |
235 | mm = NULL; | 236 | mm = NULL; |
236 | } | 237 | } |
237 | mutex_unlock(&task->cred_guard_mutex); | 238 | mutex_unlock(&task->signal->cred_guard_mutex); |
238 | 239 | ||
239 | return mm; | 240 | return mm; |
240 | } | 241 | } |
@@ -427,17 +428,14 @@ static const struct file_operations proc_lstats_operations = { | |||
427 | 428 | ||
428 | #endif | 429 | #endif |
429 | 430 | ||
430 | /* The badness from the OOM killer */ | ||
431 | unsigned long badness(struct task_struct *p, unsigned long uptime); | ||
432 | static int proc_oom_score(struct task_struct *task, char *buffer) | 431 | static int proc_oom_score(struct task_struct *task, char *buffer) |
433 | { | 432 | { |
434 | unsigned long points = 0; | 433 | unsigned long points = 0; |
435 | struct timespec uptime; | ||
436 | 434 | ||
437 | do_posix_clock_monotonic_gettime(&uptime); | ||
438 | read_lock(&tasklist_lock); | 435 | read_lock(&tasklist_lock); |
439 | if (pid_alive(task)) | 436 | if (pid_alive(task)) |
440 | points = badness(task, uptime.tv_sec); | 437 | points = oom_badness(task, NULL, NULL, |
438 | totalram_pages + total_swap_pages); | ||
441 | read_unlock(&tasklist_lock); | 439 | read_unlock(&tasklist_lock); |
442 | return sprintf(buffer, "%lu\n", points); | 440 | return sprintf(buffer, "%lu\n", points); |
443 | } | 441 | } |
@@ -561,9 +559,19 @@ static int proc_setattr(struct dentry *dentry, struct iattr *attr) | |||
561 | return -EPERM; | 559 | return -EPERM; |
562 | 560 | ||
563 | error = inode_change_ok(inode, attr); | 561 | error = inode_change_ok(inode, attr); |
564 | if (!error) | 562 | if (error) |
565 | error = inode_setattr(inode, attr); | 563 | return error; |
566 | return error; | 564 | |
565 | if ((attr->ia_valid & ATTR_SIZE) && | ||
566 | attr->ia_size != i_size_read(inode)) { | ||
567 | error = vmtruncate(inode, attr->ia_size); | ||
568 | if (error) | ||
569 | return error; | ||
570 | } | ||
571 | |||
572 | setattr_copy(inode, attr); | ||
573 | mark_inode_dirty(inode); | ||
574 | return 0; | ||
567 | } | 575 | } |
568 | 576 | ||
569 | static const struct inode_operations proc_def_inode_operations = { | 577 | static const struct inode_operations proc_def_inode_operations = { |
@@ -589,7 +597,7 @@ static int mounts_open_common(struct inode *inode, struct file *file, | |||
589 | get_mnt_ns(ns); | 597 | get_mnt_ns(ns); |
590 | } | 598 | } |
591 | rcu_read_unlock(); | 599 | rcu_read_unlock(); |
592 | if (ns && get_fs_path(task, &root, 1) == 0) | 600 | if (ns && get_task_root(task, &root) == 0) |
593 | ret = 0; | 601 | ret = 0; |
594 | put_task_struct(task); | 602 | put_task_struct(task); |
595 | } | 603 | } |
@@ -763,6 +771,8 @@ static const struct file_operations proc_single_file_operations = { | |||
763 | static int mem_open(struct inode* inode, struct file* file) | 771 | static int mem_open(struct inode* inode, struct file* file) |
764 | { | 772 | { |
765 | file->private_data = (void*)((long)current->self_exec_id); | 773 | file->private_data = (void*)((long)current->self_exec_id); |
774 | /* OK to pass negative loff_t, we can catch out-of-range */ | ||
775 | file->f_mode |= FMODE_UNSIGNED_OFFSET; | ||
766 | return 0; | 776 | return 0; |
767 | } | 777 | } |
768 | 778 | ||
@@ -1015,36 +1025,74 @@ static ssize_t oom_adjust_write(struct file *file, const char __user *buf, | |||
1015 | memset(buffer, 0, sizeof(buffer)); | 1025 | memset(buffer, 0, sizeof(buffer)); |
1016 | if (count > sizeof(buffer) - 1) | 1026 | if (count > sizeof(buffer) - 1) |
1017 | count = sizeof(buffer) - 1; | 1027 | count = sizeof(buffer) - 1; |
1018 | if (copy_from_user(buffer, buf, count)) | 1028 | if (copy_from_user(buffer, buf, count)) { |
1019 | return -EFAULT; | 1029 | err = -EFAULT; |
1030 | goto out; | ||
1031 | } | ||
1020 | 1032 | ||
1021 | err = strict_strtol(strstrip(buffer), 0, &oom_adjust); | 1033 | err = strict_strtol(strstrip(buffer), 0, &oom_adjust); |
1022 | if (err) | 1034 | if (err) |
1023 | return -EINVAL; | 1035 | goto out; |
1024 | if ((oom_adjust < OOM_ADJUST_MIN || oom_adjust > OOM_ADJUST_MAX) && | 1036 | if ((oom_adjust < OOM_ADJUST_MIN || oom_adjust > OOM_ADJUST_MAX) && |
1025 | oom_adjust != OOM_DISABLE) | 1037 | oom_adjust != OOM_DISABLE) { |
1026 | return -EINVAL; | 1038 | err = -EINVAL; |
1039 | goto out; | ||
1040 | } | ||
1027 | 1041 | ||
1028 | task = get_proc_task(file->f_path.dentry->d_inode); | 1042 | task = get_proc_task(file->f_path.dentry->d_inode); |
1029 | if (!task) | 1043 | if (!task) { |
1030 | return -ESRCH; | 1044 | err = -ESRCH; |
1045 | goto out; | ||
1046 | } | ||
1047 | |||
1048 | task_lock(task); | ||
1049 | if (!task->mm) { | ||
1050 | err = -EINVAL; | ||
1051 | goto err_task_lock; | ||
1052 | } | ||
1053 | |||
1031 | if (!lock_task_sighand(task, &flags)) { | 1054 | if (!lock_task_sighand(task, &flags)) { |
1032 | put_task_struct(task); | 1055 | err = -ESRCH; |
1033 | return -ESRCH; | 1056 | goto err_task_lock; |
1034 | } | 1057 | } |
1035 | 1058 | ||
1036 | if (oom_adjust < task->signal->oom_adj && !capable(CAP_SYS_RESOURCE)) { | 1059 | if (oom_adjust < task->signal->oom_adj && !capable(CAP_SYS_RESOURCE)) { |
1037 | unlock_task_sighand(task, &flags); | 1060 | err = -EACCES; |
1038 | put_task_struct(task); | 1061 | goto err_sighand; |
1039 | return -EACCES; | ||
1040 | } | 1062 | } |
1041 | 1063 | ||
1042 | task->signal->oom_adj = oom_adjust; | 1064 | if (oom_adjust != task->signal->oom_adj) { |
1065 | if (oom_adjust == OOM_DISABLE) | ||
1066 | atomic_inc(&task->mm->oom_disable_count); | ||
1067 | if (task->signal->oom_adj == OOM_DISABLE) | ||
1068 | atomic_dec(&task->mm->oom_disable_count); | ||
1069 | } | ||
1043 | 1070 | ||
1071 | /* | ||
1072 | * Warn that /proc/pid/oom_adj is deprecated, see | ||
1073 | * Documentation/feature-removal-schedule.txt. | ||
1074 | */ | ||
1075 | printk_once(KERN_WARNING "%s (%d): /proc/%d/oom_adj is deprecated, " | ||
1076 | "please use /proc/%d/oom_score_adj instead.\n", | ||
1077 | current->comm, task_pid_nr(current), | ||
1078 | task_pid_nr(task), task_pid_nr(task)); | ||
1079 | task->signal->oom_adj = oom_adjust; | ||
1080 | /* | ||
1081 | * Scale /proc/pid/oom_score_adj appropriately ensuring that a maximum | ||
1082 | * value is always attainable. | ||
1083 | */ | ||
1084 | if (task->signal->oom_adj == OOM_ADJUST_MAX) | ||
1085 | task->signal->oom_score_adj = OOM_SCORE_ADJ_MAX; | ||
1086 | else | ||
1087 | task->signal->oom_score_adj = (oom_adjust * OOM_SCORE_ADJ_MAX) / | ||
1088 | -OOM_DISABLE; | ||
1089 | err_sighand: | ||
1044 | unlock_task_sighand(task, &flags); | 1090 | unlock_task_sighand(task, &flags); |
1091 | err_task_lock: | ||
1092 | task_unlock(task); | ||
1045 | put_task_struct(task); | 1093 | put_task_struct(task); |
1046 | 1094 | out: | |
1047 | return count; | 1095 | return err < 0 ? err : count; |
1048 | } | 1096 | } |
1049 | 1097 | ||
1050 | static const struct file_operations proc_oom_adjust_operations = { | 1098 | static const struct file_operations proc_oom_adjust_operations = { |
@@ -1053,6 +1101,106 @@ static const struct file_operations proc_oom_adjust_operations = { | |||
1053 | .llseek = generic_file_llseek, | 1101 | .llseek = generic_file_llseek, |
1054 | }; | 1102 | }; |
1055 | 1103 | ||
1104 | static ssize_t oom_score_adj_read(struct file *file, char __user *buf, | ||
1105 | size_t count, loff_t *ppos) | ||
1106 | { | ||
1107 | struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode); | ||
1108 | char buffer[PROC_NUMBUF]; | ||
1109 | int oom_score_adj = OOM_SCORE_ADJ_MIN; | ||
1110 | unsigned long flags; | ||
1111 | size_t len; | ||
1112 | |||
1113 | if (!task) | ||
1114 | return -ESRCH; | ||
1115 | if (lock_task_sighand(task, &flags)) { | ||
1116 | oom_score_adj = task->signal->oom_score_adj; | ||
1117 | unlock_task_sighand(task, &flags); | ||
1118 | } | ||
1119 | put_task_struct(task); | ||
1120 | len = snprintf(buffer, sizeof(buffer), "%d\n", oom_score_adj); | ||
1121 | return simple_read_from_buffer(buf, count, ppos, buffer, len); | ||
1122 | } | ||
1123 | |||
1124 | static ssize_t oom_score_adj_write(struct file *file, const char __user *buf, | ||
1125 | size_t count, loff_t *ppos) | ||
1126 | { | ||
1127 | struct task_struct *task; | ||
1128 | char buffer[PROC_NUMBUF]; | ||
1129 | unsigned long flags; | ||
1130 | long oom_score_adj; | ||
1131 | int err; | ||
1132 | |||
1133 | memset(buffer, 0, sizeof(buffer)); | ||
1134 | if (count > sizeof(buffer) - 1) | ||
1135 | count = sizeof(buffer) - 1; | ||
1136 | if (copy_from_user(buffer, buf, count)) { | ||
1137 | err = -EFAULT; | ||
1138 | goto out; | ||
1139 | } | ||
1140 | |||
1141 | err = strict_strtol(strstrip(buffer), 0, &oom_score_adj); | ||
1142 | if (err) | ||
1143 | goto out; | ||
1144 | if (oom_score_adj < OOM_SCORE_ADJ_MIN || | ||
1145 | oom_score_adj > OOM_SCORE_ADJ_MAX) { | ||
1146 | err = -EINVAL; | ||
1147 | goto out; | ||
1148 | } | ||
1149 | |||
1150 | task = get_proc_task(file->f_path.dentry->d_inode); | ||
1151 | if (!task) { | ||
1152 | err = -ESRCH; | ||
1153 | goto out; | ||
1154 | } | ||
1155 | |||
1156 | task_lock(task); | ||
1157 | if (!task->mm) { | ||
1158 | err = -EINVAL; | ||
1159 | goto err_task_lock; | ||
1160 | } | ||
1161 | |||
1162 | if (!lock_task_sighand(task, &flags)) { | ||
1163 | err = -ESRCH; | ||
1164 | goto err_task_lock; | ||
1165 | } | ||
1166 | |||
1167 | if (oom_score_adj < task->signal->oom_score_adj && | ||
1168 | !capable(CAP_SYS_RESOURCE)) { | ||
1169 | err = -EACCES; | ||
1170 | goto err_sighand; | ||
1171 | } | ||
1172 | |||
1173 | if (oom_score_adj != task->signal->oom_score_adj) { | ||
1174 | if (oom_score_adj == OOM_SCORE_ADJ_MIN) | ||
1175 | atomic_inc(&task->mm->oom_disable_count); | ||
1176 | if (task->signal->oom_score_adj == OOM_SCORE_ADJ_MIN) | ||
1177 | atomic_dec(&task->mm->oom_disable_count); | ||
1178 | } | ||
1179 | task->signal->oom_score_adj = oom_score_adj; | ||
1180 | /* | ||
1181 | * Scale /proc/pid/oom_adj appropriately ensuring that OOM_DISABLE is | ||
1182 | * always attainable. | ||
1183 | */ | ||
1184 | if (task->signal->oom_score_adj == OOM_SCORE_ADJ_MIN) | ||
1185 | task->signal->oom_adj = OOM_DISABLE; | ||
1186 | else | ||
1187 | task->signal->oom_adj = (oom_score_adj * OOM_ADJUST_MAX) / | ||
1188 | OOM_SCORE_ADJ_MAX; | ||
1189 | err_sighand: | ||
1190 | unlock_task_sighand(task, &flags); | ||
1191 | err_task_lock: | ||
1192 | task_unlock(task); | ||
1193 | put_task_struct(task); | ||
1194 | out: | ||
1195 | return err < 0 ? err : count; | ||
1196 | } | ||
1197 | |||
1198 | static const struct file_operations proc_oom_score_adj_operations = { | ||
1199 | .read = oom_score_adj_read, | ||
1200 | .write = oom_score_adj_write, | ||
1201 | .llseek = default_llseek, | ||
1202 | }; | ||
1203 | |||
1056 | #ifdef CONFIG_AUDITSYSCALL | 1204 | #ifdef CONFIG_AUDITSYSCALL |
1057 | #define TMPBUFLEN 21 | 1205 | #define TMPBUFLEN 21 |
1058 | static ssize_t proc_loginuid_read(struct file * file, char __user * buf, | 1206 | static ssize_t proc_loginuid_read(struct file * file, char __user * buf, |
@@ -1426,7 +1574,7 @@ static int do_proc_readlink(struct path *path, char __user *buffer, int buflen) | |||
1426 | if (!tmp) | 1574 | if (!tmp) |
1427 | return -ENOMEM; | 1575 | return -ENOMEM; |
1428 | 1576 | ||
1429 | pathname = d_path(path, tmp, PAGE_SIZE); | 1577 | pathname = d_path_with_unreachable(path, tmp, PAGE_SIZE); |
1430 | len = PTR_ERR(pathname); | 1578 | len = PTR_ERR(pathname); |
1431 | if (IS_ERR(pathname)) | 1579 | if (IS_ERR(pathname)) |
1432 | goto out; | 1580 | goto out; |
@@ -1500,6 +1648,7 @@ static struct inode *proc_pid_make_inode(struct super_block * sb, struct task_st | |||
1500 | 1648 | ||
1501 | /* Common stuff */ | 1649 | /* Common stuff */ |
1502 | ei = PROC_I(inode); | 1650 | ei = PROC_I(inode); |
1651 | inode->i_ino = get_next_ino(); | ||
1503 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; | 1652 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; |
1504 | inode->i_op = &proc_def_inode_operations; | 1653 | inode->i_op = &proc_def_inode_operations; |
1505 | 1654 | ||
@@ -1939,11 +2088,13 @@ static ssize_t proc_fdinfo_read(struct file *file, char __user *buf, | |||
1939 | static const struct file_operations proc_fdinfo_file_operations = { | 2088 | static const struct file_operations proc_fdinfo_file_operations = { |
1940 | .open = nonseekable_open, | 2089 | .open = nonseekable_open, |
1941 | .read = proc_fdinfo_read, | 2090 | .read = proc_fdinfo_read, |
2091 | .llseek = no_llseek, | ||
1942 | }; | 2092 | }; |
1943 | 2093 | ||
1944 | static const struct file_operations proc_fd_operations = { | 2094 | static const struct file_operations proc_fd_operations = { |
1945 | .read = generic_read_dir, | 2095 | .read = generic_read_dir, |
1946 | .readdir = proc_readfd, | 2096 | .readdir = proc_readfd, |
2097 | .llseek = default_llseek, | ||
1947 | }; | 2098 | }; |
1948 | 2099 | ||
1949 | /* | 2100 | /* |
@@ -2012,6 +2163,7 @@ static int proc_readfdinfo(struct file *filp, void *dirent, filldir_t filldir) | |||
2012 | static const struct file_operations proc_fdinfo_operations = { | 2163 | static const struct file_operations proc_fdinfo_operations = { |
2013 | .read = generic_read_dir, | 2164 | .read = generic_read_dir, |
2014 | .readdir = proc_readfdinfo, | 2165 | .readdir = proc_readfdinfo, |
2166 | .llseek = default_llseek, | ||
2015 | }; | 2167 | }; |
2016 | 2168 | ||
2017 | /* | 2169 | /* |
@@ -2202,14 +2354,14 @@ static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf, | |||
2202 | goto out_free; | 2354 | goto out_free; |
2203 | 2355 | ||
2204 | /* Guard against adverse ptrace interaction */ | 2356 | /* Guard against adverse ptrace interaction */ |
2205 | length = mutex_lock_interruptible(&task->cred_guard_mutex); | 2357 | length = mutex_lock_interruptible(&task->signal->cred_guard_mutex); |
2206 | if (length < 0) | 2358 | if (length < 0) |
2207 | goto out_free; | 2359 | goto out_free; |
2208 | 2360 | ||
2209 | length = security_setprocattr(task, | 2361 | length = security_setprocattr(task, |
2210 | (char*)file->f_path.dentry->d_name.name, | 2362 | (char*)file->f_path.dentry->d_name.name, |
2211 | (void*)page, count); | 2363 | (void*)page, count); |
2212 | mutex_unlock(&task->cred_guard_mutex); | 2364 | mutex_unlock(&task->signal->cred_guard_mutex); |
2213 | out_free: | 2365 | out_free: |
2214 | free_page((unsigned long) page); | 2366 | free_page((unsigned long) page); |
2215 | out: | 2367 | out: |
@@ -2243,6 +2395,7 @@ static int proc_attr_dir_readdir(struct file * filp, | |||
2243 | static const struct file_operations proc_attr_dir_operations = { | 2395 | static const struct file_operations proc_attr_dir_operations = { |
2244 | .read = generic_read_dir, | 2396 | .read = generic_read_dir, |
2245 | .readdir = proc_attr_dir_readdir, | 2397 | .readdir = proc_attr_dir_readdir, |
2398 | .llseek = default_llseek, | ||
2246 | }; | 2399 | }; |
2247 | 2400 | ||
2248 | static struct dentry *proc_attr_dir_lookup(struct inode *dir, | 2401 | static struct dentry *proc_attr_dir_lookup(struct inode *dir, |
@@ -2442,6 +2595,7 @@ static struct dentry *proc_base_instantiate(struct inode *dir, | |||
2442 | 2595 | ||
2443 | /* Initialize the inode */ | 2596 | /* Initialize the inode */ |
2444 | ei = PROC_I(inode); | 2597 | ei = PROC_I(inode); |
2598 | inode->i_ino = get_next_ino(); | ||
2445 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; | 2599 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; |
2446 | 2600 | ||
2447 | /* | 2601 | /* |
@@ -2575,7 +2729,7 @@ static const struct pid_entry tgid_base_stuff[] = { | |||
2575 | INF("auxv", S_IRUSR, proc_pid_auxv), | 2729 | INF("auxv", S_IRUSR, proc_pid_auxv), |
2576 | ONE("status", S_IRUGO, proc_pid_status), | 2730 | ONE("status", S_IRUGO, proc_pid_status), |
2577 | ONE("personality", S_IRUSR, proc_pid_personality), | 2731 | ONE("personality", S_IRUSR, proc_pid_personality), |
2578 | INF("limits", S_IRUSR, proc_pid_limits), | 2732 | INF("limits", S_IRUGO, proc_pid_limits), |
2579 | #ifdef CONFIG_SCHED_DEBUG | 2733 | #ifdef CONFIG_SCHED_DEBUG |
2580 | REG("sched", S_IRUGO|S_IWUSR, proc_pid_sched_operations), | 2734 | REG("sched", S_IRUGO|S_IWUSR, proc_pid_sched_operations), |
2581 | #endif | 2735 | #endif |
@@ -2625,6 +2779,7 @@ static const struct pid_entry tgid_base_stuff[] = { | |||
2625 | #endif | 2779 | #endif |
2626 | INF("oom_score", S_IRUGO, proc_oom_score), | 2780 | INF("oom_score", S_IRUGO, proc_oom_score), |
2627 | REG("oom_adj", S_IRUGO|S_IWUSR, proc_oom_adjust_operations), | 2781 | REG("oom_adj", S_IRUGO|S_IWUSR, proc_oom_adjust_operations), |
2782 | REG("oom_score_adj", S_IRUGO|S_IWUSR, proc_oom_score_adj_operations), | ||
2628 | #ifdef CONFIG_AUDITSYSCALL | 2783 | #ifdef CONFIG_AUDITSYSCALL |
2629 | REG("loginuid", S_IWUSR|S_IRUGO, proc_loginuid_operations), | 2784 | REG("loginuid", S_IWUSR|S_IRUGO, proc_loginuid_operations), |
2630 | REG("sessionid", S_IRUGO, proc_sessionid_operations), | 2785 | REG("sessionid", S_IRUGO, proc_sessionid_operations), |
@@ -2650,6 +2805,7 @@ static int proc_tgid_base_readdir(struct file * filp, | |||
2650 | static const struct file_operations proc_tgid_base_operations = { | 2805 | static const struct file_operations proc_tgid_base_operations = { |
2651 | .read = generic_read_dir, | 2806 | .read = generic_read_dir, |
2652 | .readdir = proc_tgid_base_readdir, | 2807 | .readdir = proc_tgid_base_readdir, |
2808 | .llseek = default_llseek, | ||
2653 | }; | 2809 | }; |
2654 | 2810 | ||
2655 | static struct dentry *proc_tgid_base_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd){ | 2811 | static struct dentry *proc_tgid_base_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd){ |
@@ -2910,7 +3066,7 @@ static const struct pid_entry tid_base_stuff[] = { | |||
2910 | INF("auxv", S_IRUSR, proc_pid_auxv), | 3066 | INF("auxv", S_IRUSR, proc_pid_auxv), |
2911 | ONE("status", S_IRUGO, proc_pid_status), | 3067 | ONE("status", S_IRUGO, proc_pid_status), |
2912 | ONE("personality", S_IRUSR, proc_pid_personality), | 3068 | ONE("personality", S_IRUSR, proc_pid_personality), |
2913 | INF("limits", S_IRUSR, proc_pid_limits), | 3069 | INF("limits", S_IRUGO, proc_pid_limits), |
2914 | #ifdef CONFIG_SCHED_DEBUG | 3070 | #ifdef CONFIG_SCHED_DEBUG |
2915 | REG("sched", S_IRUGO|S_IWUSR, proc_pid_sched_operations), | 3071 | REG("sched", S_IRUGO|S_IWUSR, proc_pid_sched_operations), |
2916 | #endif | 3072 | #endif |
@@ -2959,6 +3115,7 @@ static const struct pid_entry tid_base_stuff[] = { | |||
2959 | #endif | 3115 | #endif |
2960 | INF("oom_score", S_IRUGO, proc_oom_score), | 3116 | INF("oom_score", S_IRUGO, proc_oom_score), |
2961 | REG("oom_adj", S_IRUGO|S_IWUSR, proc_oom_adjust_operations), | 3117 | REG("oom_adj", S_IRUGO|S_IWUSR, proc_oom_adjust_operations), |
3118 | REG("oom_score_adj", S_IRUGO|S_IWUSR, proc_oom_score_adj_operations), | ||
2962 | #ifdef CONFIG_AUDITSYSCALL | 3119 | #ifdef CONFIG_AUDITSYSCALL |
2963 | REG("loginuid", S_IWUSR|S_IRUGO, proc_loginuid_operations), | 3120 | REG("loginuid", S_IWUSR|S_IRUGO, proc_loginuid_operations), |
2964 | REG("sessionid", S_IRUSR, proc_sessionid_operations), | 3121 | REG("sessionid", S_IRUSR, proc_sessionid_operations), |
@@ -2986,6 +3143,7 @@ static struct dentry *proc_tid_base_lookup(struct inode *dir, struct dentry *den | |||
2986 | static const struct file_operations proc_tid_base_operations = { | 3143 | static const struct file_operations proc_tid_base_operations = { |
2987 | .read = generic_read_dir, | 3144 | .read = generic_read_dir, |
2988 | .readdir = proc_tid_base_readdir, | 3145 | .readdir = proc_tid_base_readdir, |
3146 | .llseek = default_llseek, | ||
2989 | }; | 3147 | }; |
2990 | 3148 | ||
2991 | static const struct inode_operations proc_tid_base_inode_operations = { | 3149 | static const struct inode_operations proc_tid_base_inode_operations = { |
@@ -3222,4 +3380,5 @@ static const struct inode_operations proc_task_inode_operations = { | |||
3222 | static const struct file_operations proc_task_operations = { | 3380 | static const struct file_operations proc_task_operations = { |
3223 | .read = generic_read_dir, | 3381 | .read = generic_read_dir, |
3224 | .readdir = proc_task_readdir, | 3382 | .readdir = proc_task_readdir, |
3383 | .llseek = default_llseek, | ||
3225 | }; | 3384 | }; |