From owner-freebsd-questions@FreeBSD.ORG Mon Apr 25 14:18:55 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0F0F106566B for ; Mon, 25 Apr 2011 14:18:55 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 63BEE8FC19 for ; Mon, 25 Apr 2011 14:18:55 +0000 (UTC) Received: by wwc33 with SMTP id 33so2141638wwc.31 for ; Mon, 25 Apr 2011 07:18:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:date:from:to:subject:message-id:in-reply-to :references:x-mailer:mime-version:content-type :content-transfer-encoding; bh=/l7jAuxNNUG1+cNsg4na9eqxWkIQeTjBVBDXDGeFOao=; b=XScJwmXD7UuZz4FZDRtWQr6oaA8mIRZxMaN9VyuUFY6pCVVAZKZuxfla7pGUQ+Y1Uf k5zohqBW1Q8WANWdz6DB/SDwpOnyeHk3qruBNOFqipq1SNixNy/9VqNxf0+D0yNTomrT jEAdRuGAX+R/Q4YGZJsf4mgvlst3qvum55lnk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; b=f1giLo26rcu8sdjdWmG8i5nmMZb5VauJ/YckHQUlDbfboF9v97q80jw0NN1Mt1TiAx AoBWNQAOpP0I9bndY6Guo7G3D8FtZxW1ndLhjvAHHbrfj7Zc6riUF08jI7sdXguWWveP Z6u45p+2oaRHZlvwp+DY9X5yvUjX5LW7hGBNs= Received: by 10.227.100.212 with SMTP id z20mr4151061wbn.27.1303741133727; Mon, 25 Apr 2011 07:18:53 -0700 (PDT) Received: from gumby.homeunix.com (87-194-105-247.bethere.co.uk [87.194.105.247]) by mx.google.com with ESMTPS id y29sm3293780wbd.4.2011.04.25.07.18.50 (version=SSLv3 cipher=OTHER); Mon, 25 Apr 2011 07:18:51 -0700 (PDT) Date: Mon, 25 Apr 2011 15:18:46 +0100 From: RW To: freebsd-questions@freebsd.org Message-ID: <20110425151846.0a5359fd@gumby.homeunix.com> In-Reply-To: References: X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.1; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: Password theft from memory? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 14:18:55 -0000 On Sun, 24 Apr 2011 19:53:41 +0200 "C. P. Ghost" wrote: > On Sun, Apr 24, 2011 at 7:10 PM, Modulok wrote: > > I don't know if this is a problem on FreeBSD... > > > > Process A requests memory. > > Process A Stores a plaintext password in memory or other sensitive > > data. Process A terminates and the memory is reclaimed by kernel. > > > > Process B requests a *huge* chunk of memory. > > Process B crawls the uninitialized memory, looking for ProcessA's > > previously stored password. > > > > Does anyone know if this is even possible on FreeBSD? > > Please correct me if I'm wrong (I didn't check the sources), but... > > short answer: it shouldn't happen, because pages allocated to a new > process are zero-filled by the kernel (lazily via zero-fill page > faults when process B crawls the memory the first time). I don't believe the heap is allocated zeroed pages. The kernel does allocate such pages to the BSS segment, but that's because it holds zeroed data such as C static variables. AFAIK it's the responsibly of the programmer to avoid data leaking. Passwords are commonly overwritten as soon as they no longer needed. I think geli keeps persistent key information in kernel wired-memory.