From owner-cvs-all@FreeBSD.ORG Sat Jan 10 07:23:50 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8A10C16A4CE; Sat, 10 Jan 2004 07:23:50 -0800 (PST) Received: from gw.celabo.org (gw.celabo.org [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4504E43D46; Sat, 10 Jan 2004 07:23:48 -0800 (PST) (envelope-from nectar@celabo.org) Received: from madman.celabo.org (madman.celabo.org [10.0.1.111]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "madman.celabo.org", Issuer "celabo.org CA" (verified OK)) by gw.celabo.org (Postfix) with ESMTP id CD81854883; Sat, 10 Jan 2004 09:23:47 -0600 (CST) Received: by madman.celabo.org (Postfix, from userid 1001) id 65BE76D45F; Sat, 10 Jan 2004 09:23:47 -0600 (CST) Date: Sat, 10 Jan 2004 09:23:47 -0600 From: "Jacques A. Vidrine" To: Don Lewis Message-ID: <20040110152347.GD80448@madman.celabo.org> References: <200401100828.i0A8SsZP047883@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200401100828.i0A8SsZP047883@repoman.freebsd.org> X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.4i-ja.1 cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern uipc_syscalls.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jan 2004 15:23:50 -0000 On Sat, Jan 10, 2004 at 12:28:54AM -0800, Don Lewis wrote: > truckman 2004/01/10 00:28:54 PST > > FreeBSD src repository > > Modified files: > sys/kern uipc_syscalls.c > Log: > Add a somewhat redundant check on the len arguement to getsockaddr() to > avoid relying on the minimum memory allocation size to avoid problems. > The check is somewhat redundant because the consumers of the returned > structure will check that sa_len is a protocol-specific larger size. > > Submitted by: Matthew Dillon > Reviewed by: nectar > MFC after: 30 days But the check *is not* redundant. The consumers cannot safely check sa_len if the allocation were to be less than `offsetof(struct sa_sockaddr, data[0])'--- which it never is, by chance, due to the minimum memory allocation size, as you noted. But we shall all feel better that this is made explicit. FWIW, I think the check should have been for `sizeof(*sa)' technically, but what has been committed is safe, too, I believe. Cheers, -- Jacques Vidrine NTT/Verio SME FreeBSD UNIX Heimdal nectar@celabo.org jvidrine@verio.net nectar@freebsd.org nectar@kth.se