diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-03-31 15:11:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-03-31 15:11:32 -0400 |
commit | 035f0cd3f8d86db900cde083d8ed8a7b0ce1221a (patch) | |
tree | 487dd2abfba97144474092fa70e79bd31c5e7c57 /crypto | |
parent | 728f4b3aa6621aba12e9f9c2f006f2912a90463a (diff) | |
parent | 9df0eb180c2074451f25556eb566d89c7057c2ac (diff) |
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu:
"This fixes the following issues:
- memory corruption when kmalloc fails in xts/lrw
- mark some CCP DMA channels as private
- fix reordering race in padata
- regression in omap-rng DT description"
* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
crypto: xts,lrw - fix out-of-bounds write after kmalloc failure
crypto: ccp - Make some CCP DMA channels private
padata: avoid race in reordering
dt-bindings: rng: clocks property on omap_rng not always mandatory
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/lrw.c | 7 | ||||
-rw-r--r-- | crypto/xts.c | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/crypto/lrw.c b/crypto/lrw.c index ecd8474018e3..3ea095adafd9 100644 --- a/crypto/lrw.c +++ b/crypto/lrw.c | |||
@@ -286,8 +286,11 @@ static int init_crypt(struct skcipher_request *req, crypto_completion_t done) | |||
286 | 286 | ||
287 | subreq->cryptlen = LRW_BUFFER_SIZE; | 287 | subreq->cryptlen = LRW_BUFFER_SIZE; |
288 | if (req->cryptlen > LRW_BUFFER_SIZE) { | 288 | if (req->cryptlen > LRW_BUFFER_SIZE) { |
289 | subreq->cryptlen = min(req->cryptlen, (unsigned)PAGE_SIZE); | 289 | unsigned int n = min(req->cryptlen, (unsigned int)PAGE_SIZE); |
290 | rctx->ext = kmalloc(subreq->cryptlen, gfp); | 290 | |
291 | rctx->ext = kmalloc(n, gfp); | ||
292 | if (rctx->ext) | ||
293 | subreq->cryptlen = n; | ||
291 | } | 294 | } |
292 | 295 | ||
293 | rctx->src = req->src; | 296 | rctx->src = req->src; |
diff --git a/crypto/xts.c b/crypto/xts.c index baeb34dd8582..c976bfac29da 100644 --- a/crypto/xts.c +++ b/crypto/xts.c | |||
@@ -230,8 +230,11 @@ static int init_crypt(struct skcipher_request *req, crypto_completion_t done) | |||
230 | 230 | ||
231 | subreq->cryptlen = XTS_BUFFER_SIZE; | 231 | subreq->cryptlen = XTS_BUFFER_SIZE; |
232 | if (req->cryptlen > XTS_BUFFER_SIZE) { | 232 | if (req->cryptlen > XTS_BUFFER_SIZE) { |
233 | subreq->cryptlen = min(req->cryptlen, (unsigned)PAGE_SIZE); | 233 | unsigned int n = min(req->cryptlen, (unsigned int)PAGE_SIZE); |
234 | rctx->ext = kmalloc(subreq->cryptlen, gfp); | 234 | |
235 | rctx->ext = kmalloc(n, gfp); | ||
236 | if (rctx->ext) | ||
237 | subreq->cryptlen = n; | ||
235 | } | 238 | } |
236 | 239 | ||
237 | rctx->src = req->src; | 240 | rctx->src = req->src; |