Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Aug 2011 18:41:55 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r225081 - stable/7/sys/kern
Message-ID:  <201108221841.p7MIftLt063705@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Mon Aug 22 18:41:55 2011
New Revision: 225081
URL: http://svn.freebsd.org/changeset/base/225081

Log:
  MFC 224986:
  One of the general principles of the sysctl(3) API is that a user can
  query the needed size for a sysctl result by passing in a NULL old
  pointer and a valid oldsize.  The kern.proc.args sysctl handler broke
  this assumption by not calling SYSCTL_OUT() if the old pointer was NULL.

Modified:
  stable/7/sys/kern/kern_proc.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/kern/kern_proc.c
==============================================================================
--- stable/7/sys/kern/kern_proc.c	Mon Aug 22 18:41:39 2011	(r225080)
+++ stable/7/sys/kern/kern_proc.c	Mon Aug 22 18:41:55 2011	(r225081)
@@ -1262,7 +1262,7 @@ sysctl_kern_proc_args(SYSCTL_HANDLER_ARG
 	pa = p->p_args;
 	pargs_hold(pa);
 	PROC_UNLOCK(p);
-	if (req->oldptr != NULL && pa != NULL)
+	if (pa != NULL)
 		error = SYSCTL_OUT(req, pa->ar_args, pa->ar_length);
 	pargs_drop(pa);
 	if (error != 0 || req->newptr == NULL)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108221841.p7MIftLt063705>