From owner-freebsd-current@FreeBSD.ORG Mon Jun 14 02:00:55 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBD7E106564A for ; Mon, 14 Jun 2010 02:00:55 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by mx1.freebsd.org (Postfix) with ESMTP id 717998FC19 for ; Mon, 14 Jun 2010 02:00:55 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 25so472774eya.9 for ; Sun, 13 Jun 2010 19:00:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.4.207 with SMTP id 15mr1620052ebs.72.1276480853034; Sun, 13 Jun 2010 19:00:53 -0700 (PDT) Received: by 10.213.12.199 with HTTP; Sun, 13 Jun 2010 19:00:52 -0700 (PDT) X-Originating-IP: [93.203.40.162] In-Reply-To: <20100614005444.GA57650@server.vk2pj.dyndns.org> References: <20100614005444.GA57650@server.vk2pj.dyndns.org> Date: Mon, 14 Jun 2010 04:00:52 +0200 Message-ID: From: "C. P. Ghost" To: Peter Jeremy Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= , current@freebsd.org Subject: Re: Protecting sensitive data [was Re: Cleanup for cryptographic algorithms vs. compiler optimizations] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 14 Jun 2010 02:00:55 -0000 2010/6/14 Peter Jeremy : > On 2010-Jun-13 10:07:15 +0200, Dag-Erling Sm=F8rgrav wrote: >>You always overwrite passphrases, keys etc. as soon as you're done with >>them so they don't end up in a crash dump or on a swap disk or >>something. > > Which brings up an associated issue: By default, mlock(2) can only be > used by root processes. =A0It would be really handy if non-privileged > processes could lock small amounts of VM so they can securely handle > passwords, passphrases, keys, etc. =A0MAC offers the option of allowing > non-root processes access to mlock() but doesn't provide any > restrictions on the amount of memory they can lock. Interesting! >From an admin point of view, this behavior could them be enabled or disabled via sysctl(8), and this sysctl variable could define what "small" means exactly (#nr of pages per process maybe?) Another sysctl variable should probably define how many pages can be locked in general by all non-privileged processes, to prevent malicious programs like fork bombs to mlock the whole memory. > Peter Jeremy -cpghost. --=20 Cordula's Web. http://www.cordula.ws/