From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 30 21:37:55 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 73AA516A4CE for ; Wed, 30 Mar 2005 21:37:55 +0000 (GMT) Received: from marlena.vvi.at (marlena.vvi.at [208.252.225.59]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09FD143D41 for ; Wed, 30 Mar 2005 21:37:55 +0000 (GMT) (envelope-from www@marlena.vvi.at) Received: from marlena.vvi.at (localhost.marlena.vvi.at [127.0.0.1]) by marlena.vvi.at (8.12.10/8.12.9) with ESMTP id j2ULbxh3012729; Wed, 30 Mar 2005 13:38:01 -0800 (PST) (envelope-from www@marlena.vvi.at) Received: (from www@localhost) by marlena.vvi.at (8.12.10/8.12.10/Submit) id j2ULbrNd012728; Wed, 30 Mar 2005 13:37:53 -0800 (PST) (envelope-from www) Date: Wed, 30 Mar 2005 13:37:53 -0800 (PST) Message-Id: <200503302137.j2ULbrNd012728@marlena.vvi.at> To: elric@imrryr.org From: "ALeine" cc: freebsd-hackers@freebsd.org cc: phk@phk.freebsd.dk cc: tech-security@netbsd.org Subject: Re: A bunch of memory allocation bugs in CGD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2005 21:37:55 -0000 elric@imrryr.org wrote: > Having a quick read it looks like the call to cmd_nuke() is > preceded by a cmd_open(). cmd_open() loads the decrypted decoded > contents of the lock sector into memory which contain all of the > information needed to decrypt the disk. In cmd_nuke(), the malloc is > followed immediately by a memset(3) which could core dump. You're right on both counts, I apologize for the confusion, I have several versions of GBDE files around and just before I made that comment about segmentation violation not being possible I took a look at the malloc(3) line in my patched version by mistake. In that version I replaced the malloc(3) and memset(3) calls in cmd_nuke() with a single malloc(3) call with the M_ZERO flag set. Using mlockall(2) to prevent paging and setrlimit(2) to prevent core from being dumped would also be an improvement for both CGD and GBDE. ALeine ___________________________________________________________________ WebMail FREE http://mail.austrosearch.net