diff options
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/ahash.c | 4 | ||||
-rw-r--r-- | crypto/async_tx/async_memcpy.c | 8 | ||||
-rw-r--r-- | crypto/blkcipher.c | 8 | ||||
-rw-r--r-- | crypto/ccm.c | 4 | ||||
-rw-r--r-- | crypto/crypto_user.c | 12 | ||||
-rw-r--r-- | crypto/scatterwalk.c | 8 | ||||
-rw-r--r-- | crypto/shash.c | 8 |
7 files changed, 28 insertions, 24 deletions
diff --git a/crypto/ahash.c b/crypto/ahash.c index ac93c99cfae..33bc9b62e9a 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c @@ -46,7 +46,7 @@ static int hash_walk_next(struct crypto_hash_walk *walk) unsigned int nbytes = min(walk->entrylen, ((unsigned int)(PAGE_SIZE)) - offset); - walk->data = crypto_kmap(walk->pg, 0); + walk->data = kmap_atomic(walk->pg); walk->data += offset; if (offset & alignmask) { @@ -93,7 +93,7 @@ int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err) return nbytes; } - crypto_kunmap(walk->data, 0); + kunmap_atomic(walk->data); crypto_yield(walk->flags); if (err) diff --git a/crypto/async_tx/async_memcpy.c b/crypto/async_tx/async_memcpy.c index 0d5a90ca650..361b5e8239b 100644 --- a/crypto/async_tx/async_memcpy.c +++ b/crypto/async_tx/async_memcpy.c @@ -79,13 +79,13 @@ async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset, /* wait for any prerequisite operations */ async_tx_quiesce(&submit->depend_tx); - dest_buf = kmap_atomic(dest, KM_USER0) + dest_offset; - src_buf = kmap_atomic(src, KM_USER1) + src_offset; + dest_buf = kmap_atomic(dest) + dest_offset; + src_buf = kmap_atomic(src) + src_offset; memcpy(dest_buf, src_buf, len); - kunmap_atomic(src_buf, KM_USER1); - kunmap_atomic(dest_buf, KM_USER0); + kunmap_atomic(src_buf); + kunmap_atomic(dest_buf); async_tx_sync_epilog(submit); } diff --git a/crypto/blkcipher.c b/crypto/blkcipher.c index 1e61d1a888b..4dd80c72549 100644 --- a/crypto/blkcipher.c +++ b/crypto/blkcipher.c @@ -43,22 +43,22 @@ static int blkcipher_walk_first(struct blkcipher_desc *desc, static inline void blkcipher_map_src(struct blkcipher_walk *walk) { - walk->src.virt.addr = scatterwalk_map(&walk->in, 0); + walk->src.virt.addr = scatterwalk_map(&walk->in); } static inline void blkcipher_map_dst(struct blkcipher_walk *walk) { - walk->dst.virt.addr = scatterwalk_map(&walk->out, 1); + walk->dst.virt.addr = scatterwalk_map(&walk->out); } static inline void blkcipher_unmap_src(struct blkcipher_walk *walk) { - scatterwalk_unmap(walk->src.virt.addr, 0); + scatterwalk_unmap(walk->src.virt.addr); } static inline void blkcipher_unmap_dst(struct blkcipher_walk *walk) { - scatterwalk_unmap(walk->dst.virt.addr, 1); + scatterwalk_unmap(walk->dst.virt.addr); } /* Get a spot of the specified length that does not straddle a page. diff --git a/crypto/ccm.c b/crypto/ccm.c index c36d654cf56..32fe1bb5dec 100644 --- a/crypto/ccm.c +++ b/crypto/ccm.c @@ -216,12 +216,12 @@ static void get_data_to_compute(struct crypto_cipher *tfm, scatterwalk_start(&walk, sg_next(walk.sg)); n = scatterwalk_clamp(&walk, len); } - data_src = scatterwalk_map(&walk, 0); + data_src = scatterwalk_map(&walk); compute_mac(tfm, data_src, n, pctx); len -= n; - scatterwalk_unmap(data_src, 0); + scatterwalk_unmap(data_src); scatterwalk_advance(&walk, n); scatterwalk_done(&walk, 0, len); if (len) diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c index 3e61cc101e8..f76e42bcc6e 100644 --- a/crypto/crypto_user.c +++ b/crypto/crypto_user.c @@ -382,16 +382,20 @@ static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) type -= CRYPTO_MSG_BASE; link = &crypto_dispatch[type]; - if (security_netlink_recv(skb, CAP_NET_ADMIN)) + if (!capable(CAP_NET_ADMIN)) return -EPERM; if ((type == (CRYPTO_MSG_GETALG - CRYPTO_MSG_BASE) && (nlh->nlmsg_flags & NLM_F_DUMP))) { if (link->dump == NULL) return -EINVAL; - - return netlink_dump_start(crypto_nlsk, skb, nlh, - link->dump, link->done, 0); + { + struct netlink_dump_control c = { + .dump = link->dump, + .done = link->done, + }; + return netlink_dump_start(crypto_nlsk, skb, nlh, &c); + } } err = nlmsg_parse(nlh, crypto_msg_min[type], attrs, CRYPTOCFGA_MAX, diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c index 41e529af077..7281b8a93ad 100644 --- a/crypto/scatterwalk.c +++ b/crypto/scatterwalk.c @@ -40,9 +40,9 @@ void scatterwalk_start(struct scatter_walk *walk, struct scatterlist *sg) } EXPORT_SYMBOL_GPL(scatterwalk_start); -void *scatterwalk_map(struct scatter_walk *walk, int out) +void *scatterwalk_map(struct scatter_walk *walk) { - return crypto_kmap(scatterwalk_page(walk), out) + + return kmap_atomic(scatterwalk_page(walk)) + offset_in_page(walk->offset); } EXPORT_SYMBOL_GPL(scatterwalk_map); @@ -83,9 +83,9 @@ void scatterwalk_copychunks(void *buf, struct scatter_walk *walk, if (len_this_page > nbytes) len_this_page = nbytes; - vaddr = scatterwalk_map(walk, out); + vaddr = scatterwalk_map(walk); memcpy_dir(buf, vaddr, len_this_page, out); - scatterwalk_unmap(vaddr, out); + scatterwalk_unmap(vaddr); scatterwalk_advance(walk, len_this_page); diff --git a/crypto/shash.c b/crypto/shash.c index 9100912716a..21fc12e2378 100644 --- a/crypto/shash.c +++ b/crypto/shash.c @@ -281,10 +281,10 @@ int shash_ahash_digest(struct ahash_request *req, struct shash_desc *desc) if (nbytes < min(sg->length, ((unsigned int)(PAGE_SIZE)) - offset)) { void *data; - data = crypto_kmap(sg_page(sg), 0); + data = kmap_atomic(sg_page(sg)); err = crypto_shash_digest(desc, data + offset, nbytes, req->result); - crypto_kunmap(data, 0); + kunmap_atomic(data); crypto_yield(desc->flags); } else err = crypto_shash_init(desc) ?: @@ -420,9 +420,9 @@ static int shash_compat_digest(struct hash_desc *hdesc, struct scatterlist *sg, desc->flags = hdesc->flags; - data = crypto_kmap(sg_page(sg), 0); + data = kmap_atomic(sg_page(sg)); err = crypto_shash_digest(desc, data + offset, nbytes, out); - crypto_kunmap(data, 0); + kunmap_atomic(data); crypto_yield(desc->flags); goto out; } |