From: Alexey Dobriyan <adobriyan@gmail.com>
To: tj@kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] proc: Don't allow empty /proc/PID/cmdline for user tasks
Date: Thu, 17 May 2018 21:50:33 +0300 [thread overview]
Message-ID: <20180517185033.GA24408@avx2> (raw)
> Kernel threads have empty /proc/PID/cmdline and some userland tools
> including ps(1) and older versions of systemd use this to detect
> kernel threads.
Those tools are broken. Systemd is fixed, see
https://github.com/systemd/systemd/blob/master/src/basic/process-util.c#L442
Empty /proc/*/cmdline is perfectly fine as long as
execve(filename, NULL, NULL)
is fine.
> However, any userland program can emulate the
> behavior by making its argvs unavailable and trick the affected tools
> into thinking that the task is a kernel thread.
Or it can set ->comm to "[kthreadd] and cmdline to "[kthreadd]".
next reply other threads:[~2018-05-17 18:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-17 18:50 Alexey Dobriyan [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-05-17 1:21 [PATCH] proc: Don't allow empty /proc/PID/cmdline for user tasks Tejun Heo
2018-05-17 18:23 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180517185033.GA24408@avx2 \
--to=adobriyan@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox