]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Abrogate nchr argument in proc_getargv() and proc_getenvv(): we always want
authortrociny <trociny@FreeBSD.org>
Sun, 15 Jan 2012 18:47:24 +0000 (18:47 +0000)
committertrociny <trociny@FreeBSD.org>
Sun, 15 Jan 2012 18:47:24 +0000 (18:47 +0000)
commitd4e71152bd70ed6531fa416c2cb7a63d7fa160d7
treec6208ceb07555117d0288575ddab2dc2d79446cd
parent4371f8aebb7e829b24e1c2298abd87259f35148d
Abrogate nchr argument in proc_getargv() and proc_getenvv(): we always want
to read strings completely to know the actual size.

As a side effect it fixes the issue with kern.proc.args and kern.proc.env
sysctls, which didn't return the size of available data when calling
sysctl(3) with the NULL argument for oldp.

Note, in get_ps_strings(), which does actual work for proc_getargv() and
proc_getenvv(), we still have a safety limit on the size of data read in
case of a corrupted procces stack.

Suggested by: kib
MFC after: 3 days
sys/compat/linprocfs/linprocfs.c
sys/fs/procfs/procfs_status.c
sys/kern/kern_proc.c
sys/sys/proc.h