linux/drivers/staging/android
Yann Droneaud 9c6cd3b390 android/sync: use get_unused_fd_flags(O_CLOEXEC) instead of get_unused_fd()
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 used with flags given by userspace.
If not possible, flags should be set to O_CLOEXEC to provide userspace
with a default safe behavor.

In a further patch, get_unused_fd() will be removed so that
new code start using anon_inode_getfd() or get_unused_fd_flags()
with correct flags.

This patch replaces calls to get_unused_fd() with call to
get_unused_fd_flags(O_CLOEXEC) following advice from Erik Gilling.

Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Cc: Erik Gilling <konkers@android.com>
Cc: Colin Cross <ccross@google.com>
Link: http://lkml.kernel.org/r/CACSP8SjXGMk2_kX_+RgzqqQwqKernvF1Wt3K5tw991W5dfAnCA@mail.gmail.com
Link: http://lkml.kernel.org/r/cover.1376327678.git.ydroneaud@opteya.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-15 17:27:30 -07:00
..
trace
alarm-dev.c staging: alarm-dev: information leak in alarm_compat_ioctl() 2013-06-04 10:26:14 -07:00
android_alarm.h
ashmem.c staging: android: Fixed line over 80 char 2013-05-13 05:49:31 -07:00
ashmem.h
binder_trace.h
binder.c staging: android: binder: fix binder interface for 64bit compat layer 2013-07-23 14:37:22 -07:00
binder.h staging: android: binder: fix binder interface for 64bit compat layer 2013-07-23 14:37:22 -07:00
Kconfig Removal of GENERIC_GPIO for v3.10 2013-05-09 09:59:16 -07:00
logger.c staging: android: logger: Correct write offset reset on error 2013-07-23 15:08:50 -07:00
logger.h staging: android: logger: use kuid_t instead of uid_t 2013-05-16 15:37:51 -07:00
lowmemorykiller.c
Makefile
ram_console.h
sw_sync.c android/sw_sync: use get_unused_fd_flags(O_CLOEXEC) instead of get_unused_fd() 2013-08-15 17:26:44 -07:00
sw_sync.h
sync.c android/sync: use get_unused_fd_flags(O_CLOEXEC) instead of get_unused_fd() 2013-08-15 17:27:30 -07:00
sync.h
timed_gpio.c
timed_gpio.h
timed_output.c drivers: avoid format string in dev_set_name 2013-07-03 16:07:41 -07:00
timed_output.h
TODO