|
@@ -83,6 +83,7 @@
|
|
#include <linux/tracehook.h>
|
|
#include <linux/tracehook.h>
|
|
#include <linux/string_helpers.h>
|
|
#include <linux/string_helpers.h>
|
|
#include <linux/user_namespace.h>
|
|
#include <linux/user_namespace.h>
|
|
|
|
+#include <linux/fs_struct.h>
|
|
|
|
|
|
#include <asm/pgtable.h>
|
|
#include <asm/pgtable.h>
|
|
#include <asm/processor.h>
|
|
#include <asm/processor.h>
|
|
@@ -139,12 +140,25 @@ static inline const char *get_task_state(struct task_struct *tsk)
|
|
return task_state_array[fls(state)];
|
|
return task_state_array[fls(state)];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static inline int get_task_umask(struct task_struct *tsk)
|
|
|
|
+{
|
|
|
|
+ struct fs_struct *fs;
|
|
|
|
+ int umask = -ENOENT;
|
|
|
|
+
|
|
|
|
+ task_lock(tsk);
|
|
|
|
+ fs = tsk->fs;
|
|
|
|
+ if (fs)
|
|
|
|
+ umask = fs->umask;
|
|
|
|
+ task_unlock(tsk);
|
|
|
|
+ return umask;
|
|
|
|
+}
|
|
|
|
+
|
|
static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
|
|
static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
|
|
struct pid *pid, struct task_struct *p)
|
|
struct pid *pid, struct task_struct *p)
|
|
{
|
|
{
|
|
struct user_namespace *user_ns = seq_user_ns(m);
|
|
struct user_namespace *user_ns = seq_user_ns(m);
|
|
struct group_info *group_info;
|
|
struct group_info *group_info;
|
|
- int g;
|
|
|
|
|
|
+ int g, umask;
|
|
struct task_struct *tracer;
|
|
struct task_struct *tracer;
|
|
const struct cred *cred;
|
|
const struct cred *cred;
|
|
pid_t ppid, tpid = 0, tgid, ngid;
|
|
pid_t ppid, tpid = 0, tgid, ngid;
|
|
@@ -162,6 +176,10 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
|
|
ngid = task_numa_group_id(p);
|
|
ngid = task_numa_group_id(p);
|
|
cred = get_task_cred(p);
|
|
cred = get_task_cred(p);
|
|
|
|
|
|
|
|
+ umask = get_task_umask(p);
|
|
|
|
+ if (umask >= 0)
|
|
|
|
+ seq_printf(m, "Umask:\t%#04o\n", umask);
|
|
|
|
+
|
|
task_lock(p);
|
|
task_lock(p);
|
|
if (p->files)
|
|
if (p->files)
|
|
max_fds = files_fdtable(p->files)->max_fds;
|
|
max_fds = files_fdtable(p->files)->max_fds;
|