mirror_zfs/module
Richard Yao 313b1ea622 vn_getf/vn_releasef should not accept negative file descriptors
C type coercion rules require that negative numbers be converted into
positive numbers via wraparound such that a negative -1 becomes a
positive 1. This causes vn_getf to return a file handle when it should
return NULL whenever a positive file descriptor existed with the same
value. We should check for a negative file descriptor and return NULL
instead.

This was caught by ClusterHQ's unit testing.

Reference:
http://stackoverflow.com/questions/50605/signed-to-unsigned-conversion-in-c-is-it-always-safe

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Andriy Gapon <avg@FreeBSD.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #450
2015-04-24 13:02:00 -07:00
..
spl vn_getf/vn_releasef should not accept negative file descriptors 2015-04-24 13:02:00 -07:00
splat Reduce splat_taskq_test2_impl() stack frame size 2015-03-03 10:18:31 -08:00
.gitignore gitignore: anchor entries at their respective directory 2013-04-02 11:07:52 -07:00
Makefile.in Fix modules installation directory 2014-10-28 09:49:24 -07:00