linux/net/sctp
Yann Droneaud 8a59bd3e9b sctp: use get_unused_fd_flags(0) 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 equivalent call to
get_unused_fd_flags(0) to preserve current behavor for existing code.

The hard coded flag value (0) should be reviewed on a per-subsystem basis,
and, if possible, set to O_CLOEXEC.

Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-02 16:14:11 -07:00
..
associola.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
auth.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-02-08 18:02:14 -05:00
bind_addr.c net: sctp: get rid of t_new macro for kzalloc 2013-06-17 17:08:04 -07:00
chunk.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
command.c [SCTP]: Remove sctp_add_cmd_sf wrapper bloat 2008-03-27 17:54:29 -07:00
debug.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
endpointola.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
input.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
inqueue.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
ipv6.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
Kconfig net: sctp: get rid of SCTP_DBG_TSNS entirely 2013-07-02 00:08:03 -07:00
Makefile sctp: implement sctp association probing module 2010-04-30 22:41:09 -04:00
objcnt.c sctp: Make the proc files per network namespace. 2012-08-14 23:29:53 -07:00
output.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
outqueue.c net: sctp: get rid of SCTP_DBG_TSNS entirely 2013-07-02 00:08:03 -07:00
primitive.c sctp: Push struct net down to sctp_chunk_event_lookup 2012-08-14 23:30:37 -07:00
probe.c net: sctp: attribute printl with __printf for gcc fmt checks 2013-05-01 15:04:10 -04:00
proc.c net: sctp: minor: sctp_seq_dump_local_addrs add missing newline 2013-06-25 16:33:04 -07:00
protocol.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
sm_make_chunk.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
sm_sideeffect.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
sm_statefuns.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
sm_statetable.c sctp: Make sysctl tunables per net 2012-08-14 23:32:16 -07:00
socket.c sctp: use get_unused_fd_flags(0) instead of get_unused_fd() 2013-07-02 16:14:11 -07:00
ssnmap.c net: sctp: sctp_ssnmap: remove 'malloced' element from struct 2013-04-17 14:13:02 -04:00
sysctl.c net: Convert uses of typedef ctl_table to struct ctl_table 2013-06-13 02:36:09 -07:00
transport.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
tsnmap.c net: sctp: remove SCTP_STATIC macro 2013-06-17 17:08:05 -07:00
ulpevent.c net: sctp: remove SCTP_STATIC macro 2013-06-17 17:08:05 -07:00
ulpqueue.c net: sctp: sctp_ulpq: remove 'malloced' struct member 2013-04-17 14:13:02 -04:00