https://github.com/torvalds/linux
Revision 03f219041fdbeb31cecff41bb1cb4e1018f9cf75 authored by Luis Henriques on 17 May 2017, 11:21:07 UTC, committed by Ilya Dryomov on 14 June 2017, 17:32:43 UTC
Converting a file handle to a dentry can be done call after the inode
unlink.  This means that __fh_to_dentry() requires an extra check to
verify the number of links is not 0.

The issue can be easily reproduced using xfstest generic/426, which does
something like:

    name_to_handle_at(&fh)
    echo 3 > /proc/sys/vm/drop_caches
    unlink()
    open_by_handle_at(&fh)

The call to open_by_handle_at() should fail, as the file doesn't exist
anymore.

Link: http://tracker.ceph.com/issues/19958
Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
1 parent 32c1431
History
Tip revision: 03f219041fdbeb31cecff41bb1cb4e1018f9cf75 authored by Luis Henriques on 17 May 2017, 11:21:07 UTC
ceph: check i_nlink while converting a file handle to dentry
Tip revision: 03f2190
File Mode Size
Makefile -rw-r--r-- 377 bytes
compat.c -rw-r--r-- 19.1 KB
compat_mq.c -rw-r--r-- 3.9 KB
ipc_sysctl.c -rw-r--r-- 5.4 KB
mq_sysctl.c -rw-r--r-- 2.9 KB
mqueue.c -rw-r--r-- 35.8 KB
msg.c -rw-r--r-- 23.5 KB
msgutil.c -rw-r--r-- 3.6 KB
namespace.c -rw-r--r-- 4.6 KB
sem.c -rw-r--r-- 55.5 KB
shm.c -rw-r--r-- 33.5 KB
syscall.c -rw-r--r-- 2.3 KB
util.c -rw-r--r-- 21.0 KB
util.h -rw-r--r-- 6.4 KB

back to top