summaryrefslogtreecommitdiff
path: root/crypto/crypto_engine.c
diff options
context:
space:
mode:
authorRoberto Sassu <roberto.sassu@huawei.com>2022-12-08 10:56:46 +0100
committerRoberto Sassu <roberto.sassu@huawei.com>2023-06-02 15:36:23 +0200
commitcffed9ba1fdc029fdeb4f90182fe779e2be08599 (patch)
tree5dfb5073569ca94b6fb818f3a8baea2f6d98527c /crypto/crypto_engine.c
parente60bd99e21a31895365d24377fd89b57e838d363 (diff)
downloadlinux-crypto-cffed9ba1fdc029fdeb4f90182fe779e2be08599.tar.gz
linux-crypto-cffed9ba1fdc029fdeb4f90182fe779e2be08599.zip
KEYS: asymmetric: Copy sig and digest in public_key_verify_signature()
Commit ac4e97abce9b8 ("scatterlist: sg_set_buf() argument must be in linear mapping") checks that both the signature and the digest reside in the linear mapping area. However, more recently commit ba14a194a434c ("fork: Add generic vmalloced stack support") made it possible to move the stack in the vmalloc area, which is not contiguous, and thus not suitable for sg_set_buf() which needs adjacent pages. Always make a copy of the signature and digest in the same buffer used to store the key and its parameters, and pass them to sg_init_one(). Prefer it to conditionally doing the copy if necessary, to keep the code simple. The buffer allocated with kmalloc() is in the linear mapping area. Cc: stable@vger.kernel.org # 4.9.x Fixes: ba14a194a434 ("fork: Add generic vmalloced stack support") Link: https://lore.kernel.org/linux-integrity/Y4pIpxbjBdajymBJ@sol.localdomain/ Suggested-by: Eric Biggers <ebiggers@kernel.org> Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com> Reviewed-by: Eric Biggers <ebiggers@google.com> Tested-by: Stefan Berger <stefanb@linux.ibm.com>
Diffstat (limited to 'crypto/crypto_engine.c')
0 files changed, 0 insertions, 0 deletions