summaryrefslogtreecommitdiff
path: root/firmware/sb16
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2017-03-23 23:39:46 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2017-03-24 16:51:34 +0300
commit9df0eb180c2074451f25556eb566d89c7057c2ac (patch)
tree493dfd3286e9d96b9c9ae42956136a4e9a7b5fb9 /firmware/sb16
parentefc989fce8703914bac091dcc4b8ff7a72ccf987 (diff)
downloadlinux-9df0eb180c2074451f25556eb566d89c7057c2ac.tar.xz
crypto: xts,lrw - fix out-of-bounds write after kmalloc failure
In the generic XTS and LRW algorithms, for input data > 128 bytes, a temporary buffer is allocated to hold the values to be XOR'ed with the data before and after encryption or decryption. If the allocation fails, the fixed-size buffer embedded in the request buffer is meant to be used as a fallback --- resulting in more calls to the ECB algorithm, but still producing the correct result. However, we weren't correctly limiting subreq->cryptlen in this case, resulting in pre_crypt() overrunning the embedded buffer. Fix this by setting subreq->cryptlen correctly. Fixes: f1c131b45410 ("crypto: xts - Convert to skcipher") Fixes: 700cb3f5fe75 ("crypto: lrw - Convert to skcipher") Cc: stable@vger.kernel.org # v4.10+ Reported-by: Dmitry Vyukov <dvyukov@google.com> Signed-off-by: Eric Biggers <ebiggers@google.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'firmware/sb16')
0 files changed, 0 insertions, 0 deletions