From owner-freebsd-questions@freebsd.org Thu Sep 10 11:44:55 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 217D1A015F6 for ; Thu, 10 Sep 2015 11:44:55 +0000 (UTC) (envelope-from erichsfreebsdlist@alogt.com) Received: from alogt.com (alogt.com [69.36.191.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0005010E1 for ; Thu, 10 Sep 2015 11:44:54 +0000 (UTC) (envelope-from erichsfreebsdlist@alogt.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=alogt.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=JDMo6Xr0fQra7AyvqSUGP6RiP1nBRHONcKGzv0+TqcI=; b=IoIAsX1rof5fK4+cDQBRLzO3B8j2kmGGWELPgGUy6EtUZ3ylAjPs017A+R49S+pJeLqY4uD2TUS+eQq96yfOfv2BnbI9zlzUwk31Kq3HmnrH2TBrCTjcpLahZLGQp3B0O7OaH+5Ai66cXHXMclGfj1KcHFGlAfRxjK/7Q2+540M=; Received: from [114.121.157.34] (port=37610 helo=X220.alogt.com) by sl-508-2.slc.westdc.net with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.85) (envelope-from ) id 1Za0Hd-002ZCq-0b; Thu, 10 Sep 2015 05:44:53 -0600 Date: Thu, 10 Sep 2015 19:44:47 +0800 From: Erich Dollansky To: Quartz Cc: freebsd-questions@freebsd.org Subject: Re: mdconfig creating file based memory disk Message-ID: <20150910194447.16168030@X220.alogt.com> In-Reply-To: <55F10CF5.5070409@sneakertech.com> References: <20150910111034.20b97c41@X220.alogt.com> <55F10CF5.5070409@sneakertech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - sl-508-2.slc.westdc.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - alogt.com X-Get-Message-Sender-Via: sl-508-2.slc.westdc.net: authenticated_id: erichsfreebsdlist@alogt.com X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2015 11:44:55 -0000 Hi, On Thu, 10 Sep 2015 00:54:13 -0400 Quartz wrote: > > It gives me double the size of 'swapfile' as swap space. It is > > obvious to me that this must fail. > > Interestingly, I just tested this in a VM and it seems to work fine. > I maxed out the ram by creating a few other ramdisks and filling them > with dd zero files, and the most I got was a generic "out of swap > space" error (no crashes or panics). Not sure exactly what it's doing > though. fill it either with random data (hard to verify) or one with 0s and the other one with 1s. The data you write last should be on both disks afterwards. I did a simple test. I creates two memory disks using the same file, put a file system on, mounted one memory disk, wrote file to it, un-mounted it, mounted the other memory disk and the file was there. So, it is obvious that both memory disks are written to the one and only file without any warning. If this happens with swap, the damage can be whatever is possible with a corrupted swap. It even opens security holes if a normal user can either create memory disks or at least mount them. Erich -questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org"