diff options
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r-- | fs/proc/array.c | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index bb1d3619ca12..004077f1a7bf 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> |
@@ -342,6 +343,30 @@ static inline void task_seccomp(struct seq_file *m, struct task_struct *p) | |||
342 | #ifdef CONFIG_SECCOMP | 343 | #ifdef CONFIG_SECCOMP |
343 | seq_put_decimal_ull(m, "\nSeccomp:\t", p->seccomp.mode); | 344 | seq_put_decimal_ull(m, "\nSeccomp:\t", p->seccomp.mode); |
344 | #endif | 345 | #endif |
346 | seq_printf(m, "\nSpeculation_Store_Bypass:\t"); | ||
347 | switch (arch_prctl_spec_ctrl_get(p, PR_SPEC_STORE_BYPASS)) { | ||
348 | case -EINVAL: | ||
349 | seq_printf(m, "unknown"); | ||
350 | break; | ||
351 | case PR_SPEC_NOT_AFFECTED: | ||
352 | seq_printf(m, "not vulnerable"); | ||
353 | break; | ||
354 | case PR_SPEC_PRCTL | PR_SPEC_FORCE_DISABLE: | ||
355 | seq_printf(m, "thread force mitigated"); | ||
356 | break; | ||
357 | case PR_SPEC_PRCTL | PR_SPEC_DISABLE: | ||
358 | seq_printf(m, "thread mitigated"); | ||
359 | break; | ||
360 | case PR_SPEC_PRCTL | PR_SPEC_ENABLE: | ||
361 | seq_printf(m, "thread vulnerable"); | ||
362 | break; | ||
363 | case PR_SPEC_DISABLE: | ||
364 | seq_printf(m, "globally mitigated"); | ||
365 | break; | ||
366 | default: | ||
367 | seq_printf(m, "vulnerable"); | ||
368 | break; | ||
369 | } | ||
345 | seq_putc(m, '\n'); | 370 | seq_putc(m, '\n'); |
346 | } | 371 | } |
347 | 372 | ||
@@ -684,25 +709,22 @@ out: | |||
684 | 709 | ||
685 | static int children_seq_show(struct seq_file *seq, void *v) | 710 | static int children_seq_show(struct seq_file *seq, void *v) |
686 | { | 711 | { |
687 | struct inode *inode = seq->private; | 712 | struct inode *inode = file_inode(seq->file); |
688 | pid_t pid; | ||
689 | |||
690 | pid = pid_nr_ns(v, inode->i_sb->s_fs_info); | ||
691 | seq_printf(seq, "%d ", pid); | ||
692 | 713 | ||
714 | seq_printf(seq, "%d ", pid_nr_ns(v, proc_pid_ns(inode))); | ||
693 | return 0; | 715 | return 0; |
694 | } | 716 | } |
695 | 717 | ||
696 | static void *children_seq_start(struct seq_file *seq, loff_t *pos) | 718 | static void *children_seq_start(struct seq_file *seq, loff_t *pos) |
697 | { | 719 | { |
698 | return get_children_pid(seq->private, NULL, *pos); | 720 | return get_children_pid(file_inode(seq->file), NULL, *pos); |
699 | } | 721 | } |
700 | 722 | ||
701 | static void *children_seq_next(struct seq_file *seq, void *v, loff_t *pos) | 723 | static void *children_seq_next(struct seq_file *seq, void *v, loff_t *pos) |
702 | { | 724 | { |
703 | struct pid *pid; | 725 | struct pid *pid; |
704 | 726 | ||
705 | pid = get_children_pid(seq->private, v, *pos + 1); | 727 | pid = get_children_pid(file_inode(seq->file), v, *pos + 1); |
706 | put_pid(v); | 728 | put_pid(v); |
707 | 729 | ||
708 | ++*pos; | 730 | ++*pos; |
@@ -723,17 +745,7 @@ static const struct seq_operations children_seq_ops = { | |||
723 | 745 | ||
724 | static int children_seq_open(struct inode *inode, struct file *file) | 746 | static int children_seq_open(struct inode *inode, struct file *file) |
725 | { | 747 | { |
726 | struct seq_file *m; | 748 | return seq_open(file, &children_seq_ops); |
727 | int ret; | ||
728 | |||
729 | ret = seq_open(file, &children_seq_ops); | ||
730 | if (ret) | ||
731 | return ret; | ||
732 | |||
733 | m = file->private_data; | ||
734 | m->private = inode; | ||
735 | |||
736 | return ret; | ||
737 | } | 749 | } |
738 | 750 | ||
739 | const struct file_operations proc_tid_children_operations = { | 751 | const struct file_operations proc_tid_children_operations = { |