From mboxrd@z Thu Jan 1 00:00:00 1970 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=-14.6 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 92B7CC43387 for ; Mon, 14 Jan 2019 19:01:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 61A0D20659 for ; Mon, 14 Jan 2019 19:01:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="pIIvkhyW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726836AbfANTBZ (ORCPT ); Mon, 14 Jan 2019 14:01:25 -0500 Received: from mail-yw1-f67.google.com ([209.85.161.67]:34985 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726643AbfANTBZ (ORCPT ); Mon, 14 Jan 2019 14:01:25 -0500 Received: by mail-yw1-f67.google.com with SMTP id h32so51837ywk.2 for ; Mon, 14 Jan 2019 11:01:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pdaDU3NAzSW4Uf4h5TBeAhxqIz9STkaFIr9NAKcv3Is=; b=pIIvkhyW/WOShQXoL040fWW2X5teSfusIiTGeyG5mGbU0Ibp9sNHQBEYKbO/ZD17d6 qbbmzyKAuQuwtL4IQUm4R4UagqoCm5C4mXTU++InSUyn16i8MIAYHv+C0YyynhGd4nt+ qPD9w1xIc2MFqk61MTBL8J7Is5tWW/4fVgvD6U2nI3E7B64DoqCp8pFdfuMpL2r0L/I8 P+ucTttPLv0cVaalsvighjkAhmS+4eIuBdHVmepzBsdG0y50e9pomTscUOGgbL/oxGKC 8kR4CLv1qbWjeYRBYvyYPEWaH+HfGtGEC0Vk1cY01RZfsYCOabcu2P2xIbRfNi84b0Gb us7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pdaDU3NAzSW4Uf4h5TBeAhxqIz9STkaFIr9NAKcv3Is=; b=ehQcRkECVXkR76esAwtYnZ3iRcrqWmq350XoH0/hB27bhTR2NtKBxDd3exs8mBXTyW bKWhcoeqjNqdqpTZxDDwP+a1S6r+ICCJJS6AsCDhieWJS0/xzDaFNr1A0nbg5o3iGjXx LlTtI+DCHnei0cqdvs+ll5U2YnmJLlUDUCDUZTCT7xvUIVBWvNUDjx9jeJLlOeLmTq3L 6CuQN8tkR5tnKA0UunHbwtZnDHzr+8GTyOi5mcO6BL7kv124YWMrfHoPvw/R4mL0R4Ks e8LLz/2H5Uyg0A8OttxZLeiC/BBgubflzY1TNyI19o8fL68EbPXc43dkwfE0klvn9Syw l1Kg== X-Gm-Message-State: AJcUukff3qmkcYUe+ZlDbOHySwfhvFAPD0QQMc+GLZpmbmzLhf8439n8 vI1GW8mb7iSVWPgOJ1/l+bY8qd5pDF46t0SvwK/Iy3fHgOIgrw== X-Google-Smtp-Source: ALg8bN7RDBwtQHfoE6eecTvDZbQZnq43IEBG4LVc4hyOqJKQTrLz7YYWzXgN1QAMskgeUUlU2/RRxg15olXLx2MbF0M= X-Received: by 2002:a81:ec12:: with SMTP id j18mr25263262ywm.17.1547492484530; Mon, 14 Jan 2019 11:01:24 -0800 (PST) MIME-Version: 1.0 References: <20190114181336.74501-1-gwendal@chromium.org> <20190114185040.GB13821@kroah.com> In-Reply-To: <20190114185040.GB13821@kroah.com> From: Guenter Roeck Date: Mon, 14 Jan 2019 11:01:13 -0800 Message-ID: Subject: Re: [PATCH v2] proc: Remove empty line in /proc/self/status To: Greg Kroah-Hartman Cc: Gwendal Grignou , "# v4 . 10+" , Guenter Roeck , Kees Cook Content-Type: text/plain; charset="UTF-8" Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Mon, Jan 14, 2019 at 10:50 AM Greg Kroah-Hartman wrote: > > On Mon, Jan 14, 2019 at 10:21:45AM -0800, Guenter Roeck wrote: > > On Mon, Jan 14, 2019 at 10:13 AM Gwendal Grignou wrote: > > > > > > Prevent an empty line in /proc/self/status, allow iotop to work. > > > > > > iotop does not like empty lines, fails with: > > > 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 > > > > > > [reading /proc/self/status] > > > > > > Fixes: 84964fa3e5a0 ("proc: Provide details on speculation flaw mitigations") > > > > > > Signed-off-by: Gwendal Grignou > > > --- > > > v2: Format commit message properly with proper subject and fixes > > > keyword. > > > > > You might want to mention that this patch only applies to v4.4.y. > > v4.9.y has a similar problem, but only if CONFIG_SECCOMP=n, and would > > require a slightly different patch to fix. Other releases are, as far > > as I can see, not affected. > > > > Guenter > > > > > fs/proc/array.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/fs/proc/array.c b/fs/proc/array.c > > > index 0c142916a8c7d..f11df9ab4256e 100644 > > > --- a/fs/proc/array.c > > > +++ b/fs/proc/array.c > > > @@ -334,7 +334,7 @@ static inline void task_seccomp(struct seq_file *m, struct task_struct *p) > > > #ifdef CONFIG_SECCOMP > > > seq_printf(m, "Seccomp:\t%d\n", p->seccomp.mode); > > > #endif > > > - seq_printf(m, "\nSpeculation_Store_Bypass:\t"); > > > + seq_printf(m, "Speculation_Store_Bypass:\t"); > > Why isn't this issue showing up in all kernel releases, as this line is > still the same in 5.0-rc2? > > What makes the 4.4.y and 4.9.y trees so special here? > v4.14 and later: { seq_put_decimal_ull(m, "NoNewPrivs:\t", task_no_new_privs(p)); #ifdef CONFIG_SECCOMP seq_put_decimal_ull(m, "\nSeccomp:\t", p->seccomp.mode); #endif seq_printf(m, "\nSpeculation_Store_Bypass:\t"); --- v4.9: { #ifdef CONFIG_SECCOMP seq_put_decimal_ull(m, "Seccomp:\t", p->seccomp.mode); ^^^ #endif seq_printf(m, "\nSpeculation_Store_Bypass:\t"); ^^^ -> extra newline if CONFIG_SECCOMP=n --- v4.4: { #ifdef CONFIG_SECCOMP seq_printf(m, "Seccomp:\t%d\n", p->seccomp.mode); ^^^ #endif seq_printf(m, "\nSpeculation_Store_Bypass:\t"); ^^^ -> always extra newline Guenter