From owner-svn-src-stable-7@FreeBSD.ORG Mon Aug 22 18:41:55 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E54F71065670; Mon, 22 Aug 2011 18:41:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D580B8FC2A; Mon, 22 Aug 2011 18:41:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7MIft8S063707; Mon, 22 Aug 2011 18:41:55 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7MIftLt063705; Mon, 22 Aug 2011 18:41:55 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201108221841.p7MIftLt063705@svn.freebsd.org> From: John Baldwin Date: Mon, 22 Aug 2011 18:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225081 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2011 18:41:56 -0000 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)