]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 3 Jul 2019 14:13:12 +0000 (22:13 +0800)
commit90bd81f47e3bdfd59a188a73bf6d842d03645b24
tree56a98bb9cd2c002ffaecbf2ff702f3d3fbd2a430
parentf60da6cd5d194b06281723823794c20164cc6dd6
crypto: ccp - Validate the the error value used to index error messages

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: e7760c6a3c5c9 ("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>
drivers/crypto/ccp/ccp-dev.c
drivers/crypto/ccp/ccp-dev.h