Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 362F1C43387 for ; Wed, 16 Jan 2019 18:58:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EE54320868 for ; Wed, 16 Jan 2019 18:58:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="I/0lUIxO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729085AbfAPS6h (ORCPT ); Wed, 16 Jan 2019 13:58:37 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:38120 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728926AbfAPS6h (ORCPT ); Wed, 16 Jan 2019 13:58:37 -0500 Received: by mail-pg1-f196.google.com with SMTP id g189so3222199pgc.5 for ; Wed, 16 Jan 2019 10:58:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=9vqWNLQzQLS7x0eZdIYawFOcZ4MwvtKNLCwNySbGY0w=; b=I/0lUIxO0f3p3jFq4lfSH9rYktEnjkIwXGzYxR69PEBuyzLYLjEYEA9OMLOp0IU1hx f5HlSlAUkIP08d9vfc6oM+vbOrd2d4lQeLlzCvxuYJCZOqmhCbJCH1bY5FLj+PTkXGfT CkCXVKI8HbQ+4+zwLCyubZ06EvCV7ADGWG2wILkr6/L0EWwswuCVTcXam++DcJtCFmxT WM3r2Qx4/YtkoXnQ6TgjYL+N+SbDcSQaw9DvSd0uQojq/ATd9/atOApB90i8R4p5N1hw ERBmqBUZRHlBdOfR4YzKB3BxeU12gnLAPxwUXHu9KgD6iN8gOm+zoDKq62WyLZm7Z3dR mLXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=9vqWNLQzQLS7x0eZdIYawFOcZ4MwvtKNLCwNySbGY0w=; b=TIB8PinPL+qf79r0cGxbc/rom+27Ns85LPu4IWGxWrW+35EEXlfOCkjjScDoWEXpVH U2bQl/sDejJ06lbnaAQjk/Xju6Sx4AsLzKDuqchFZSSVbAN95LyVTiRmgx2tZznO2jHK CT0Ar69yaXbNwc9m26kMuk9sL9YIunbnvFlFeIEa/f3CMBiEuwxB/Syvq1bbS/SlrUfI teg97hparqOJIq/4k9yTEsGC08KM9oSZAgtE1iKbdTZm4+Woo+4PhDAXXDJOPLBGRICb lbDvFadfElQ6Hysgdpr93qG5l2ChojXxq3f7/8QiZJZ89Nu97WB7iYya2zOA75zoBUNM 5bVA== X-Gm-Message-State: AJcUukdnys4gQbdY/ZsFBMzI4GYJHqrTM98D5qRr6zxVtXnlheeJzdP3 vTa+jVffAiw8drWKl8cenYAtRYz1 X-Google-Smtp-Source: ALg8bN7gZSgU+QoaCfrr+hwv+P/ex1DJ+FjBIponsARdsYYwIXPJS3qwKsP+9CBZSN2Lm7qzqLt/7Q== X-Received: by 2002:a62:3811:: with SMTP id f17mr11526050pfa.206.1547665115816; Wed, 16 Jan 2019 10:58:35 -0800 (PST) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id g3sm13376028pfe.37.2019.01.16.10.58.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 10:58:34 -0800 (PST) From: Guenter Roeck To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , Guenter Roeck , Kees Cook , Gwendal Grignou Subject: [PATCH v4.9.y] proc: Remove empty line in /proc/self/status Date: Wed, 16 Jan 2019 10:58:31 -0800 Message-Id: <1547665111-31650-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 Cc: Gwendal Grignou Signed-off-by: Guenter Roeck --- This patch only applies to v4.9.y. v4.4.y also needs to be fixed (see https://www.spinics.net/lists/stable/msg279131.html), but the fix is slightly different. v4.14.y and later are not affected. fs/proc/array.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"); -- 2.7.4