]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
7233 dir_is_empty should open directory with CLOEXEC
authorAndriy Gapon <avg@FreeBSD.org>
Fri, 14 Apr 2017 17:22:54 +0000 (17:22 +0000)
committerAndriy Gapon <avg@FreeBSD.org>
Fri, 14 Apr 2017 17:22:54 +0000 (17:22 +0000)
commit68d57fec79f5dfb431a2d1e38585a87f6e41313b
tree763baaa7ec226825d59ba44dadfa81fd2271c67a
parent8ba67dd37f19e15ecb61765fb025de9b2174932d
7233 dir_is_empty should open directory with CLOEXEC

illumos/illumos-gate@d420209d9c807f782c1d31f5683be74798142198
https://github.com/illumos/illumos-gate/commit/d420209d9c807f782c1d31f5683be74798142198

https://www.illumos.org/issues/7233
  This fixes a race where one thread is executing zfs_mount() while another
  thread forks and execs. If the fork occurs while the directory is open, the
  child process will inherit (but not necessarily close immediately) the open fd
  for the directory, preventing the mount.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Alex Reece <alex@delphix.com>
lib/libzfs/common/libzfs_mount.c