mirror_zfs/module/spl
Richard Yao 1683e75edc Fix race between getf() and areleasef()
If a vnode is released asynchronously through areleasef(), it is
possible for the user process to reuse the file descriptor before
areleasef is called. When this happens, getf() will return a stale
reference, any operations in the kernel on that file descriptor will
fail (as it is closed) and the operations meant for that fd will
never occur from userspace's perspective.

We correct this by detecting this condition in getf(), doing a putf
on the old file handle, updating the file descriptor and proceeding
as if everything was fine. When the areleasef() is done, it will
harmlessly decrement the reference counter on the Illumos file handle.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #492
2015-12-03 15:44:47 -08:00
..
Makefile.in Support parallel build trees (VPATH builds) 2015-07-17 12:53:11 -07:00
spl-atomic.c Refresh links to web site 2013-03-04 19:09:34 -08:00
spl-condvar.c Rename cv_wait_interruptible() to cv_wait_sig() 2015-06-10 16:36:12 -07:00
spl-cred.c Remove credential configure checks. 2014-10-17 15:11:51 -07:00
spl-err.c Retire legacy debugging infrastructure 2014-11-19 10:35:07 -08:00
spl-generic.c Retire spl_module_init()/spl_module_fini() 2015-02-27 13:43:39 -08:00
spl-kmem-cache.c spl-kmem-cache: include linux/prefetch.h for prefetchw() 2015-12-02 12:45:06 -08:00
spl-kmem.c Optimize vmem_alloc() retry path 2015-02-02 10:57:56 -08:00
spl-kobj.c Fix GFP_KERNEL allocations flags 2015-01-21 15:25:19 -08:00
spl-kstat.c Refactor existing code 2015-01-16 13:55:08 -08:00
spl-mutex.c Remove adaptive mutex implementation 2014-10-17 15:07:28 -07:00
spl-proc.c Default to --disable-debug-kmem 2015-07-21 11:47:10 -07:00
spl-rwlock.c Refresh links to web site 2013-03-04 19:09:34 -08:00
spl-taskq.c Fix taskq dynamic spawning 2015-11-13 15:02:55 -08:00
spl-thread.c Retire legacy debugging infrastructure 2014-11-19 10:35:07 -08:00
spl-tsd.c Fix cstyle issues in spl-tsd.c 2015-04-24 14:23:07 -07:00
spl-vmem.c Add hooks for disabling direct reclaim 2015-01-16 13:55:09 -08:00
spl-vnode.c Fix race between getf() and areleasef() 2015-12-03 15:44:47 -08:00
spl-xdr.c Retire legacy debugging infrastructure 2014-11-19 10:35:07 -08:00
spl-zlib.c Refactor existing code 2015-01-16 13:55:08 -08:00