crypto: ccp - Validate the the error value used to index error messages
authorHook, Gary <Gary.Hook@amd.com>
Thu, 27 Jun 2019 16:16:23 +0000 (16:16 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jul 2019 05:28:35 +0000 (07:28 +0200)
commitfb8ee4908c3910f0f0510b18eb8c9f7eb3f34a1f
treebf11268f09746deacc084f95b9f84bb7e7b11502
parentb91ea84bfedd47e75f949d13748e2da88e32df3e
crypto: ccp - Validate the the error value used to index error messages

commit 52393d617af7b554f03531e6756facf2ea687d2e upstream.

The error code read from the queue status register is only 6 bits wide,
but we need to verify its value is within range before indexing the error
messages.

Fixes: 81422badb3907 ("crypto: ccp - Make syslog errors human-readable")
Cc: <stable@vger.kernel.org>
Reported-by: Cfir Cohen <cfir@google.com>
Signed-off-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/ccp/ccp-dev.c
drivers/crypto/ccp/ccp-dev.h