[lkml]   [2018]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] proc: Don't allow empty /proc/PID/cmdline for user tasks
> 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

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]".

 \ /
  Last update: 2018-05-17 20:52    [W:0.030 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site