alistair23-linux/fs/proc
Alexey Dobriyan 3581d458c3 /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 <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-07-17 16:39:54 -07:00
..
array.c fs, proc: introduce CONFIG_PROC_CHILDREN 2015-06-25 17:00:37 -07:00
base.c /proc/$PID/cmdline: fixup empty ARGV case 2015-07-17 16:39:54 -07:00
cmdline.c
consoles.c
cpuinfo.c
devices.c
fd.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-26 17:22:07 -07:00
fd.h
generic.c proc: Allow creating permanently empty directories that serve as mount points 2015-07-01 10:36:41 -05:00
inode.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2015-07-03 15:20:57 -07:00
internal.h proc: Allow creating permanently empty directories that serve as mount points 2015-07-01 10:36:41 -05:00
interrupts.c
Kconfig fs, proc: add help for CONFIG_PROC_CHILDREN 2015-07-17 16:39:52 -07:00
kcore.c
kmsg.c
loadavg.c
Makefile
meminfo.c fs/proc/meminfo.c: include cma info in proc/meminfo 2014-12-18 19:08:10 -08:00
namespaces.c don't pass nameidata to ->follow_link() 2015-05-10 22:20:15 -04:00
nommu.c vfs: add seq_file_path() helper 2015-06-23 18:01:07 -04:00
page.c mm:add KPF_ZERO_PAGE flag for /proc/kpageflags 2015-02-11 17:06:00 -08:00
proc_net.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
proc_sysctl.c sysctl: Allow creating permanently empty directories that serve as mountpoints. 2015-07-01 10:36:39 -05:00
proc_tty.c
root.c proc: Allow creating permanently empty directories that serve as mount points 2015-07-01 10:36:41 -05:00
self.c don't pass nameidata to ->follow_link() 2015-05-10 22:20:15 -04:00
softirqs.c
stat.c genirq: Prevent proc race against freeing of irq descriptors 2014-12-13 13:33:07 +01:00
task_mmu.c vfs: add seq_file_path() helper 2015-06-23 18:01:07 -04:00
task_nommu.c vfs: add seq_file_path() helper 2015-06-23 18:01:07 -04:00
thread_self.c don't pass nameidata to ->follow_link() 2015-05-10 22:20:15 -04:00
uptime.c
version.c
vmcore.c vmcore: fix PT_NOTE n_namesz, n_descsz overflow issue 2015-02-17 14:34:52 -08:00