+7
−11
+2
−17
+4
−14
+3
−4
+2
−2
Loading
Lift copying the name into callers of ceph_encode_encrypted_dname() that do not have it already copied; ceph_encode_encrypted_fname() disappears. That fixes a UAF in ceph_mdsc_build_path() - while the initial copy of plaintext into buf is done under ->d_lock, we access the original name again in ceph_encode_encrypted_fname() and that is done without any locking. With ceph_encode_encrypted_dname() using the stable copy the problem goes away. Tested-by:Viacheslav Dubeyko <Slava.Dubeyko@ibm.com> Reviewed-by:
Viacheslav Dubeyko <Slava.Dubeyko@ibm.com> Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>