linux/fs/ceph
Xiubo Li 2b2515b809 ceph: fix potential use-after-free bug when trimming caps
commit aaf67de788 upstream.

When trimming the caps and just after the 'session->s_cap_lock' is
released in ceph_iterate_session_caps() the cap maybe removed by
another thread, and when using the stale cap memory in the callbacks
it will trigger use-after-free crash.

We need to check the existence of the cap just after the 'ci->i_ceph_lock'
being acquired. And do nothing if it's already removed.

Cc: stable@vger.kernel.org
Link: https://tracker.ceph.com/issues/43272
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Luís Henriques <lhenriques@suse.de>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-11 23:03:05 +09:00
..
acl.c
addr.c ceph: blocklist the kclient when receiving corrupted snap trace 2023-02-22 12:59:45 +01:00
cache.c
cache.h
caps.c ceph: fix potential use-after-free bug when trimming caps 2023-05-11 23:03:05 +09:00
ceph_frag.c
debugfs.c ceph: fix potential use-after-free bug when trimming caps 2023-05-11 23:03:05 +09:00
dir.c
export.c
file.c ceph: update the time stamps and try to drop the suid/sgid 2023-03-10 09:34:25 +01:00
inode.c
io.c
io.h
ioctl.c
ioctl.h
Kconfig
locks.c
Makefile
mds_client.c ceph: fix potential use-after-free bug when trimming caps 2023-05-11 23:03:05 +09:00
mds_client.h ceph: fix potential use-after-free bug when trimming caps 2023-05-11 23:03:05 +09:00
mdsmap.c
metric.c
metric.h
quota.c
snap.c ceph: blocklist the kclient when receiving corrupted snap trace 2023-02-22 12:59:45 +01:00
strings.c
super.c
super.h ceph: fix potential use-after-free bug when trimming caps 2023-05-11 23:03:05 +09:00
util.c
xattr.c