ceph: create symlinks with encrypted and base64-encoded targets
authorJeff Layton <jlayton@kernel.org>
Thu, 3 Sep 2020 17:31:10 +0000 (13:31 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 24 Aug 2023 09:24:35 +0000 (11:24 +0200)
commit79f2f6ad878c1f2cb9edc674c6a263ff2ef6d1fd
treea838ae257469f7b6ca9d71aea662aefc5b36a831
parentaf9ffa6df7e337599ce41165d9e6166a330c7b96
ceph: create symlinks with encrypted and base64-encoded targets

When creating symlinks in encrypted directories, encrypt and
base64-encode the target with the new inode's key before sending to the
MDS.

When filling a symlinked inode, base64-decode it into a buffer that
we'll keep in ci->i_symlink. When get_link is called, decrypt the buffer
into a new one that will hang off i_link.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/dir.c
fs/ceph/inode.c