Re: [PATCH v2] proc: Remove empty line in /proc/self/status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 14, 2019 at 10:13 AM Gwendal Grignou <gwendal@xxxxxxxxxxxx> 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 <gwendal@xxxxxxxxxxxx>
> ---
>  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");
>         switch (arch_prctl_spec_ctrl_get(p, PR_SPEC_STORE_BYPASS)) {
>         case -EINVAL:
>                 seq_printf(m, "unknown");
> --
> 2.20.1.97.g81188d93c3-goog
>



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux