diff options
author | trociny <trociny@FreeBSD.org> | 2012-01-15 18:47:24 +0000 |
---|---|---|
committer | trociny <trociny@FreeBSD.org> | 2012-01-15 18:47:24 +0000 |
commit | d4e71152bd70ed6531fa416c2cb7a63d7fa160d7 (patch) | |
tree | c6208ceb07555117d0288575ddab2dc2d79446cd /sys/compat/linprocfs | |
parent | 4371f8aebb7e829b24e1c2298abd87259f35148d (diff) | |
download | FreeBSD-src-d4e71152bd70ed6531fa416c2cb7a63d7fa160d7.zip FreeBSD-src-d4e71152bd70ed6531fa416c2cb7a63d7fa160d7.tar.gz |
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
Diffstat (limited to 'sys/compat/linprocfs')
-rw-r--r-- | sys/compat/linprocfs/linprocfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index 2549ecc..8129fe8 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -954,7 +954,7 @@ linprocfs_doproccmdline(PFS_FILL_ARGS) PROC_UNLOCK(p); - ret = proc_getargv(td, p, sb, ARG_MAX); + ret = proc_getargv(td, p, sb); return (ret); } @@ -988,7 +988,7 @@ linprocfs_doprocenviron(PFS_FILL_ARGS) PROC_UNLOCK(p); - ret = proc_getenvv(td, p, sb, ARG_MAX); + ret = proc_getenvv(td, p, sb); return (ret); } |