summaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2019-01-16 10:58:31 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-23 08:10:53 +0100
commitf311b6cd351b540955cf415b17dba4d38886bbeb (patch)
tree7aaa3354a59216f0d8ac871451d2ee7fed4e1743 /fs/proc
parent52befa071a5ec62920e3320c73f550270f948180 (diff)
downloadlinux-stable-f311b6cd351b540955cf415b17dba4d38886bbeb.tar.gz
linux-stable-f311b6cd351b540955cf415b17dba4d38886bbeb.tar.bz2
linux-stable-f311b6cd351b540955cf415b17dba4d38886bbeb.zip
proc: Remove empty line in /proc/self/status
If CONFIG_SECCOMP=n, /proc/self/status includes an empty line. This causes the iotop application to bail out with an error message. File "/usr/local/lib64/python2.7/site-packages/iotop/data.py", line 196, in parse_proc_pid_status key, value = line.split(':\t', 1) ValueError: need more than 1 value to unpack The problem is seen in v4.9.y but not upstream because commit af884cd4a5ae6 ("proc: report no_new_privs state") has not been backported to v4.9.y. The backport of commit fae1fa0fc6cc ("proc: Provide details on speculation flaw mitigations") tried to address the resulting differences but was wrong, introducing the problem. Fixes: 51ef9af2a35b ("proc: Provide details on speculation flaw mitigations") Cc: Kees Cook <keescook@chromium.org> Cc: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/array.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 94f83e74db24..712b44c63701 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -346,8 +346,9 @@ static inline void task_seccomp(struct seq_file *m, struct task_struct *p)
{
#ifdef CONFIG_SECCOMP
seq_put_decimal_ull(m, "Seccomp:\t", p->seccomp.mode);
+ seq_putc(m, '\n');
#endif
- seq_printf(m, "\nSpeculation_Store_Bypass:\t");
+ seq_printf(m, "Speculation_Store_Bypass:\t");
switch (arch_prctl_spec_ctrl_get(p, PR_SPEC_STORE_BYPASS)) {
case -EINVAL:
seq_printf(m, "unknown");