mirror_zfs/lib
Richard Yao dcce0dc5f0
Fix oversights from 4170ae4e
4170ae4ea6 was intended to tackle TOCTOU
race conditions reported by CodeQL, but as an oversight, a file
descriptor was not closed and some comments were not updated.
Interestingly, CodeQL did not complain about the file descriptor leak,
so there is room for improvement in how we configure it to try to detect
this issue so that we get early warning about this.

In addition, an optimization opportunity was missed by mistake in
lib/libshare/os/linux/smb.c, which prevented us from truly closing the
TOCTOU race. This was also caught by Coverity.

Reported-by: Coverity (CID 1524424)
Reported-by: Coverity (CID 1526804)
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14109
2022-10-31 10:01:04 -07:00
..
libavl cppcheck: explicitly exclude kernel code from userspace checks 2022-05-10 10:20:55 -07:00
libefi Fix multiplication converted to larger type 2022-10-28 09:30:37 -07:00
libicp Introduce BLAKE3 checksums as an OpenZFS feature 2022-06-08 15:55:57 -07:00
libnvpair Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
libshare Fix oversights from 4170ae4e 2022-10-31 10:01:04 -07:00
libspl Introduce kmem_scnprintf() 2022-10-29 13:05:11 -07:00
libtpool Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
libunicode cppcheck: explicitly exclude kernel code from userspace checks 2022-05-10 10:20:55 -07:00
libuutil Cleanup: Remove unused uu_pname code 2022-09-19 17:33:52 -07:00
libzfs Introduce kmem_scnprintf() 2022-10-29 13:05:11 -07:00
libzfs_core Fix potential NULL pointer dereference in lzc_ioctl() 2022-10-14 13:33:22 -07:00
libzfsbootenv Fix unchecked return values and unused return values 2022-09-23 16:52:03 -07:00
libzpool Introduce kmem_scnprintf() 2022-10-29 13:05:11 -07:00
libzstd cppcheck: explicitly exclude kernel code from userspace checks 2022-05-10 10:20:55 -07:00
libzutil Aligned free for aligned alloc 2022-10-26 15:08:31 -07:00
Makefile.am autoconf: use include directives instead of recursing down lib 2022-05-10 10:18:11 -07:00