From owner-freebsd-current@freebsd.org Thu May 19 00:33:27 2016 Return-Path: Delivered-To: freebsd-current@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 9B03EB41B7C for ; Thu, 19 May 2016 00:33:27 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 8B6FE1F93 for ; Thu, 19 May 2016 00:33:27 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: by mailman.ysv.freebsd.org (Postfix) id 8A87BB41B7B; Thu, 19 May 2016 00:33:27 +0000 (UTC) Delivered-To: current@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 8A2DDB41B79 for ; Thu, 19 May 2016 00:33:27 +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 6D1F71F92; Thu, 19 May 2016 00:33:27 +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 u4J0XHMe080781; Wed, 18 May 2016 17:33:21 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605190033.u4J0XHMe080781@gw.catspoiler.org> Date: Wed, 18 May 2016 17:33:17 -0700 (PDT) From: Don Lewis Subject: Re: r299512 breaks dhclient on some networks To: cem@FreeBSD.org cc: ian.freislich@capeaugusta.com, current@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 00:33:27 -0000 On 18 May, Conrad Meyer wrote: > Hey Ian, > > r299512 incorrectly encoded client identifiers because I misunderstood > the intent of the sizeof()-scaled client_id. I reverted that change > and replaced it with r300174, which I believe fixes the first overrun > more correctly. > > (Coverity may still complain about CID 1305550, but I don't believe > it's valid for 'hlen' to exceed sizeof(hw_addr.haddr).) It's not, but the MIN() doesn't hurt. Coverity may no longer complain though because your change may think that hlen is only 16 at this point since that is what the earlier change tests against. If it is checked in one place, it should probably be checked in both, or you could just add an assert() to check it ...