1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-23 08:35:19 -05:00
linux/fs/ceph
Xiubo Li 8e1858710d ceph: avoid use-after-free in ceph_fl_release_lock()
When ceph releasing the file_lock it will try to get the inode pointer
from the fl->fl_file, which the memory could already be released by
another thread in filp_close(). Because in VFS layer the fl->fl_file
doesn't increase the file's reference counter.

Will switch to use ceph dedicate lock info to track the inode.

And in ceph_fl_release_lock() we should skip all the operations if the
fl->fl_u.ceph.inode is not set, which should come from the request
file_lock. And we will set fl->fl_u.ceph.inode when inserting it to the
inode lock list, which is when copying the lock.

Link: https://tracker.ceph.com/issues/57986
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2023-01-02 12:27:25 +01:00
..
acl.c
addr.c
cache.c
cache.h
caps.c ceph: switch to vfs_inode_has_locks() to fix file lock bug 2023-01-02 12:27:25 +01:00
ceph_frag.c
debugfs.c
dir.c
export.c
file.c
inode.c
io.c
io.h
ioctl.c
ioctl.h
Kconfig
locks.c ceph: avoid use-after-free in ceph_fl_release_lock() 2023-01-02 12:27:25 +01:00
Makefile
mds_client.c
mds_client.h
mdsmap.c
metric.c
metric.h
quota.c
snap.c
strings.c
super.c
super.h ceph: switch to vfs_inode_has_locks() to fix file lock bug 2023-01-02 12:27:25 +01:00
util.c
xattr.c