]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
ceph: canonicalize server path in place
authorIlya Dryomov <idryomov@gmail.com>
Mon, 10 Feb 2020 21:51:08 +0000 (22:51 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 5 May 2020 10:32:22 +0000 (12:32 +0200)
commit8d7750aeacdf9430ffd9272e9a30d55d499df53d
treec4baf91e0eaa1bb9da0e0056e97cfeac0feb1f1b
parentfd417593d91ed1e443f3c80facbba9a04acb2456
ceph: canonicalize server path in place

BugLink: https://bugs.launchpad.net/bugs/1873292
commit b27a939e8376a3f1ed09b9c33ef44d20f18ec3d0 upstream.

syzbot reported that 4fbc0c711b24 ("ceph: remove the extra slashes in
the server path") had caused a regression where an allocation could be
done under a spinlock -- compare_mount_options() is called by sget_fc()
with sb_lock held.

We don't really need the supplied server path, so canonicalize it
in place and compare it directly.  To make this work, the leading
slash is kept around and the logic in ceph_real_mount() to skip it
is restored.  CEPH_MSG_CLIENT_SESSION now reports the same (i.e.
canonicalized) path, with the leading slash of course.

Fixes: 4fbc0c711b24 ("ceph: remove the extra slashes in the server path")
Reported-by: syzbot+98704a51af8e3d9425a9@syzkaller.appspotmail.com
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Luis Henriques <lhenriques@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
fs/ceph/super.c
fs/ceph/super.h