crypto: echainiv - Replace chaining with multiplication
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 7 Sep 2016 10:42:08 +0000 (18:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Sep 2016 08:18:34 +0000 (10:18 +0200)
commit2426cdb3f4a33704f1a8f9ee167f82ef5be516ba
tree7a318092ca3d039669b083801bba4e986d32e875
parent1c95a8a481efa5716b847b75f9c8b26f65844362
crypto: echainiv - Replace chaining with multiplication

commit 53a5d5ddccf849dbc27a8c1bba0b43c3a45fb792 upstream.

The current implementation uses a global per-cpu array to store
data which are used to derive the next IV.  This is insecure as
the attacker may change the stored data.

This patch removes all traces of chaining and replaces it with
multiplication of the salt and the sequence number.

Fixes: a10f554fa7e0 ("crypto: echainiv - Add encrypted chain IV...")
Reported-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
crypto/echainiv.c