Bug #77044 [Opn]: Process Name has lots of null appended
| From: | requinix@php.net | Date: | Sun, 21 Oct 2018 22:31:55 +0000 |
| Subject: | Bug #77044 [Opn]: Process Name has lots of null appended | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-217644@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77044&edit=1
ID: 77044
Updated by: requinix@php.net
Reported by: d28b312d at opayq dot com
Summary: Process Name has lots of null appended
Status: Open
Type: Bug
Package: FPM related
Operating System: CentOS
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
If this is to hide the argument list, which I suspect is the case, then a better trick may be to
zero out all but the last byte.
http://netsplit.com/hiding-arguments-from-ps
If the kernel does what the article says then only argv[0] will be exposed, but if not then
everything was still deleted.
Previous Comments:
------------------------------------------------------------------------
[2018-10-21 22:10:42] d28b312d at opayq dot com
Description:
------------
When php-fpm starts it seems to set a wild command line which causes problems with tools such as
pgrep -xf.
Using: cat /proc/<procid>/cmdline | hexdump -C
For example, most normal tools:
00000000 2f 75 73 72 2f 6c 69 62 2f 70 6f 6c 6b 69 74 2d |/usr/lib/polkit-|
00000010 31 2f 70 6f 6c 6b 69 74 64 00 2d 2d 6e 6f 2d 64 |1/polkitd.--no-d|
00000020 65 62 75 67 00 |ebug.|
But php-fpm processes:
00000000 70 68 70 2d 66 70 6d 3a 20 6d 61 73 74 65 72 20 |php-fpm: master |
00000010 70 72 6f 63 65 73 73 20 28 2f 65 74 63 2f 70 68 |process (/etc/ph|
00000020 70 2d 66 70 6d 2e 63 6f 6e 66 29 00 00 00 00 00 |p-fpm.conf).....|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |...............|
This applies to all php-fpm processes, and so far, _no_ other processes on my system , which leads
me to believe it's a bug in php-fpm.
Expected result:
----------------
00000000 70 68 70 2d 66 70 6d 3a 20 6d 61 73 74 65 72 20 |php-fpm: master |
00000010 70 72 6f 63 65 73 73 20 28 2f 65 74 63 2f 70 68 |process (/etc/ph|
00000020 70 2d 66 70 6d 2e 63 6f 6e 66 29 00 |p-fpm.conf).|
Actual result:
--------------
00000000 70 68 70 2d 66 70 6d 3a 20 6d 61 73 74 65 72 20 |php-fpm: master |
00000010 70 72 6f 63 65 73 73 20 28 2f 65 74 63 2f 70 68 |process (/etc/ph|
00000020 70 2d 66 70 6d 2e 63 6f 6e 66 29 00 00 00 00 00 |p-fpm.conf).....|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |...............|
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77044&edit=1