android_kernel_samsung_msm8976/net/ceph
Ilya Dryomov a9f1235c8c libceph: introduce ceph_crypt() for in-place en/decryption
Starting with 4.9, kernel stacks may be vmalloced and therefore not
guaranteed to be physically contiguous; the new CONFIG_VMAP_STACK
option is enabled by default on x86.  This makes it invalid to use
on-stack buffers with the crypto scatterlist API, as sg_set_buf()
expects a logical address and won't work with vmalloced addresses.

There isn't a different (e.g. kvec-based) crypto API we could switch
net/ceph/crypto.c to and the current scatterlist.h API isn't getting
updated to accommodate this use case.  Allocating a new header and
padding for each operation is a non-starter, so do the en/decryption
in-place on a single pre-assembled (header + data + padding) heap
buffer.  This is explicitly supported by the crypto API:

    "... the caller may provide the same scatter/gather list for the
     plaintext and cipher text. After the completion of the cipher
     operation, the plaintext data is replaced with the ciphertext data
     in case of an encryption and vice versa for a decryption."

Change-Id: I554cae76340899bb6f00e2e06230f3a27da186a1
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Sage Weil <sage@redhat.com>
2017-04-22 23:02:50 +02:00
..
crush crush: avoid recursion if we have already collided 2013-01-17 12:42:39 -06:00
Kconfig net/ceph: remove depends on CONFIG_EXPERIMENTAL 2013-01-11 11:39:33 -08:00
Makefile libceph: create source file "net/ceph/snapshot.c" 2013-05-01 21:20:08 -07:00
armor.c
auth.c libceph: wrap auth methods in a mutex 2013-05-01 21:17:15 -07:00
auth_none.c libceph: Fix NULL pointer dereference in auth client code 2013-07-13 11:42:25 -07:00
auth_none.h
auth_x.c libceph: do not hard code max auth ticket len 2014-09-17 09:04:01 -07:00
auth_x.h libceph: add update_authorizer auth method 2013-05-01 21:17:13 -07:00
auth_x_protocol.h
buffer.c
ceph_common.c libceph: use slab cache for osd client requests 2013-05-02 11:58:41 -05:00
ceph_fs.c
ceph_hash.c
ceph_strings.c libceph: update ceph_osd_op_name() 2013-02-18 12:20:18 -06:00
crypto.c libceph: introduce ceph_crypt() for in-place en/decryption 2017-04-22 23:02:50 +02:00
crypto.h libceph: introduce ceph_crypt() for in-place en/decryption 2017-04-22 23:02:50 +02:00
debugfs.c libceph: keep source rather than message osd op array 2013-05-01 21:18:12 -07:00
messenger.c libceph: don't bail early from try_read() when skipping a message 2016-03-03 15:06:24 -08:00
mon_client.c libceph: gracefully handle large reply messages from the mon 2014-09-17 09:04:02 -07:00
msgpool.c libceph: initialize msgpool message types 2012-07-30 09:29:50 -07:00
osd_client.c libceph: request a new osdmap if lingering request maps to no osd 2015-06-05 23:19:54 -07:00
osdmap.c crush: fix a bug in tree bucket decode 2015-08-03 09:29:46 -07:00
pagelist.c ceph: use list_move_tail instead of list_del/list_add_tail 2012-10-01 14:30:49 -05:00
pagevec.c libceph: drop return value from page vector copy routines 2013-02-19 19:14:05 -06:00
snapshot.c libceph: create source file "net/ceph/snapshot.c" 2013-05-01 21:20:08 -07:00