From owner-freebsd-usb@FreeBSD.ORG Sat Sep 5 22:20:04 2009 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D7FF1065692 for ; Sat, 5 Sep 2009 22:20:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C4BE48FC18 for ; Sat, 5 Sep 2009 22:20:03 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n85MK3Pp010056 for ; Sat, 5 Sep 2009 22:20:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n85MK361010055; Sat, 5 Sep 2009 22:20:03 GMT (envelope-from gnats) Resent-Date: Sat, 5 Sep 2009 22:20:03 GMT Resent-Message-Id: <200909052220.n85MK361010055@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-usb@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Bruce Cran Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8798106566B for ; Sat, 5 Sep 2009 22:14:04 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id C77EE8FC15 for ; Sat, 5 Sep 2009 22:14:04 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n85ME4I1047659 for ; Sat, 5 Sep 2009 22:14:04 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n85ME42B047658; Sat, 5 Sep 2009 22:14:04 GMT (envelope-from nobody) Message-Id: <200909052214.n85ME42B047658@www.freebsd.org> Date: Sat, 5 Sep 2009 22:14:04 GMT From: Bruce Cran To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: usb/138559: [usb8] uether sysctl handler doesn't NUL-terminate the string X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Sep 2009 22:20:04 -0000 >Number: 138559 >Category: usb >Synopsis: [usb8] uether sysctl handler doesn't NUL-terminate the string >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Sep 05 22:20:03 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Bruce Cran >Release: 8.0-BETA3 >Organization: >Environment: FreeBSD gluon.draftnet 8.0-BETA3 FreeBSD 8.0-BETA3 #1: Fri Sep 4 09:20:32 BST 2009 brucec@gluon.draftnet:/usr/obj/usr/src/sys/GENERIC i386 >Description: The sysctl handler in sys/dev/usb/net/usb_ethernet.c line 143 doesn't NUL-terminate the sysctl string returned to the user because it passes the length as "strlen(name)" instead of "strlen(name)+1". >How-To-Repeat: >Fix: Patch attached with submission follows: --- usb_ethernet.c.orig 2009-09-05 21:35:09.000000000 +0100 +++ usb_ethernet.c 2009-09-05 21:36:18.000000000 +0100 @@ -146,7 +146,7 @@ const char *name; name = device_get_nameunit(ue->ue_dev); - return SYSCTL_OUT(req, name, strlen(name)); + return SYSCTL_OUT(req, name, strlen(name) + 1); } int >Release-Note: >Audit-Trail: >Unformatted: