2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-04 03:33:58 +08:00
linux-next/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 staging: sync: Add tracepoint support 2013-03-04 17:46:55 +08:00
alarm-dev.c staging: alarm-dev: information leak in alarm_compat_ioctl() 2013-06-04 10:26:14 -07:00
android_alarm.h staging: alarm-dev: Implement compat_ioctl support 2013-01-18 12:37:11 -08:00
ashmem.c staging: android: Fixed line over 80 char 2013-05-13 05:49:31 -07:00
ashmem.h staging: android: ashmem: Add support for 32bit ashmem calls in a 64bit kernel 2013-03-06 08:49:43 +08:00
binder_trace.h Staging: android: binder: Add some tracepoints 2012-10-22 13:04:29 -07:00
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 staging: android: lowmemorykiller: well-marked debug print 2013-03-25 11:02:55 -07:00
Makefile staging: sw_sync: Add cpu based sync driver 2013-03-04 17:40:08 +08:00
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 staging: sw_sync: Add cpu based sync driver 2013-03-04 17:40:08 +08:00
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 staging: sync: Refactor sync debug printing 2013-03-04 17:46:55 +08:00
timed_gpio.c staging/android: use module_platform_driver 2012-08-13 19:04:25 -07:00
timed_gpio.h Staging: android: timed_gpio: Removed spaces before tabs 2012-02-29 15:52:52 -08:00
timed_output.c drivers: avoid format string in dev_set_name 2013-07-03 16:07:41 -07:00
timed_output.h
TODO