[PATCH v2 03/10] android/sw_sync: use get_unused_fd_flags(O_CLOEXEC) instead of get_unused_fd()

2013-08-15 Thread Yann Droneaud
Macro get_unused_fd() is used to allocate a file descriptor with default flags. Those default flags (0) can be "unsafe": O_CLOEXEC must be used by default to not leak file descriptor across exec(). Instead of macro get_unused_fd(), functions anon_inode_getfd() or get_unused_fd_flags() should be

[PATCH v2 03/10] android/sw_sync: use get_unused_fd_flags(O_CLOEXEC) instead of get_unused_fd()

2013-08-15 Thread Yann Droneaud
Macro get_unused_fd() is used to allocate a file descriptor with default flags. Those default flags (0) can be unsafe: O_CLOEXEC must be used by default to not leak file descriptor across exec(). Instead of macro get_unused_fd(), functions anon_inode_getfd() or get_unused_fd_flags() should be