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>
Fri, 26 Jul 2019 07:14:19 +0000 (09:14 +0200)
commit52f07c1ac70e2ed0f9f49baf7e55d501364f6019
tree1c716f939aee374dfa7461ef29a2545fcd1ad8c2
parentbed97f6469974aecf3db3874e2cfcf5ae4d14018
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