android_kernel_samsung_msm8226/net/ceph
Ilya Dryomov 1c146584e4 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>
CVE-2016-10153
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
2019-08-06 11:48:20 +02:00
..
crush
Kconfig
Makefile
armor.c
auth.c
auth_none.c
auth_none.h
auth_x.c
auth_x.h
auth_x_protocol.h
buffer.c
ceph_common.c
ceph_fs.c
ceph_hash.c
ceph_strings.c
crypto.c libceph: introduce ceph_crypt() for in-place en/decryption 2019-08-06 11:48:20 +02:00
crypto.h libceph: introduce ceph_crypt() for in-place en/decryption 2019-08-06 11:48:20 +02:00
debugfs.c
messenger.c
mon_client.c
msgpool.c
osd_client.c
osdmap.c
pagelist.c
pagevec.c