diff options
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r-- | fs/proc/base.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 91a1bd67ac1d..8a10f6fe24a1 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -1036,6 +1036,26 @@ static const struct file_operations proc_loginuid_operations = { | |||
1036 | .read = proc_loginuid_read, | 1036 | .read = proc_loginuid_read, |
1037 | .write = proc_loginuid_write, | 1037 | .write = proc_loginuid_write, |
1038 | }; | 1038 | }; |
1039 | |||
1040 | static ssize_t proc_sessionid_read(struct file * file, char __user * buf, | ||
1041 | size_t count, loff_t *ppos) | ||
1042 | { | ||
1043 | struct inode * inode = file->f_path.dentry->d_inode; | ||
1044 | struct task_struct *task = get_proc_task(inode); | ||
1045 | ssize_t length; | ||
1046 | char tmpbuf[TMPBUFLEN]; | ||
1047 | |||
1048 | if (!task) | ||
1049 | return -ESRCH; | ||
1050 | length = scnprintf(tmpbuf, TMPBUFLEN, "%u", | ||
1051 | audit_get_sessionid(task)); | ||
1052 | put_task_struct(task); | ||
1053 | return simple_read_from_buffer(buf, count, ppos, tmpbuf, length); | ||
1054 | } | ||
1055 | |||
1056 | static const struct file_operations proc_sessionid_operations = { | ||
1057 | .read = proc_sessionid_read, | ||
1058 | }; | ||
1039 | #endif | 1059 | #endif |
1040 | 1060 | ||
1041 | #ifdef CONFIG_FAULT_INJECTION | 1061 | #ifdef CONFIG_FAULT_INJECTION |
@@ -2269,6 +2289,9 @@ static const struct pid_entry tgid_base_stuff[] = { | |||
2269 | DIR("task", S_IRUGO|S_IXUGO, task), | 2289 | DIR("task", S_IRUGO|S_IXUGO, task), |
2270 | DIR("fd", S_IRUSR|S_IXUSR, fd), | 2290 | DIR("fd", S_IRUSR|S_IXUSR, fd), |
2271 | DIR("fdinfo", S_IRUSR|S_IXUSR, fdinfo), | 2291 | DIR("fdinfo", S_IRUSR|S_IXUSR, fdinfo), |
2292 | #ifdef CONFIG_NET | ||
2293 | DIR("net", S_IRUGO|S_IXUSR, net), | ||
2294 | #endif | ||
2272 | REG("environ", S_IRUSR, environ), | 2295 | REG("environ", S_IRUSR, environ), |
2273 | INF("auxv", S_IRUSR, pid_auxv), | 2296 | INF("auxv", S_IRUSR, pid_auxv), |
2274 | ONE("status", S_IRUGO, pid_status), | 2297 | ONE("status", S_IRUGO, pid_status), |
@@ -2316,6 +2339,7 @@ static const struct pid_entry tgid_base_stuff[] = { | |||
2316 | REG("oom_adj", S_IRUGO|S_IWUSR, oom_adjust), | 2339 | REG("oom_adj", S_IRUGO|S_IWUSR, oom_adjust), |
2317 | #ifdef CONFIG_AUDITSYSCALL | 2340 | #ifdef CONFIG_AUDITSYSCALL |
2318 | REG("loginuid", S_IWUSR|S_IRUGO, loginuid), | 2341 | REG("loginuid", S_IWUSR|S_IRUGO, loginuid), |
2342 | REG("sessionid", S_IRUSR, sessionid), | ||
2319 | #endif | 2343 | #endif |
2320 | #ifdef CONFIG_FAULT_INJECTION | 2344 | #ifdef CONFIG_FAULT_INJECTION |
2321 | REG("make-it-fail", S_IRUGO|S_IWUSR, fault_inject), | 2345 | REG("make-it-fail", S_IRUGO|S_IWUSR, fault_inject), |
@@ -2646,6 +2670,7 @@ static const struct pid_entry tid_base_stuff[] = { | |||
2646 | REG("oom_adj", S_IRUGO|S_IWUSR, oom_adjust), | 2670 | REG("oom_adj", S_IRUGO|S_IWUSR, oom_adjust), |
2647 | #ifdef CONFIG_AUDITSYSCALL | 2671 | #ifdef CONFIG_AUDITSYSCALL |
2648 | REG("loginuid", S_IWUSR|S_IRUGO, loginuid), | 2672 | REG("loginuid", S_IWUSR|S_IRUGO, loginuid), |
2673 | REG("sessionid", S_IRUSR, sessionid), | ||
2649 | #endif | 2674 | #endif |
2650 | #ifdef CONFIG_FAULT_INJECTION | 2675 | #ifdef CONFIG_FAULT_INJECTION |
2651 | REG("make-it-fail", S_IRUGO|S_IWUSR, fault_inject), | 2676 | REG("make-it-fail", S_IRUGO|S_IWUSR, fault_inject), |