kernel-fxtec-pro1x/fs/ceph
Xiubo Li d033576669 ceph: fix potential mdsc use-after-free crash
[ Upstream commit fa9967734227b44acb1b6918033f9122dc7825b9 ]

Make sure the delayed work stopped before releasing the resources.

cancel_delayed_work_sync() will only guarantee that the work finishes
executing if the work is already in the ->worklist.  That means after
the cancel_delayed_work_sync() returns, it will leave the work requeued
if it was rearmed at the end. That can lead to a use after free once the
work struct is freed.

Fix it by flushing the delayed work instead of trying to cancel it, and
ensure that the work doesn't rearm if the mdsc is stopping.

URL: https://tracker.ceph.com/issues/46293
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-09-03 11:24:22 +02:00
..
acl.c
addr.c
cache.c
cache.h
caps.c ceph: fix double unlock in handle_cap_export() 2020-05-27 17:37:34 +02:00
ceph_frag.c
debugfs.c
dir.c
export.c ceph: return ceph_mdsc_do_request() errors from __get_parent() 2020-04-29 16:31:10 +02:00
file.c
inode.c
ioctl.c
ioctl.h
Kconfig
locks.c
Makefile
mds_client.c ceph: fix potential mdsc use-after-free crash 2020-09-03 11:24:22 +02:00
mds_client.h
mdsmap.c
quota.c
snap.c
strings.c
super.c ceph: canonicalize server path in place 2020-04-13 10:45:12 +02:00
super.h ceph: canonicalize server path in place 2020-04-13 10:45:12 +02:00
xattr.c