From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 21:20:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9676DAF3; Sun, 22 Mar 2015 21:20:31 +0000 (UTC) Received: from relay.mailchannels.net (aso-006-i440.relay.mailchannels.net [23.91.64.121]) by mx1.freebsd.org (Postfix) with ESMTP id 4B3388D1; Sun, 22 Mar 2015 21:20:29 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp2.ore.mailhop.org (ip-10-33-12-218.us-west-2.compute.internal [10.33.12.218]) by relay.mailchannels.net (Postfix) with ESMTPA id 94914A047F; Sun, 22 Mar 2015 21:20:27 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp2.ore.mailhop.org (smtp2.ore.mailhop.org [10.45.8.167]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.4.8); Sun, 22 Mar 2015 21:20:27 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: duocircle|x-authuser|hippie X-MailChannels-Auth-Id: duocircle X-MC-Loop-Signature: 1427059227710:1465418749 X-MC-Ingress-Time: 1427059227710 Received: from c-73-34-117-227.hsd1.co.comcast.net ([73.34.117.227] helo=ilsoft.org) by smtp2.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YZnIJ-0001Hq-5E; Sun, 22 Mar 2015 21:20:27 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t2MLKPpF037879; Sun, 22 Mar 2015 15:20:25 -0600 (MDT) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX1+VOhez/SxHfnWm+0QOFkYA Message-ID: <1427059225.49126.5.camel@freebsd.org> Subject: Re: svn commit: r279993 - in head/sys: dev/cxgb dev/cxgbe kern vm From: Ian Lepore To: Tijl Coosemans Date: Sun, 22 Mar 2015 15:20:25 -0600 In-Reply-To: <20150322171110.2af31564@kalimero.tijl.coosemans.org> References: <201503141708.t2EH8TdR074383@svn.freebsd.org> <20150322171110.2af31564@kalimero.tijl.coosemans.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-AuthUser: hippie Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 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: Sun, 22 Mar 2015 21:20:31 -0000 On Sun, 2015-03-22 at 17:11 +0100, Tijl Coosemans wrote: > On Sat, 14 Mar 2015 17:08:29 +0000 (UTC) Ian Lepore wrote: > > Author: ian > > Date: Sat Mar 14 17:08:28 2015 > > New Revision: 279993 > > URL: https://svnweb.freebsd.org/changeset/base/279993 > > > > Log: > > Set the SBUF_INCLUDENUL flag in sbuf_new_for_sysctl() so that sysctl > > strings returned to userland include the nulterm byte. > > > > Some uses of sbuf_new_for_sysctl() write binary data rather than strings; > > clear the SBUF_INCLUDENUL flag after calling sbuf_new_for_sysctl() in > > those cases. (Note that the sbuf code still automatically adds a nulterm > > byte in sbuf_finish(), but since it's not included in the length it won't > > get copied to userland along with the binary data.) > > Can you review the attached patch? The KERN_PROC_ENV sysctl is also > binary (zero-terminated strings). Adding an extra \0 at the end makes > some programs think there's an extra empty environment variable. It > causes console-kit-daemon to crash for instance. > > I suspect a similar patch may be needed for KERN_PROC_ARGS. I think you're right. The OID format isn't "A" so it shouldn't be formatted as a normal C string, for both argv and envv. I commited the fix as r280355, thanks. -- Ian