diff options
| author | Rick Edgecombe <[email protected]> | 2023-06-12 17:11:02 -0700 | 
|---|---|---|
| committer | Dave Hansen <[email protected]> | 2023-08-02 15:01:51 -0700 | 
| commit | 0ee44885fe9cf19eb3870947c8f3c275017e48a7 (patch) | |
| tree | c0214a78e8238d578a6b117018c3576e755db501 /fs/proc/array.c | |
| parent | 1d62c65372ab08599e4cf24af83d004434087ada (diff) | |
x86: Expose thread features in /proc/$PID/status
Applications and loaders can have logic to decide whether to enable
shadow stack. They usually don't report whether shadow stack has been
enabled or not, so there is no way to verify whether an application
actually is protected by shadow stack.
Add two lines in /proc/$PID/status to report enabled and locked features.
Since, this involves referring to arch specific defines in asm/prctl.h,
implement an arch breakout to emit the feature lines.
[Switched to CET, added to commit log]
Co-developed-by: Kirill A. Shutemov <[email protected]>
Signed-off-by: Kirill A. Shutemov <[email protected]>
Signed-off-by: Rick Edgecombe <[email protected]>
Signed-off-by: Dave Hansen <[email protected]>
Reviewed-by: Borislav Petkov (AMD) <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Acked-by: Mike Rapoport (IBM) <[email protected]>
Tested-by: Pengfei Xu <[email protected]>
Tested-by: John Allen <[email protected]>
Tested-by: Kees Cook <[email protected]>
Link: https://lore.kernel.org/all/20230613001108.3040476-37-rick.p.edgecombe%40intel.com
Diffstat (limited to 'fs/proc/array.c')
| -rw-r--r-- | fs/proc/array.c | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/fs/proc/array.c b/fs/proc/array.c index d35bbf35a874..2c2efbe685d8 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -431,6 +431,11 @@ static inline void task_untag_mask(struct seq_file *m, struct mm_struct *mm)  	seq_printf(m, "untag_mask:\t%#lx\n", mm_untag_mask(mm));  } +__weak void arch_proc_pid_thread_features(struct seq_file *m, +					  struct task_struct *task) +{ +} +  int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,  			struct pid *pid, struct task_struct *task)  { @@ -455,6 +460,7 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,  	task_cpus_allowed(m, task);  	cpuset_task_status_allowed(m, task);  	task_context_switch_counts(m, task); +	arch_proc_pid_thread_features(m, task);  	return 0;  } |