]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
client: use path walk and on-the-fly enc/dec for fscrypt
authorPatrick Donnelly <pdonnell@ibm.com>
Fri, 7 Mar 2025 15:33:55 +0000 (10:33 -0500)
committerChristopher Hoffman <choffman@redhat.com>
Wed, 5 Nov 2025 13:59:35 +0000 (13:59 +0000)
commit23c38d170426d723545883573525df7b5b8eea14
tree7eab8f60a08f457fa47969b17c2d81d5ade03602
parentbf76f37507d1479d4da1b7f0b7f9596a3f72c144
client: use path walk and on-the-fly enc/dec for fscrypt

The code before would encrypt/decrypt the dentry and store the result as the
dentry name. This would cause the client to have a different view of the dentry
names compared to the MDS. This created an unnecessary and complex divergence
that requires fixing the name in any code path involving the MDS.

Instead, maintain the same view as before with the MDS. The client uses the new
`Client::path_walk`, `Client::_wrap_name`, and `Client::_unwrap_name`
mechanisms to correctly change from the application's namespace (unencrypted /
case insensitve names) to the Client/MDS namespace.

The complication here is that the Client now needs to recompute the
encrypted/decrypted name for any path walk. This can and should be mitigated by
memoizing the results of the decryption/encryption. This is particularly
important as we can keep the decrypted names in a separate memory region that
is protected from core dump / trace inspection.

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
src/client/Client.cc
src/client/Client.h
src/client/Dentry.h
src/client/FSCrypt.cc
src/client/FSCrypt.h
src/client/Inode.cc
src/client/Inode.h