From: Alexey Dobriyan Date: Fri, 17 Jul 2015 23:24:09 +0000 (-0700) Subject: /proc/$PID/cmdline: fixup empty ARGV case X-Git-Tag: omap-for-v4.3/fixes-merge-window~225^2~6 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3581d458c39bc5e58ceeeaf51796625bc978d2eb;p=pandora-kernel.git /proc/$PID/cmdline: fixup empty ARGV case /proc/*/cmdline code checks if it should look at ENVP area by checking last byte of ARGV area: rv = access_remote_vm(mm, arg_end - 1, &c, 1, 0); if (rv <= 0) goto out_free_page; If ARGV is somehow made empty (by doing execve(..., NULL, ...) or manually setting ->arg_start and ->arg_end to equal values), the decision will be based on byte which doesn't even belong to ARGV/ENVP. So, quickly check if ARGV area is empty and report 0 to match previous behaviour. Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed