From owner-cvs-src@FreeBSD.ORG Fri May 6 05:54:37 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 88C3D16A4CE; Fri, 6 May 2005 05:54:37 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 25D1F43D62; Fri, 6 May 2005 05:54:37 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.13.3/8.13.1) with ESMTP id j465qpSO098922; Thu, 5 May 2005 23:52:51 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 05 May 2005 23:53:49 -0600 (MDT) Message-Id: <20050505.235349.09773936.imp@bsdimp.com> To: gurney_j@resnet.uoregon.edu From: "M. Warner Losh" In-Reply-To: <20050505.232214.96921001.imp@bsdimp.com> References: <200505060248.j462mL0k009905@repoman.freebsd.org> <20050506032202.GC2670@funkthat.com> <20050505.232214.96921001.imp@bsdimp.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org cc: cperciva@FreeBSD.org Subject: Re: cvs commit: src/sys/kern subr_bus.c subr_rman.c vfs_subr.c src/sys/net if_mib.c src/sys/netinet ip_divert.c raw_ip.c udp_usrreq.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2005 05:54:37 -0000 In message: <20050505.232214.96921001.imp@bsdimp.com> "M. Warner Losh" writes: : : > If we are going to : : > 1. Copy a NULL-terminated string into a fixed-length buffer, and : : > 2. copyout that buffer to userland, : : > we really ought to : : > 0. Zero the entire buffer : : > first. : : > : : > Security: FreeBSD-SA-05:08.kmem : : : : /me notes this is a good reason to use strncpy instead of strlcpy. : : Don't you mean the opposite? Actually, in at least one of these cases that were fixed should be fixed by allocating the structure M_ZERO because it is a little too large for the stack anyway. Warner