5 Mar 2010 22:42
[patch 050/160] prctl: add PR_SET_PROCTITLE_AREA option for prctl()
From: KOSAKI Motohiro <kosaki.motohiro@...> Currently glibc2 doesn't have setproctitle(3), so several userland daemons attempt to emulate it by doing some brutal stack modifications. This works most of the time, but it has problems. For example: % ps -ef |grep avahi-daemon avahi 1679 1 0 09:20 ? 00:00:00 avahi-daemon: running [kosadesk.local] # cat /proc/1679/cmdline avahi-daemon: running [kosadesk.local] This looks good, but the process has also overwritten its environment area and made the environ file useless: # cat /proc/1679/environ adesk.local] Another problem is that the process title length is limited by the size of the environment. Security conscious people try to avoid potential information leaks by clearing most of the environment before running a daemon: # env - MINIMUM_NEEDED_VAR=foo /path/to/daemon The resulting environment size may be too small to fit the wanted process titles. This patch makes it possible for userspace to implement setproctitle() cleanly. It adds a new PR_SET_PROCTITLE_AREA option for prctl(), which(Continue reading)
RSS Feed