From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nekare.kjorling.se (nekare.kjorling.se [89.221.249.175]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.server123.net (Postfix) with ESMTPS for ; Thu, 4 Feb 2016 10:20:27 +0100 (CET) Received: from yeono.kjorling.se (h-9-65.a328.priv.bahnhof.se [46.59.9.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "yeono", Issuer "yeono" (not verified)) by nekare.kjorling.se (Postfix) with ESMTPS id 1FE5911411E for ; Thu, 4 Feb 2016 09:20:19 +0000 (UTC) Received: from yeono.kjorling.se (localhost [127.0.0.1]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by yeono (Postfix) with ESMTPS id CC19519A8 for ; Thu, 4 Feb 2016 10:20:18 +0100 (CET) Date: Thu, 4 Feb 2016 09:20:17 +0000 From: Michael =?utf-8?B?S2rDtnJsaW5n?= Message-ID: <20160204092017.GA25029@yeono.kjorling.se> References: <56B20C05.7080307@gmail.com> <56B25914.5090204@whgl.uni-frankfurt.de> <56B30DE8.1060502@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56B30DE8.1060502@gmail.com> Subject: Re: [dm-crypt] The future of disk encryption with LUKS2 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de On 4 Feb 2016 09:38 +0100, from gmazyland@gmail.com (Milan Broz): > On 02/03/2016 08:46 PM, Sven Eschenberg wrote: >> Personally I'd love to see FEC extensions in a v2 on-disk-format. > > Anyway, if you have some real use cases for FEC (and specifically some > real-world examples of data corruption it can fix), please share it, I am > very interested to see that. (I know the problem exist and that FEC could > be useful but seems nobody is able provide any hard data...) Plain data duplication seems both easier to implement and likely to allow recovery from the same as well as other classes of errors. Reed-Solomon and similar FEC is useful when a read is marginal, but useless when a read fails completely, which I believe is a far more common failure mode in the layers of storage that we are interested in. Storing the LUKS header in two separate locations on disk could probably do the trick. For example, right at the start *and* right at the end of the LUKS container, which would avoid any issues with having to remap a location in the middle of the container. Put a counter in the header, ensure that all copies are in sync when the header is read or written to, and if they are out of sync, use the one with the highest counter value that works and rewrite the other. Add a checksum (could be something really simple even, like CRC32, but it would be good to make this extensible without needing to change the on-disk format) to protect against any corruption that somehow manages to slip past the FEC in the storage layer. In fact, that would be similar to how ZFS and Btrfs already solves pretty much the same problem. I would discourage complex features; in cryptography, simple and easy to validate should be the name of the game, and simply storing the same data in two distinct locations is _far_ easier to understand than code to calculate and use FEC data. -- Michael Kjörling • https://michael.kjorling.se • michael@kjorling.se “People who think they know everything really annoy those of us who know we don’t.” (Bjarne Stroustrup)