All of lore.kernel.org
 help / color / mirror / Atom feed
From: Corentin LABBE <clabbe.montjoie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org"
	<linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: [BUG] crypto: sun4i-ss: Random data corruption
Date: Sun, 13 Mar 2016 13:40:26 +0100	[thread overview]
Message-ID: <56E55FBA.90703@gmail.com> (raw)

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

WARNING: multiple messages have this Message-ID (diff)
From: clabbe.montjoie@gmail.com (Corentin LABBE)
To: linux-arm-kernel@lists.infradead.org
Subject: [BUG] crypto: sun4i-ss: Random data corruption
Date: Sun, 13 Mar 2016 13:40:26 +0100	[thread overview]
Message-ID: <56E55FBA.90703@gmail.com> (raw)

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

WARNING: multiple messages have this Message-ID (diff)
From: Corentin LABBE <clabbe.montjoie@gmail.com>
To: "linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"linux-sunxi@googlegroups.com" <linux-sunxi@googlegroups.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: [BUG] crypto: sun4i-ss: Random data corruption
Date: Sun, 13 Mar 2016 13:40:26 +0100	[thread overview]
Message-ID: <56E55FBA.90703@gmail.com> (raw)

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

             reply	other threads:[~2016-03-13 12:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-13 12:40 Corentin LABBE [this message]
2016-03-13 12:40 ` [BUG] crypto: sun4i-ss: Random data corruption Corentin LABBE
2016-03-13 12:40 ` Corentin LABBE

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56E55FBA.90703@gmail.com \
    --to=clabbe.montjoie-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.