Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754027AbcCMMkb (ORCPT ); Sun, 13 Mar 2016 08:40:31 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:36918 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752191AbcCMMk3 (ORCPT ); Sun, 13 Mar 2016 08:40:29 -0400 To: "linux-crypto@vger.kernel.org" , Linux Kernel Mailing List , "linux-sunxi@googlegroups.com" , "linux-arm-kernel@lists.infradead.org" From: Corentin LABBE Subject: [BUG] crypto: sun4i-ss: Random data corruption Message-ID: <56E55FBA.90703@gmail.com> Date: Sun, 13 Mar 2016 13:40:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 912 Lines: 17 Hello I had some report of random data corruption of people using cryptsetup with my sun4i-ss driver (via AF_ALG). Even if it is hard to hit, I could confirm it by continuously moving files on a LUKS encrypted FS and comparing hash of it before and after. The corruption is always when deciphering the end of 512bytes sector and always of a length multiple of 4. The only way of removing this random corruption is to transform all spinlock_bh by spinlock_irqsave. In fact this problem is extremely similar to another bug that I have encountered (https://lkml.org/lkml/2015/10/11/47) The only difference is that I do not need to remove SG_MITER_ATOMIC for removing the issue. So my question remains nearly the same than on my first problem: Why disabling irq remove this data corruption ? Any help/suggestions will be really appreciated since I doesn't understand why this fix works. Regards LABBE Corentin