Clean entire arg block when setting process name.
When Android processes fork from Zygote, we rewrite the command line
with a new name, eg. "system_server". When we do this, we should
fill the entire block with zeros to remove corrupted argument
information that may otherwise remain in the /proc/<pid>/cmdline buffer
and be seen in tools and stack dumps.
Fixed an issue where VM options could be overwritten after setting
the nice name if the name was too long.
Bug: 17474152
Change-Id: Ie6cf9ed7752a04300a340e26cd6812bb35c59e1b
3 files changed