From owner-svn-src-head@freebsd.org Mon Jan 1 21:25:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8600EE81F48; Mon, 1 Jan 2018 21:25:02 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 501847F31E; Mon, 1 Jan 2018 21:25:02 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w01LP1pv058473; Mon, 1 Jan 2018 21:25:01 GMT (envelope-from antoine@FreeBSD.org) Received: (from antoine@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w01LP18T058472; Mon, 1 Jan 2018 21:25:01 GMT (envelope-from antoine@FreeBSD.org) Message-Id: <201801012125.w01LP18T058472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: antoine set sender to antoine@FreeBSD.org using -f From: Antoine Brodin Date: Mon, 1 Jan 2018 21:25:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327473 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: antoine X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 327473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jan 2018 21:25:02 -0000 Author: antoine Date: Mon Jan 1 21:25:01 2018 New Revision: 327473 URL: https://svnweb.freebsd.org/changeset/base/327473 Log: sysctl_kern_proc_args: do not take the fast path if p_args is NULL In this case it falls back to reading ps_strings Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Mon Jan 1 20:47:03 2018 (r327472) +++ head/sys/kern/kern_proc.c Mon Jan 1 21:25:01 2018 (r327473) @@ -1920,11 +1920,9 @@ sysctl_kern_proc_args(SYSCTL_HANDLER_ARGS) * is nobody to modify pargs, thus we can just read. */ p = curproc; - if (pid == p->p_pid && p->p_numthreads == 1 && req->newptr == NULL) { - if ((pa = p->p_args) != NULL) - error = SYSCTL_OUT(req, pa->ar_args, pa->ar_length); - return (error); - } + if (pid == p->p_pid && p->p_numthreads == 1 && req->newptr == NULL && + (pa = p->p_args) != NULL) + return (SYSCTL_OUT(req, pa->ar_args, pa->ar_length)); flags = PGET_CANSEE; if (req->newptr != NULL)