Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933321AbbLHKSW (ORCPT ); Tue, 8 Dec 2015 05:18:22 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:36607 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932670AbbLHKSS (ORCPT ); Tue, 8 Dec 2015 05:18:18 -0500 Date: Tue, 8 Dec 2015 10:18:14 +0000 From: Sami Tolvanen To: Mike Snitzer Cc: Milan Broz , Mikulas Patocka , Mandeep Baines , Will Drewry , Alasdair Kergon , dm-devel@redhat.com, linux-kernel@vger.kernel.org, Kees Cook , Mark Salyzyn Subject: Re: [PATCH v2 0/2] dm verity: add support for error correction Message-ID: <20151208101814.GA9762@google.com> References: <1449152791-33586-1-git-send-email-samitolvanen@google.com> <20151203195401.GA5444@redhat.com> <20151203230538.GB5444@redhat.com> <20151204100305.GA37949@google.com> <20151204210935.GA63877@redhat.com> <20151207132149.GA7583@google.com> <20151207145814.GB29457@redhat.com> <20151207163108.GA21472@google.com> <5665CAD5.9000704@redhat.com> <20151207190743.GA30593@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151207190743.GA30593@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1218 Lines: 29 On Mon, Dec 07, 2015 at 02:07:43PM -0500, Mike Snitzer wrote: > I'm not seeing any verification of the metadata in fec_read_parity() -- > so it would seem that corrupt RS blocks would result in -EBADMSG being > returned from decode_rs8() (by virtue of incorrect parity being passed > to decode_rs8). > > Sami (or others) am I right? Yes, decode_rs8 failing with -EBADMSG is one option. There are also two other cases: 1) If the parity data is only partially corrupted, it may still be possible to correct errors, provided that the actual data isn't too severely corrupted. 2) If there's too much corruption for Reed-Solomon to detect, it's also possible that decode_rs8 just returns bogus data, which we will catch when verifying the hash again. This is why combining error correction with integrity checking is essential. In other words, the worst case is that we cannot correct errors for the blocks covered by the corrupted parity data. Sami -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/