vfio: Add O_CLOEXEC flag to vfio device fd
authorAlex Williamson <alex.williamson@redhat.com>
Thu, 22 Aug 2013 16:33:41 +0000 (10:33 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 22 Aug 2013 16:33:41 +0000 (10:33 -0600)
commit5d042fbdbb2df46c9185942a0c6fe280906ba70c
tree87483859f6ac5cdd04209e6e0b16ec131766232c
parenta5d550703d2c2f0f9fc5fd4a249efa8984dc9353
vfio: Add O_CLOEXEC flag to vfio device fd

Add the default O_CLOEXEC flag for device file descriptors.  This is
generally considered a safer option as it allows the user a race free
option to decide whether file descriptors are inherited across exec,
with the default avoiding file descriptor leaks.

Reported-by: Yann Droneaud <ydroneaud@opteya.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/vfio.c