diff options
author | Stephan Mueller <smueller@chronox.de> | 2018-01-18 20:41:09 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-01-26 01:10:32 +1100 |
commit | 9c674e1e2f9e24fa4392167efe343749008338e0 (patch) | |
tree | 9d46e93153884b77407904a79fb3f0c33eff6128 /crypto/sha3_generic.c | |
parent | 980b4c95e78e4113cb7b9f430f121dab1c814b6c (diff) | |
download | lwn-9c674e1e2f9e24fa4392167efe343749008338e0.tar.gz lwn-9c674e1e2f9e24fa4392167efe343749008338e0.zip |
crypto: aesni - handle zero length dst buffer
GCM can be invoked with a zero destination buffer. This is possible if
the AAD and the ciphertext have zero lengths and only the tag exists in
the source buffer (i.e. a source buffer cannot be zero). In this case,
the GCM cipher only performs the authentication and no decryption
operation.
When the destination buffer has zero length, it is possible that no page
is mapped to the SG pointing to the destination. In this case,
sg_page(req->dst) is an invalid access. Therefore, page accesses should
only be allowed if the req->dst->length is non-zero which is the
indicator that a page must exist.
This fixes a crash that can be triggered by user space via AF_ALG.
CC: <stable@vger.kernel.org>
Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/sha3_generic.c')
0 files changed, 0 insertions, 0 deletions