aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r--fs/proc/array.c48
1 files changed, 30 insertions, 18 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index ae2c807fd719..e6d7f41b6684 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -85,6 +85,7 @@
85#include <linux/delayacct.h> 85#include <linux/delayacct.h>
86#include <linux/seq_file.h> 86#include <linux/seq_file.h>
87#include <linux/pid_namespace.h> 87#include <linux/pid_namespace.h>
88#include <linux/prctl.h>
88#include <linux/ptrace.h> 89#include <linux/ptrace.h>
89#include <linux/tracehook.h> 90#include <linux/tracehook.h>
90#include <linux/string_helpers.h> 91#include <linux/string_helpers.h>
@@ -335,6 +336,30 @@ static inline void task_seccomp(struct seq_file *m, struct task_struct *p)
335#ifdef CONFIG_SECCOMP 336#ifdef CONFIG_SECCOMP
336 seq_put_decimal_ull(m, "\nSeccomp:\t", p->seccomp.mode); 337 seq_put_decimal_ull(m, "\nSeccomp:\t", p->seccomp.mode);
337#endif 338#endif
339 seq_printf(m, "\nSpeculation_Store_Bypass:\t");
340 switch (arch_prctl_spec_ctrl_get(p, PR_SPEC_STORE_BYPASS)) {
341 case -EINVAL:
342 seq_printf(m, "unknown");
343 break;
344 case PR_SPEC_NOT_AFFECTED:
345 seq_printf(m, "not vulnerable");
346 break;
347 case PR_SPEC_PRCTL | PR_SPEC_FORCE_DISABLE:
348 seq_printf(m, "thread force mitigated");
349 break;
350 case PR_SPEC_PRCTL | PR_SPEC_DISABLE:
351 seq_printf(m, "thread mitigated");
352 break;
353 case PR_SPEC_PRCTL | PR_SPEC_ENABLE:
354 seq_printf(m, "thread vulnerable");
355 break;
356 case PR_SPEC_DISABLE:
357 seq_printf(m, "globally mitigated");
358 break;
359 default:
360 seq_printf(m, "vulnerable");
361 break;
362 }
338 seq_putc(m, '\n'); 363 seq_putc(m, '\n');
339} 364}
340 365
@@ -677,25 +702,22 @@ out:
677 702
678static int children_seq_show(struct seq_file *seq, void *v) 703static int children_seq_show(struct seq_file *seq, void *v)
679{ 704{
680 struct inode *inode = seq->private; 705 struct inode *inode = file_inode(seq->file);
681 pid_t pid;
682
683 pid = pid_nr_ns(v, inode->i_sb->s_fs_info);
684 seq_printf(seq, "%d ", pid);
685 706
707 seq_printf(seq, "%d ", pid_nr_ns(v, proc_pid_ns(inode)));
686 return 0; 708 return 0;
687} 709}
688 710
689static void *children_seq_start(struct seq_file *seq, loff_t *pos) 711static void *children_seq_start(struct seq_file *seq, loff_t *pos)
690{ 712{
691 return get_children_pid(seq->private, NULL, *pos); 713 return get_children_pid(file_inode(seq->file), NULL, *pos);
692} 714}
693 715
694static void *children_seq_next(struct seq_file *seq, void *v, loff_t *pos) 716static void *children_seq_next(struct seq_file *seq, void *v, loff_t *pos)
695{ 717{
696 struct pid *pid; 718 struct pid *pid;
697 719
698 pid = get_children_pid(seq->private, v, *pos + 1); 720 pid = get_children_pid(file_inode(seq->file), v, *pos + 1);
699 put_pid(v); 721 put_pid(v);
700 722
701 ++*pos; 723 ++*pos;
@@ -716,17 +738,7 @@ static const struct seq_operations children_seq_ops = {
716 738
717static int children_seq_open(struct inode *inode, struct file *file) 739static int children_seq_open(struct inode *inode, struct file *file)
718{ 740{
719 struct seq_file *m; 741 return seq_open(file, &children_seq_ops);
720 int ret;
721
722 ret = seq_open(file, &children_seq_ops);
723 if (ret)
724 return ret;
725
726 m = file->private_data;
727 m->private = inode;
728
729 return ret;
730} 742}
731 743
732const struct file_operations proc_tid_children_operations = { 744const struct file_operations proc_tid_children_operations = {