svn commit: r279993 - in head/sys: dev/cxgb dev/cxgbe kern vm

Tijl Coosemans tijl at FreeBSD.org
Sun Mar 22 16:12:23 UTC 2015


On Sat, 14 Mar 2015 17:08:29 +0000 (UTC) Ian Lepore <ian at FreeBSD.org> 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kern_proc_env.patch
Type: text/x-patch
Size: 438 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20150322/8529a2a6/attachment.bin>


More information about the svn-src-head mailing list