]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: nx - off by one bug in nx_of_update_msc()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 15 Jul 2016 11:09:13 +0000 (14:09 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Sep 2016 06:30:00 +0000 (08:30 +0200)
commitd8a447ac8a875ba63b368a5bf0924d3ef87fb7de
treecd62f764c64bfc6931aecfada85af56c40624ab6
parentab9668bfd026b60218967d796ea53a662fbea6a2
crypto: nx - off by one bug in nx_of_update_msc()

commit e514cc0a492a3f39ef71b31590a7ef67537ee04b upstream.

The props->ap[] array is defined like this:

struct alg_props ap[NX_MAX_FC][NX_MAX_MODE][3];

So we can see that if msc->fc and msc->mode are == to NX_MAX_FC or
NX_MAX_MODE then we're off by one.

Fixes: ae0222b7289d ('powerpc/crypto: nx driver code supporting nx encryption')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/nx/nx.c