diff options
author | David S. Miller <davem@davemloft.net> | 2015-02-11 19:48:14 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-11 19:48:14 -0800 |
commit | baefc38c7ec56afcfa92594930b747a050c599b7 (patch) | |
tree | 962383f0b460f77f3f40909870186eda06aad39d | |
parent | 126d18a6f67ad8d29388d82a448b178e2ac1a77c (diff) | |
parent | 13a7af2378dfab31fd00e73f1986e92b60e09377 (diff) | |
download | linux-crypto-baefc38c7ec56afcfa92594930b747a050c599b7.tar.gz linux-crypto-baefc38c7ec56afcfa92594930b747a050c599b7.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
I pushed a version of the crypto iov_iter bug fix that
Al Viro wrote, but Linus put in a different copy of the
same fix into his tree.
I then reverted my commit in net-next, and that's why we have a merge
when pulling in Linus's tree.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | crypto/af_alg.c | 2 | ||||
-rw-r--r-- | crypto/algif_skcipher.c | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/crypto/af_alg.c b/crypto/af_alg.c index eb78fe8a..3e80d8b8 100644 --- a/crypto/af_alg.c +++ b/crypto/af_alg.c @@ -348,7 +348,7 @@ int af_alg_make_sg(struct af_alg_sgl *sgl, struct iov_iter *iter, int len) if (n < 0) return n; - npages = PAGE_ALIGN(off + n); + npages = (off + n + PAGE_SIZE - 1) >> PAGE_SHIFT; if (WARN_ON(npages == 0)) return -EINVAL; diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c index 37110fd6..6fc12c3f 100644 --- a/crypto/algif_skcipher.c +++ b/crypto/algif_skcipher.c @@ -439,14 +439,13 @@ static int skcipher_recvmsg(struct kiocb *unused, struct socket *sock, while (!sg->length) sg++; - used = ctx->used; - if (!used) { + if (!ctx->used) { err = skcipher_wait_for_data(sk, flags); if (err) goto unlock; } - used = min_t(unsigned long, used, iov_iter_count(&msg->msg_iter)); + used = min_t(unsigned long, ctx->used, iov_iter_count(&msg->msg_iter)); used = af_alg_make_sg(&ctx->rsgl, &msg->msg_iter, used); err = used; |