From owner-svn-src-all@freebsd.org Thu May 19 00:26:22 2016 Return-Path: Delivered-To: svn-src-all@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 832C9B41A02; Thu, 19 May 2016 00:26:22 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 63E4C1B9A; Thu, 19 May 2016 00:26:22 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4J0QCD2080759; Wed, 18 May 2016 17:26:16 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605190026.u4J0QCD2080759@gw.catspoiler.org> Date: Wed, 18 May 2016 17:26:12 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r300174 - head/sbin/dhclient To: cem@FreeBSD.org cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201605182341.u4INftgv078403@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 00:26:22 -0000 On 18 May, Conrad E. Meyer wrote: > Author: cem > Date: Wed May 18 23:41:55 2016 > New Revision: 300174 > URL: https://svnweb.freebsd.org/changeset/base/300174 > > Log: > dhclient: Fix the trivial buffer overruns correctly > > A DHCP client identifier is simply the hardware type (one byte) concatenated > with the hardware address (some variable number of bytes, but at most 16). > Limit the size of the temporary buffer to match and the rest of the > calculations shake out correctly. > > This is a follow-up to the incorrect r299512, reverted in r300172. > > CIDs: 1008682, 1305550 > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sbin/dhclient/dhclient.c > > Modified: head/sbin/dhclient/dhclient.c > ============================================================================== > --- head/sbin/dhclient/dhclient.c Wed May 18 23:39:31 2016 (r300173) > +++ head/sbin/dhclient/dhclient.c Wed May 18 23:41:55 2016 (r300174) > @@ -1570,7 +1570,7 @@ make_discover(struct interface_info *ip, > } > > /* set unique client identifier */ > - char client_ident[sizeof(struct hardware)]; > + char client_ident[sizeof(ip->hw_address.haddr) + 1]; > if (!options[DHO_DHCP_CLIENT_IDENTIFIER]) { > int hwlen = (ip->hw_address.hlen < sizeof(client_ident)-1) ? > ip->hw_address.hlen : sizeof(client_ident)-1; > That might work as well.